Nagios

From RARForge
Revision as of 23:17, 5 March 2013 by Robertr (talk | contribs) (→‎Perc6/ir)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


NRPE Checks

  • you have nagios server and you have nagios-nrpe on the remote machine - default listen port 5666


1. define check_nrpe command

<source lang=bash>

 define command {
        command_line                    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t 100
        command_name                    check_nrpe
}

</source>

2. check_nrpe used in a service check

<source lang=bash>

define service {
 ...
 check_command                   check_nrpe!check_load
}

</source>

3. On the remote host

<source lang=bash>

command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20

</source>

Custom Nagios Checks

Perc6/ir

Download check_perc_6ir.pl

Options

  1. con: Controller Status
  2. log: Logical Device Status
  3. phys:Physical Device Status

Full Commands

Physical Device Status

<source lang=bash> ./check_perc.pl -D phys -T sm -H <host> -C <community> Physical Disks - #4: REBUILDING </source>

Logical Device Status

<source lang=bash>./check_perc.pl -D log -T sm -H <host> -C <community> Logical Disks - #1: DEGRADED #2: READY </source>

Controller Status

<source lang=bash> ./check_perc.pl -D con -T sm -H <host> -C <community> Controller(s) - #1: READY </source>

Nagios Configs

<source lang=bash>

# Define Service
define service {
 ...
 check_command                   check_dell_perc_6ir!<community>!phys
 # OR controller, logical
 #check_command                   check_dell_perc_6ir!<community>!con
 #check_command                   check_dell_perc_6ir!<community>!log

} </source> <source lang=bash> define command {

       command_line                    /etc/ISOMEDIA/nrpe/check_perc.pl -D $ARG2$ -T sm -H $HOSTADDRESS$ -C  $ARG1$
       command_name                    check_dell_perc_6ir

} </source>

OpenVPN


1. Enable Managment PORT for OpenVPN server - server.conf

<source lang=bash>

management localhost 7505 /etc/openvpn/config/password

</source>

2. NRPE check - nrpe.cfg

<source lang=bash>

command[check_openvpn]=/usr/lib64/nagios/plugins/check_tcp -H localhost -p 7505 -E -s 'YOUR_PASSWORD_HERE\nload-stats\n' -e 'SUCCESS:' -q  'quit\n'

</source>

3. Nagios Service Check
  • on server

<source lang=bash>

define service {
 ...
 check_command                   check_nrpe!check_openvpn
}

</source>

xl2tp/ipsec


nrpe
/etc/nagios/nrpe.cfg

<source lang=bash>

command[check_xl2tp]=/usr/lib64/nagios/plugins/check_procs -a 'xl2tpd' -c1:2
command[check_racoon]=/usr/lib64/nagios/plugins/check_procs -a 'racoon' -c1:2

</source>


Zimbra


sudoers
/etc/sudoers

<source lang=bash>

%nagios ALL=NOPASSWD:/usr/local/bin/check_zmstatus.pl

</source>

nrpe
/etc/nagios/nrpe.cfg

<source lang=bash>

command[check_zmstatus]=sudo /usr/local/bin/check_zmstatus.pl -b $ARG1$

</source>

Download
check_zmstatus.pl

NewzNab


  • checks mysql to make sure everything is current
  1. Parts are current
  2. Releases are current
  3. PostProcessing is not behind
  4. NFO post processing is not behind
Download Check check_nn.pl


Pacemaker crm_mon cluster


  • verify cluster is OK
Download Check check_crm

BIND mounts


  • Verify ALL bind mounts in /etc/fstab are mounted
Download Check check_bind_mounts.pl

NFS mounts


  • Verify ALL NFS mounts in /etc/fstab are mounted
Download Check check_nfs_mounts.pl

DRBD resources


  • Verify DRBD resources are OK
Download Check check_drbd

virsh / kvm hosts


  • Verify ALL kvm hosts are running - or specific
Download Check Check_kvm.sh

mdadm software raid


  • Verify software raid is OK
Download Check check_raid