SNMP: Difference between revisions

From CSCWiki
Jump to navigation Jump to search
(New page: == Debian == * sudo apt-get install snmpd * sudo nano /etc/default/snmp ** Remove the 127.0.0.1 part in the SNMPDOPTS line * sudo nano /etc/snmp/snmpd.conf ** Under the existing com2sec l...)
 
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Debian ==
= UPS =


We can monitor two of our UPSs via SNMP from any host on our 10.15.134.0/24 subnet (see [[Machine_List#UPS|Machine List]]):
* sudo apt-get install snmpd
* sudo nano /etc/default/snmp
** Remove the 127.0.0.1 part in the SNMPDOPTS line
* sudo nano /etc/snmp/snmpd.conf
** Under the existing com2sec lines, add the following: com2sec readonly 129.97.134.36 public
** If you want to query locally, you can add this line: com2sec readonly 127.0.0.1/24 public
** Find the lines starting with syslocation and sysconact and fill them in accordingly
* sudo invoke-rc.d snmpd restart


== Debian Setup ==
If you want to enable sensors, you'll need to get lm-sensors installed and working. Then you'll need to restart snmpd (sudo invoke-rc.d snmpd restart).

Install snmp and snmp-mibs-downloader (note: snmp-mibs-downloader is not available in stretch repository, so just download the deb from sid).

Download https://nagios.cscf.uwaterloo.ca/kiosk/powernet416.mib and place it in /usr/share/snmp/mibs

Run `download-mibs`

== Getting Status ==

snmpget -v 1 -c MSO mc-3015-h7-ups-1.cs.uwaterloo.ca PowerNet-MIB::upsBasicOutputStatus.0

This will return something like:

PowerNet-MIB::upsBasicOutputStatus.0 = INTEGER: onLine(2)

Latest revision as of 13:21, 16 December 2015

UPS

We can monitor two of our UPSs via SNMP from any host on our 10.15.134.0/24 subnet (see Machine List):

Debian Setup

Install snmp and snmp-mibs-downloader (note: snmp-mibs-downloader is not available in stretch repository, so just download the deb from sid).

Download https://nagios.cscf.uwaterloo.ca/kiosk/powernet416.mib and place it in /usr/share/snmp/mibs

Run `download-mibs`

Getting Status

   snmpget -v 1 -c MSO mc-3015-h7-ups-1.cs.uwaterloo.ca PowerNet-MIB::upsBasicOutputStatus.0

This will return something like:

   PowerNet-MIB::upsBasicOutputStatus.0 = INTEGER: onLine(2)