[naemon-users] Naemon macros as environment

Magnus magnus at boden.cx
Wed Mar 18 22:25:02 CET 2015


I run nagios for a few organisations and write a lot of plugins myself 
for checkpoint firewalls and other networking equipment.

My plugins rely on some macros to be available as environment variables 
and I just switched my first nagios qa environment to naemon which was 
pretty smooth except for the macro part.

I found in the documentation of naemon 
(http://www.naemon.org/documentation/usersguide/macros.html) that I 
should specify my macros in the command and I understand the logic 
behind not evaluating all macros:

define command {
     command_name    my_old_notification_script
     command_line    NAGIOS_HOSTNAME="$HOSTNAME$" 
/usr/local/bin/notifiy.pl ...

But this doesnt work for me when my plugin is run naemon says this on 
the service output.

(No output on stdout) stderr: execvp(NAEMON_HOSTNAME=SC_cswitch01, ...) 
failed. errno is 2: No such file or directory

Is there something wrong with my setup or is the documentation wrong?

define host {
     host_name       linuxbox
     _MACADDRESS     00:01:02:03:04:05

Also it would be great if at least the custom macros could be made 
available as environment variables. They will never be many so I think 
from a performance standpoint they should not cause to much overhead. 
Are they available as environment variables now?

Thanks for all the hard work you put into this and I really appreciate 
naemon which I anticipate will have a much faster development rate than 
nagios and already includes more modern components than nagios-core 
(like thruk and livestatus).

Best Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/naemon-users/attachments/20150318/5553a5f7/attachment.html>

More information about the Naemon-users mailing list