Nagios Core Macros + username stored in session
Posted: Sun Mar 18, 2012 9:33 am
Our company is trying to develop a script for automatic sending of helpdesk reports from the Nagios Services table (in Nagios Core) and we recently encountered several problems.
The idea is of calling a server side PHP script through the built-in "notes_url" functionality that will create an icon with a link by each service of each host. This script should get parameters like a username of the user who sent the report and an additional information about the reported service. The question is, whether and how is it possible to determine these information from the script?
We tried to pass the service informaion via standard nagios macros ($SERVICEDISPLAYNAME$, $SERVICEOUTPUT$ etc.) passed as parameters of the script, but in the Services table, only host macros are readable, though. Service macros are inaccessible (which is surprising).
Considering the username, I estimate Nagios Core is using apache session for user login. Is there any environmental variable that can be accessed to retrieve it?
The idea is of calling a server side PHP script through the built-in "notes_url" functionality that will create an icon with a link by each service of each host. This script should get parameters like a username of the user who sent the report and an additional information about the reported service. The question is, whether and how is it possible to determine these information from the script?
We tried to pass the service informaion via standard nagios macros ($SERVICEDISPLAYNAME$, $SERVICEOUTPUT$ etc.) passed as parameters of the script, but in the Services table, only host macros are readable, though. Service macros are inaccessible (which is surprising).
Considering the username, I estimate Nagios Core is using apache session for user login. Is there any environmental variable that can be accessed to retrieve it?