Tag Archive - nagios

create an snmp nagios plugin using python

To create a nagios plugin we need to keep in the mind the exit codes of the program/plugin which is interpreted by nagios to determine the status of the service.

1
2
3
4
5
Return Code          Status
0                         OK. The service is functioning normally
1                         WARNING. The service is about to reach to a critical state prior flagging it as CRITICAL
2                         CRITICAL. The service is down
3                         UNKNOWN. the plugin cannot determine the status of the service.

So any plugins you make should have an exit status, depending on the checks performed, here we will create a python snmp plugin using the pysnp module, the script also uses the optparse module so that arguments can be passed to the command line. Based on my previous post to monitor mysql database using mysql-snmp NetSNMP agent, I used the python pysnmp module to poll the mysql mib on the remote mysql server.

First create the host,hostgroup and the service for checking mysql innodb transactions in nagios

1
2
3
4
5
6
7
8
define host{
        use                     linux-server            ; Name of host template to use
       ; This host definition will inherit all variables that are defined
       ; in (or inherited by) the linux-server host template definition.
        host_name               mysqlserver
        alias                      mysqlserver
        address                 192.168.221.188
        }

Continue Reading…

 

Monitoring Dell SAS 5/iR RAID with nagios by using check_by_ssh plugin

the dell raid adapter would show up on ‘lspci’ like this

root@remoteserver:/usr/src# lspci
01:00.0 PCI bridge: Intel Corporation 6702PXH PCI Express-to-PCI Bridge A (rev 09)
01:00.1 PIC: Intel Corporation 6700/6702PXH I/OxAPIC Interrupt Controller A (rev 09)
02:08.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068 PCI-X Fusion-MPT SAS (rev 01)
04:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet PCI Express (rev 11)

Continue Reading…

 

creating a nagios plugin

Part 1

Create a Nagios Plug-in

We want to create a plug-in for Nagios using a shell script. The shell script is going to do the following:

 
Page 1 of 11
Theme Tweaker by Unreal