2006-12-03 Jason Schoonover Experimental Script Up/Down support ************************************************************************ THIS FEATURE IS HIGHLY EXPERIMENTAL AND HAS NOT BEEN TESTED VERY MUCH AT ALL, PLEASE USE THIS AT YOUR OWN RISK. ************************************************************************ New to Unnoc 1.0.7 is script updown support. This is a new unnoc feature that allows an external script to be called when a host goes up or down. This is useful, for instance, if you have a flaky piece of hardware hooked up to a web/snmp enabled power outlet, device; if the flaky device goes down, then simply send a command to the power outlet device to reset that port. This is one example. If this feature is used, it's recommended to use the fuzz feature, set to something at least higher than 3. Otherwise there could be other factors involved. 1. Configuration Configuration is all done in the unnoc.conf file. There are three variables to set: script_up This is the script that will get called once the host comes back up from being unavailable script_down This is the script that will get called when the host goes down script_criteria This will determine when the script gets called There are three possible values for script_criteria: ping If ping is used for updown, and the host is unavailable by ping snmp If snmp is used for updown, and the host is unavailable by snmp ping,snmp Will use both This is the same as updown. It is highly recommended to use both snmp and ping, that means that if both are unavailable, then it will run the script. Examples are below. If script_up is not specified, nothing is run If script_down is not specified, nothing is run Examples This example will: run the script_down command when snmp is unavailable run the script_up command when snmp is available again host { hostname = server1 community = public updown = ping fuzz = 3 script_criteria = snmp script_up = /var/www/unnoc/scripts/upscript.pl script_down = /var/www/unnoc/scripts/downscript.pl } This example will: run the script_down command when snmp and ping are both unavailable run the script_up command when snmp and ping are both available again host { hostname = server1 community = public updown = ping fuzz = 3 script_criteria = snmp,ping script_up = /var/www/unnoc/scripts/upscript.pl script_down = /var/www/unnoc/scripts/downscript.pl } The above example is equivalent to: host { hostname = server1 community = public updown = ping fuzz = 3 script_up = /var/www/unnoc/scripts/upscript.pl script_down = /var/www/unnoc/scripts/downscript.pl } This example will: run the script_down command when ping is unavailable run the script_up command when ping is available again host { hostname = server1 community = public updown = ping fuzz = 3 script_criteria = ping script_up = /var/www/unnoc/scripts/upscript.pl script_down = /var/www/unnoc/scripts/downscript.pl } This example will: run the script_down command when ping is unavailable host { hostname = server1 community = public updown = ping fuzz = 3 script_criteria = ping script_down = /var/www/unnoc/scripts/downscript.pl } vim:tw=72:wm=1