OpsView Custom Notification Method Example Variables

Related OpsView wiki pages

Perl code to export environment variables

foreach $key (sort keys(%ENV)) {
  print MYFILE "$key = $ENV{$key}\n";
}

Example output

CVS_RSH = ssh
DBIC_NO_WARN_BAD_PERL = 1
DBIC_UTF8COLUMNS_OK = 1
EDITOR = vi
G_BROKEN_FILENAMES = 1
HISTCONTROL = ignoredups
HISTSIZE = 1000
HOME = /var/log/nagios
HOSTNAME = hostname-of-your-opsivew-server.example.com
JAVA_HOME = /usr
LANG = en_US.UTF-8
LESSOPEN = |/usr/bin/lesspipe.sh %s
LOGNAME = nagios
MAIL = /var/spool/mail/nagios
NAGIOS_CONTACTEMAIL = the-contacts-email-address@example.com
NAGIOS_CONTACTGROUPNAMES = k2_opsview,k1_opsview-components,hostgroup4_servicegroup42,hostgroup3_servicegroup10,hostgroup2_servicegroup5,hostgroup2_servicegroup4,hostgroup2_servicegroup16,hostgroup2_servicegroup10,hostgroup2_servicegroup1,hostgroup12_servicegroup42
NAGIOS_CONTACTNAME = example-contact-name/01example-shared-notification-profile-name
NAGIOS_CONTACTPAGER = 
NAGIOS_HOSTACKAUTHOR = 
NAGIOS_HOSTACKCOMMENT = 
NAGIOS_HOSTADDRESS = hostname-of-the-host-youre-monitoring@example.com
NAGIOS_HOSTALIAS = Example host alias
NAGIOS_HOSTATTEMPT = 1
NAGIOS_HOSTGROUPNAME = Example hostgroup name
NAGIOS_HOSTNAME = examplehostname
NAGIOS_HOSTOUTPUT = TCP OK - 0.017 second response time on port 443
NAGIOS_HOSTSTATE = UP
NAGIOS_HOSTSTATETYPE = HARD
NAGIOS_LASTHOSTCHECK = 1370013206
NAGIOS_LASTHOSTDOWN = 1370013207
NAGIOS_LASTHOSTSTATE = DOWN
NAGIOS_LASTHOSTSTATECHANGE = 1370013207
NAGIOS_LASTHOSTUNREACHABLE = 0
NAGIOS_LASTHOSTUP = 1370010186
NAGIOS_LASTSERVICECHECK = 1370013206
NAGIOS_LASTSERVICECRITICAL = 1370013206
NAGIOS_LASTSERVICEOK = 1370012978
NAGIOS_LASTSERVICESTATE = CRITICAL
NAGIOS_LASTSERVICESTATECHANGE = 1370012978
NAGIOS_LASTSERVICEWARNING = 0
NAGIOS_LASTSTATECHANGE = 
NAGIOS_LONGDATETIME = Fri May 31 08:13:27 PDT 2013
NAGIOS_LONGHOSTOUTPUT = 
NAGIOS_LONGSERVICEOUTPUT = this is more output from the nagios plugin that exceeded the 200 characters for NAGIOS_SERVICEOUTPUT\n
NAGIOS_NOTIFICATIONNUMBER = 1
NAGIOS_NOTIFICATIONTYPE = PROBLEM
NAGIOS_SERVICEACKAUTHOR = 
NAGIOS_SERVICEACKCOMMENT = 
NAGIOS_SERVICEATTEMPT = 3
NAGIOS_SERVICEDESC = Example service description
NAGIOS_SERVICEOUTPUT = CRITICAL: this is some example output coming from your nagios plugin that is monitoring your host
NAGIOS_SERVICESTATE = CRITICAL
NAGIOS_SERVICESTATETYPE = HARD
NAGIOS_SHORTDATETIME = 2013-05-31 08:13:27
NAGIOS_TIMET = 1370013207
NAGIOS__CONTACTEXAMPLE_NOTIFICATION_METHOD_CONTACT_VARIABLE = Example contact variable set on the contact. Note, the name of the variable is "EXAMPLE_NOTIFICATION_METHOD_CONTACT_VARIABLE" 
OLDPWD = /var/log/nagios
OPSVIEW_BASE = /usr/local/nagios
PATH = /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/bin:/usr/local/nagios/bin:/usr/local/nagios/perl/bin:/opt/opsview/perl/bin:/usr/local/opsview-web/bin:/var/log/nagios/bin
PERL5LIB = /usr/local/nagios/lib:/usr/local/nagios/perl/lib:/opt/opsview/perl/lib/perl5:/usr/local/nagios/libexec
PERLTIDY = /usr/local/nagios/.perltidyrc
PWD = /usr/local/nagios/etc
QTDIR = /usr/lib64/qt-3.3
QTINC = /usr/lib64/qt-3.3/include
QTLIB = /usr/lib64/qt-3.3/lib
SHELL = /bin/bash
SHLVL = 2
SSH_ASKPASS = /usr/libexec/openssh/gnome-ssh-askpass
TERM = xterm-256color
USER = nagios
VISUAL = vi
_ = /usr/local/nagios/bin/nagios
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.