Monitor a Remote System with Nagios/SNMP

From CSLabsWiki

Jump to: navigation, search

This How To covers the process of setting up SNMP on a system in the labs. These steps will allow the the system to be monitored by both Nagios & Cacti on the Netstat VM.

Contents

On CentOS

Install & Configure SNMP

  • Install needed packages
yum install net-snmp ntp
  • Configure SNMP Daemon /etc/snmp/snmpd.conf
    • Note: You must insert various information in different areas below. Contact Matt for the required info. Also, if you have more than one partition/disk then you will need to add additional disk /var, etc. lines
rocommunity     <passphrase>  127.0.0.1
rocommunity     <passphrase>  <ipsallowed>
 
syslocation Clarkson University Applied CS Labs
syscontact <SysAdmin Name> <Email Address> 
disk /
exec timeskew /usr/local/sbin/ntp_check
exec uptime /usr/bin/uptime 
  • Deploy ntp_check script
    • Copy over /usr/local/sbin/ntp_check from Isengard to /usr/local/sbin/
    • chown root.root /usr/local/sbin/ntp_check
  • Configure SNMP to start at specific run levels
/sbin/chkconfig --levels 2345 snmpd on
  • Start daemon
/etc/init.d/snmpd start

On Ubuntu / Debian

Install & Configure SNMP

  • Install needed packages
apt-get update && apt-get install snmpd
  • Configure SNMP Daemon /etc/snmp/snmpd.conf
    • Note: You must insert various information in different areas below. Contact Matt for the required info. Also, if you have more than one partition/disk then you will need to add additional disk /var, etc. lines
rocommunity     <passphrase>  127.0.0.1
rocommunity     <passphrase>  <ipsallowed>
 
syslocation Clarkson University Applied CS Labs
syscontact <SysAdmin Name> <Email Address> 
disk /
exec timeskew /usr/local/sbin/ntp_check
exec uptime /usr/bin/uptime 
  • Deploy ntp_check script
    • Copy over /usr/local/sbin/ntp_check from Isengard to /usr/local/sbin/
    • chown root.root /usr/local/sbin/ntp_check
  • Edit /etc/default/snmpd
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid' 
  • Start daemon
/etc/init.d/snmpd start
Personal tools