Re: [Nagios-users] Nagios customization question...

2009-03-26 Thread Jim Avery
2009/3/26  :
>
> 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


Re: [Nagios-users] Nagios customization question...

2009-03-26 Thread Marc Powell

On Mar 26, 2009, at 1:58 PM, michael.washing...@fitchratings.com wrote:

>
> 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


mmm. tastes like homework. Crunchy ;) It's a custom plugin. It should  
be created in the directory where you normally store nagios plugins  
(is that it referenced in the script?) and made executable by the  
nagios user.

--
Marc


--
___
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


[Nagios-users] Nagios customization question...

2009-03-26 Thread Michael . Washington

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.


***

We need to monitor DNS server at ip x.x.x.x both for ICMP and DNS.


Here are definitions for nagios that used to use,  they will have to be
modified  by you to work with the DNS server.

linux-admins group would have 3 names Larry, Moe and Curly.

***

define host {
use generic-host
host_name   dns20
alias   ns20
address x.x.x.x
max_check_attempts  3
notification_period 24x7
notification_optionsd,u,r
check_command   check-host-alive
contact_groups  linux-admins
}




define service {
use generic-service
host_name  dns20
service_description PING
is_volatile 0
check_period24x7
max_check_attempts  8
normal_check_interval   10
retry_check_interval2
contact_groups  linux-admins
notification_period 24x7
notification_optionsc,r
check_command   check_ping!100.0,20%!900.0,60%
event_handler   networkdevice-notify-by-epager
event_handler_enabled   1
}


define service {
use generic-service
host_name  dns20
service_description dns_check
is_volatile 0
check_period24x7
max_check_attempts  8
normal_check_interval   20
retry_check_interval5
contact_groups  linux-admins
notification_period 24x7
notification_optionsc,r
check_command   company_check_dns
event_handler   networkdevice-notify-by-epager
event_handler_enabled   1
}

define command{
command_namecompany_check_dns
command_line$USER2$/company_check_dns $HOSTADDRESS$
}

### 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





# 'mkozlows' contact definition
define contact{
contact_namemkozlows
alias   Mariusz Kozlowski
service_notification_period 24x7
host_notification_period24x7
service_notification_optionsc,r
host_notification_options   d,r
service_notification_commands   notify-by-email,notify-by-epager
host_notification_commands
host-notify-by-email,host-notify-by-epager
email   mariusz.kozlow...@fitchratings.com
pager   9178053...@cingularme.com
}

define contact{
contact_namektai
alias   Ken Tai
service_notification_period 24x7
host_notification_period24x7
service_notification_optionsc,r
host_notification_options   d,r
service_notification_commands   notify-by-email,notify-by-epager
host_notification_commands
host-notify-by-email,host-notify-by-epager
email   kenneth@fitchratings.com
pager   9178053...@cingularme.com
}



# 'mbarker' contact definition
define contact{
contact_namembarker
alias   Matt Barker
service_notification_period 24x7
host_notification_period24x7
service_notification_optionsc,r
host_notification_options   d,r
service_notification_commands   notify-by-email,notify-by-epager
host_notification_commands
host-notify-by-email,host-notify-by-epager
email
matthew.bar...@fitchratings.com,mbarker9...@gmail.com
pager
6462564...@cingularme.com,5167493...@cingularme.com


__