How to Resolve OEM Agent ‘Availability Evaluation Error’

The following commands helped a client to resolve OEM agent “Availability Evaluation Error”. Just run them in sequence until the issue is resolved.

$ ping omshost
$ nslookup omshost
$ emctl pingOMS
$ emctl config agent addinternaltargets
$ emctl secure agent
$ emctl config agent listtargets
$ emctl clearstate agent

$ emctl upload agent
$ emctl reload agent

The agent should show UP now, otherwise continues the following steps:

$ emctl stop agent
$ emctl secure agent
$ emctl clearstate agent
$ emctl secure agent
$ emctl start agent
$ emctl upload agent 
$ emctl reload agent

$ emctl pingOMS 
$ emctl status agent