$USER1$ in notify mail

Patrick Morris patrick.morris at hp.com
Wed Oct 4 00:02:16 CEST 2006


On Tue, 03 Oct 2006, Sjaak Nabuurs wrote:

> How do I get this working with php in notify-mail.
> 
> $name=       $_ENV["NAGIOS_CONTACTALIAS"];
> $email=      $_ENV["NAGIOS_CONTACTEMAIL"];
> $SMS=        $_ENV["NAGIOS_CONTACTPAGER"];
> $datedb=     $_ENV["NAGIOS_DATE"];
> $timedb=     $_ENV["NAGIOS_TIME"];
> $USER1=      $_ENV["NAGIOS_USER1"];
> 
> 
> $SQL = "insert into SMS (name,email,sms,datedb,timedb,user1) VALUES ('$name', '$email','$SMS','$datedb','$timedb','$USER1');
> 
> Every value is working perfect but not the $USER1$
> 
> In my resource.cfg I have
> $USER1$=valueX
> 
> In the manual I read that the macro is available in Service Checks,Service Notifications,Host Checks,Host Notifications etc....
> 
> Do I do something wrong or something in the nagios.cfg to turn this on ?

The $USERx$ variables are not exported as environment variables, mainly 
for security reasons.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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