Nagios Plugin Prerequisites
Nagios Plugin Requirements for check_snmp:
Code:
perl -MCPAN -e 'install Net::SNMP'
Configure as much as possible automatically? yes
aptitude -y install snmp
Requirements for check_mysql: (NOTE: For my site, this is not necessary because I will run it locally on MySQL server)
Code:
aptitude -y install libmysqlclient-dev
Requirements for check_nrpe:
Code:
aptitude -y install libssl-dev
Nagios Plugins
Download, build and install Nagios plugins (NOTE: You can use newer links once new versions become available):
Code:
cd /usr/local/src
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz
tar xzf /usr/local/src/nagios-plugins-1.4.15.tar.gz
cd /usr/local/src/nagios-plugins-1.4.15
./configure --sysconfdir=/etc/nagios --localstatedir=/var/nagios --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
Download, build and install NRPE plugin
Code:
cd /usr/local/src
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.13.tar.gz
tar xzf /usr/local/src/nrpe-2.13.tar.gz
cd /usr/local/src/nrpe-2.13
./configure --sysconfdir=/etc/nagios --libexecdir=/usr/local/nagios/libexec --prefix=/usr/local/nagios --localstatedir=/var/nagios --with-nagios-user=nagios --with-nagios-group=nagios --with-nrpe-user=nagios --with-nrpe-group=nagios --enable-ssl=yes --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
make all
make install-plugin
Verify that Plugins are Working!
For all the plugins we intend on using, we need to verify they are working before trying to integrate them into Nagios. However, not all plugins will work without first configuring the target to be monitored.
Ping an IP address you know to be active:
Code:
/usr/local/nagios/libexec/check_icmp -H 192.168.107.20
Check for an HTTP reply from a web server:
Code:
/usr/local/nagios/libexec/check_http -H 192.168.107.20
Check for a response from an HP LaserJet printer:
Code:
/usr/local/nagios/libexec/check_hpjd -H 192.168.107.51 -C public
Check the uptime of a router via SNMP:
Code:
/usr/local/nagios/libexec/check_snmp -H 192.168.107.1 -C public -o sysUpTime.0
NOTE: For whatever reason, this command hangs on me. Not sure what I did wrong this time but I'll track it down, fix it and update these dox.
Check a MySQL server (if on local host):
Code:
/usr/local/nagios/libexec/check_mysql -H 192.168.107.20 -P 3306 -u mysqlid -p mysqlpassword
NOTE: This will fail if you do not configure the MySQL server 1st. However, you might want to run the MySQL command remotely via NRPE instead.
Bookmarks