This applet monitors “track 3” events which is configured to monitor a VM server via Ping. When ‘Track 3’ is up, it will trigger this script, execute the show commands, capture the output and send them to me in an email:

event manager applet vm-2008-up authorization bypass
event track 3 state up
action 1.01 wait 5
action 1.02 syslog msg "------ IP SLA GENERATED MESSAGE ---------"
action 1.03 syslog msg "------ VM-2008 Server UP ----"
action 1.04 cli command "enable"
action 1.05 set result ""
action 1.06 cli command "show clock"
action 1.07 append result "$_cli_result"
action 1.08 cli command "show track 3 brief"
action 1.09 append result "$_cli_result"
action 2 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "VM-2008 Server UP" body "$result"

courtesy of Chris Partsenidis