Hello All, i am working on a use case where i want to check the agent status and send mail if agent status gets changed either it is Y to N or N to Y.
I am getting mail which i.e in the same domain, below script also working fine. But i want to send mail outside of domain, is that posible? if possible, please suggest me.
:SET &CURRENT_STATUS# = SYS_HOST_ALIVE("REST01")
:PUT_VAR "VARA.AGENT_CURSTATUS", "REST01", &CURRENT_STATUS#
:SET &PREVIOUS_STATUS# = GET_VAR("VARA.AGENT_PRESTATUS", "REST01")
:IF &CURRENT_STATUS# <> &PREVIOUS_STATUS#
: IF &CURRENT_STATUS# = "N"
: SET &EMAIL_TO# = "Automic@m***lab.com"
: SET &SEND_EMAIL# = SEND_MAIL("Automic@m***lab.com", &EMAIL_TO#, "Agent REST01 Alert", "The Agent REST01 is not active! Please check the system.",,,,'192.168.10.1*')
: PRINT "Email notification sent for inactive agent REST01."
: ELSE
: PRINT "Agent REST01 is active."
: SET &EMAIL_TO# = "Automic@m***lab.com"
: SET &SEND_EMAIL# = SEND_MAIL("Automic@m***lab.com", &EMAIL_TO#, "Agent REST01 Alert", "The Agent REST01 status changed its started now! ",,,,'192.168.10.1*')
: PRINT "Agent REST01 is Running"
: ENDIF
:ENDIF
:PUT_VAR "VARA.AGENT_PRESTATUS", "REST01", &CURRENT_STATUS#
Regards,
Kiran Kumar Vasanthavada.