Change 2D map background on host Down/Up


#1

Hi,

Here’s my problem… I have configured the 2d map in Nagios so I have a nice visual of my devices.
Unfortunately, the green “Up” or red “Down” state of an host is ridiculousely small.
So, I thougt of changing the background png file.
I tried to do that by writing a small script on ping errors on some device… BUT -this is the problem-, the script does not seem to be launched.
I made :

define command{ command_name change_background command_line /usr/lib/nagios/plugins/change_background_map $HOSTSTATE$ }

and

define service{ name critic-serv active_checks_enabled 1 passive_checks_enabled 1 parallelize_check 1 obsess_over_service 1 check_freshness 0 notifications_enabled 1 event_handler_enabled 1 event_handler change_background flap_detection_enabled 1 process_perf_data 1 retain_status_information 1 retain_nonstatus_information 1 is_volatile 0 check_period 24x7 max_check_attempts 2 normal_check_interval 2 retry_check_interval 1 contact_groups GROUP notification_interval 240 notification_period 24x7 notification_options u,w,c,r register 0 }

define service{
use critic-serv
host_name myserver
service_description Ping
check_command check_ping!500,60%!5000,100%
}

When I launch the script from the Command line, it’s OK.
All owners and mods are the same in the dir /usr/lib/nagios/plugins.

Tried to be as complete as possible…
Hope someone will be able to help !
:frowning:

Thanx and Merry Xmas :stuck_out_tongue:


#2

please read this url to understand why I’m going to suggest this:
nagios.sourceforge.net/docs/1_0/ … tion_notes

To enable your event handler it’s not enough to only put
event_handler_enabled=1 in your config.
You must also go to the cgi webpage for each service in question and enable the event handler, or if you only have a disable link, then disable and then enable it. This is due to retention as explained in the link above.


#3

I create a new thread as this become a more general problem.
Thanx for your answer