2009/3/26 <michael.washing...@fitchratings.com>: > > The gurus have asked me to include the following scripting in our branch > office Nagios server configuration in order to monitor a remote co-location > site DNS server . I understand how/where to include the > host/service/contact/command definitions scripting, but where (what > file(s)) do I include the company_check_dns scripting command set procedure > listed near the bottom? I am running v3.0.2 on Fedora with the quick > installation setup.
[snip stuff I assume you're happy with] > define command{ > command_name company_check_dns > command_line $USER2$/company_check_dns $HOSTADDRESS$ > } Above is the command definition which hopefully you're happy with. Note the use of "$USER2$" rather than the usual "$USER1$". This refers to a macro containing a path to the location of your script. You should find this in your resource file. See http://nagios.sourceforge.net/docs/3_0/configmain.html#resource_file > ####### company_check_dns > #!/bin/bash > > PATH=$PATH:/usr/lib/nagios/company-plugins > > DOMAINSTOCHECK="ftp.company1.com company.com company2.com comp\ > any3.com company4.com company5.com" > > for i in `echo $DOMAINSTOCHECK`; do > RESULT=`check_dns -H $i -s $1 | grep CRITICAL` > if [ "x$RESULT" != "x" ] > then > echo "DNS CRITICAL - $1 - $i" > exit 2 > fi > done > > echo "DNS ok - $1"; > exit 0 > #######end of company_check_dns The above is what you should create as your plugin - copy this in to a file under the directory which $USER2$ points to and make it executable. [ snip contact definitions which I assume you're happy with] hth, Jim ------------------------------------------------------------------------------ _______________________________________________ Nagios-users mailing list Nagios-users@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