OMS decided to shutdown the agent because of the following reason sent from OMS: AGENT_TZ_MISMATCH

Today I was trying to start my OEM agent in one of my dev server and got below error while starting it :-

==>./emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Starting agent ...........failed.
Consult emctl.log and emagent.nohup in: /u01/oracle/product/agent/agent_inst/sysman/log


Cause :-

Crosschecked the logs as mentioned above and got below in emagent.nohup logfile 

highlighted one below is of our interest

 --- EMState agent
----- Wed Jun 14 11:58:16 2017::20552::Auto tuning the agent at time Wed Jun 14 11:58:16 2017 -----
----- Wed Jun 14 11:58:17 2017::20552::Finished auto tuning the agent at time Wed Jun 14 11:58:17 2017 -----
----- Wed Jun 14 11:58:17 2017::20552::Launching the JVM with following options: -Xmx128M -server -Djava.security.egd=file:///dev/./urandom -Dsun.lang.ClassLoader.allowArraySyntax=true -XX:+UseLinuxPosixThreadCPUClocks -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -----
----- Wed Jun 14 11:58:17 2017::20552::Agent Launched with PID 20672 at time Wed Jun 14 11:58:17 2017 -----
----- Wed Jun 14 11:58:17 2017::20552::Previous Thrash State(-1,-1) -----
----- Wed Jun 14 11:58:17 2017::20672::Time elapsed between Launch of Watchdog process and execing EMAgent is 1 secs -----
2017-06-14 11:58:17,396 [1:main] WARN - Missing filename for log handler 'wsm'
2017-06-14 11:58:17,402 [1:main] WARN - Missing filename for log handler 'opss'
2017-06-14 11:58:17,403 [1:main] WARN - Missing filename for log handler 'opsscfg'
OMS decided to shutdown the agent because of the following reason sent from OMS:  AGENT_TZ_MISMATCH
----- Wed Jun 14 11:58:26 2017::20552::Checking status of EMAgent : 20672 -----
----- Wed Jun 14 11:58:26 2017::20552::EMAgent exited at Wed Jun 14 11:58:26 2017 with return value 0. -----
----- Wed Jun 14 11:58:26 2017::20552::writeAbnormalExitTimestampToAgntStmp: exitCause=NORMAL : restartRequired=0 -----
----- Wed Jun 14 11:58:26 2017::20552::EMAgent was shutdown normally. -----
----- Wed Jun 14 11:58:26 2017::20552::Exiting watchdog loop

We can clearly see that there is some timezone mismatch issue of the agent with the OMS repository server

Solution :-

As above error state that there is a timezone mismatch between the agent server and OMS repository server.

or OMS repository database must be having incorrect timezone related details for agent server

Below steps resolved my error:-

[Server1][oracle][amit1]
EM_HOME/bin$
==>./emctl resetTZ agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Updating /u01/oracle/product/agent/agent_inst/sysman/config/emd.properties...
Successfully updated /u01/oracle/product/agent/agent_inst/sysman/config/emd.properties.
Login as the em repository user and run the  script:
exec mgmt_target.set_agent_tzrgn('Server1.test.com:9901','US/Eastern')
and commit the changes
This can be done for example by logging into sqlplus and doing
SQL> exec mgmt_target.set_agent_tzrgn('Server1.test.com:9901','US/Eastern')
SQL> commit

Login to OMS repository database and connect using SYSMAN and execute below procedure :-

exec mgmt_target.set_agent_tzrgn('Server1.test.com:9901','US/Eastern')

Do a clearstate and securing of your agent again and start it :-

==>./emctl clearstate agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
EMD clearstate completed successfully
[Server1][oracle][amit1]
EM_HOME/bin$
==>./emctl secure agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Agent is already stopped...   Done.
Securing agent...   Started.
Enter Agent Registration Password :
Securing agent...   Successful.
[Server1][oracle][amit1]
EM_HOME/bin$
==>./emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Starting agent ..... started.

Agent started successfully

Comments