Environment variables

Israel Brewster israel at frontierflying.com
Tue Sep 15 22:24:19 CEST 2009


Is there anything special (say, in the nagios config) that I need to  
do in order to use environment variables in my notification scripts?  
 From the documentation, it looks like the various macros should be  
made available as enviroment variables, such as NAGIOS_HOSTNAME.  
However, when I do the following in my shell script:

ADDRESS=$NAGIOS_HOSTADDRESS
NAME=$NAGIOS_HOSTNAME
STATE=$NAGIOS_SERVICESTATE
TYPE=$NAGIOS_NOTIFICATIONTYPE
TIME=$NAGIOS_LONGDATETIME
DESC=$NAGIOS_SERVICEDESC
INFO=$NAGIOS_SERVICEOUTPUT

I get nothing in the notification email that uses the above set  
variables. Additionally, if I dump the output of the env command into  
the e-mail, it doesn't show any NAGIOS_ variables. What am I missing  
here? The goal is for the script to be able to query the appropriate  
environment variables directly, rather than having to have a huge long  
(hard to read) command string that passes in everything from the  
macros as arguments. Thanks.

-----------------------------------------------
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090915/65db046c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Israel Brewster.vcf
Type: text/directory
Size: 417 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090915/65db046c/attachment.bin>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090915/65db046c/attachment-0001.html>
-------------- next part --------------
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list