SINT - snmptranslate and snmpwalk
snmptranslate
$ snmptranslate -On NET-SNMP-EXTEND-MIB::nsExtendOutput1Table .1.3.6.1.4.1.8072.1.3.2.3
snmpwalk
$ snmpwalk -v2c -c somesecgrp my.hostname.net .1.3.6.1.4.1.8072.1.3.2.3 iso.3.6.1.4.1.8072.1.3.2.3.1.1.8.117.112.103.114.97.100.101.115 = STRING: "2" iso.3.6.1.4.1.8072.1.3.2.3.1.2.8.117.112.103.114.97.100.101.115 = STRING: "2" iso.3.6.1.4.1.8072.1.3.2.3.1.3.8.117.112.103.114.97.100.101.115 = INTEGER: 1 iso.3.6.1.4.1.8072.1.3.2.3.1.4.8.117.112.103.114.97.100.101.115 = INTEGER: 2
Usage (Nagios)
services.cfg
define service {
use generic-service ; Name of service template to use
host_name mymonitoredhost
service_description waiting upgrades ; upgrades waiting
contact_groups linux-admins
notification_options u,c,r
check_command check_snmp!iso.3.6.1.4.1.8072.1.3.2.3.1.1.8.117.
112.103.114.97.100.101.115!0!2!somesecgrp
}
Note: There is newline (\n) character in snmp OID string - between 117.112 (in check_snmp command), please remove it before use if you will copy&paste this BASH script
to determine number of upgrades waiting on APT based systems/usr/local/bin/check-apt-upgrades.bash
#! /bin/bash upgrade_status="$(apt-get -q -s upgrade)" if (echo "$upgrade_status" | grep -i "security" > "/dev/null"); then echo "3" exit 3 fi upgrades_line=$(echo "$upgrade_status" | grep '[0-9]* upgraded, [0-9]* newly installed, [0-9]* to remove and [0-9]* not upgraded') if [ $? -gt 0 ]; then echo "1" exit 1 fi upgrades_number=$(echo "$upgrades_line" | awk '/ upgraded/ {print $1}') if [ $? -gt 0 ]; then echo "1" exit 1 fi if [ "$upgrades_number" -gt 0 ]; then echo "2" exit 2 fi echo "0" exit 0
BASH script
to determine number of upgrades waiting on YUM based systems/usr/local/bin/check-yum-upgrades.bash
#! /bin/bash sudo yum check-update > "/dev/null" es=$? if [ $es -ne 0 ]; then if [ $es -eq 100 ]; then echo "3" exit 3 fi echo "1" exit 1 fi echo "0" exit 0
SNMP daemon configuration
snmpd.conf
extend upgrades /usr/local/bin/check-apt-upgrades.bash
README.agent-mibs
Source: net-snmp.org: README.agent-mibsREADME.agent-mibs
The following is a list of SNMP MIB tables and object, and their
implementation status for Net-SNMP.
Note that simply adding a MIB file does not allow the agent to return values
for the MIB. See the FAQ question here for details:
http://www.net-snmp.org/FAQ.html#How_do_I_add_a_MIB_to_the_agent_
This table was generated by inspecting the source, so it may be incorrect,
especially with regards to OS platform support. If an object/table is listed
for your OS but doesn't work (or vice-cersa), let us know.
The Rel column indicates the first release that an object/table was
available. That does not imply that all platforms indicated in the OS
column were supported for that release. There is no breakdown of feature
introduction by platform. Note that the earliest CVS information I could
find was for sometime around ucd-snmp 3.2.
The OS platform is probably the least reliable of the columns, as most are
marked as 'unix?', indicating that most unix-based platforms should
support the table.
An '=' in a file path indicates that the table/object name should be
substituted in place of the '=' in the path. All paths are relative to
the agent/mibgroup directory.
X.*.0 indicates all scalars under node X.
X.?.0 indicates all scalars execept as noted.
.Y.0 indicates that Y is an exception to the previous scalar group.
Table Style
----------------------------
O old (ucd) style helper
D table data helper
I table iterator
A iterate_access
S scalar helper
G scalar group helper
W watched scalar
M mfd
C container table
Platform Keys
------------------
A All systems
U unix based
L Linux
S Solaris
H HP-UX
B BSD Based
F FreeBSD
O OpenBSD
N NetBSD
X MacOSX
W Win32 based
$ Microsoft
C cygwi---
M MingW
A number after a platform indicates notes at the bottom of the file.
table/object group OS Rel Styl File
==============================================================================
SNMPv2-MIB
system.?.0 A 5.5 W mibII/system_mib.c
.sysORLastChange.0 A 5.5 W mibII/sysORTable.c
sysORTable A 5.5 C mibII/sysORTable.c
snmp.*.0 A 5.5 G mibII/snmp_mib_5_5.c
setSerialNo.0 A 5.0 W mibII/setSerialNo.c
------------------------------------------------------------------------------
SNMP-FRAMEWORK-MIB
snmpEngine.*.0 A ~4.0? O snmpv3/snmpEngine.c
------------------------------------------------------------------------------
SNMP-MPD-MIB
snmpMPDStats.*.0 A ~4.0? G snmpv3/snmpMPDStats_5_5.c
------------------------------------------------------------------------------
SNMP-TARGET-MIB
snmpTargetSpinLock.0 A 3.6 O target/snmpTargetAddrEntry.c
snmpTargetAddrTable A 3.6 O target/snmpTargetAddrEntry.c
snmpTargetParamsTable A 3.6 O target/snmpTargetParamsEntry.c
snmpUnavailableContexts.0 A 5.5 G target/target_counters_5_5.c
snmpUnknownContexts.0 A 5.5 G target/target_counters_5_5.c
------------------------------------------------------------------------------
SNMP-NOTIFICATION-MIB
snmpNotifyTable A 4.2 O notification/=
snmpNotifyFilterProfileTable A 4.2 O notification/=
snmpNotifyFilterTable A 4.2 O notification/=
nlmConfig.*.0 ---
nlmStats.*.0 ---
------------------------------------------------------------------------------
NOTIFICATION-LOG-MIB
* ---
------------------------------------------------------------------------------
SNMP-PROXY-MIB
snmpProxyTable ---
------------------------------------------------------------------------------
SNMP-USER-BASED-SM-MIB
usmStats.*.0 A ~4.0 O snmpv3/usmStats.c
usmStats.*.0 A 5.5 G snmpv3/usmStats_5_5.c
usmUserTable A ~4.0? O snmpv3/usmUser.c
------------------------------------------------------------------------------
SNMP-VIEW-BASED-ACM-MIB
vacmContextTable A ~3.5 I mibII/vacm_context.c
vacmSecurityToGroupTable A ~3.5 O
vacmAccessContextTable A ~3.5 O mibII/vacm_vars.c
vacmViewSpinLock.0 A ~3.5 O
vacmViewTreeFamilyTable A ~3.5 O
------------------------------------------------------------------------------
SNMP-USM-DH-OBJECTS-MIB
usmDHPublicObjects.*.0 A 5.2 S snmp-usm-dh-objects-mib/=/*
usmDHUserKeyTable A 5.2 M snmp-usm-dh-objects-mib/=/*
usmDHKickstartTable ---
------------------------------------------------------------------------------
SNMP-COMMUNITY-MIB
snmpCommunityMIBObjects.*.0 ---
snmpCommunityTable ---
snmpTargetAddrExtTable ---
------------------------------------------------------------------------------
IF-MIB
ifNumber.0 U $2 ~3.2 O mibII/interfaces.c
ifTableLastChange.0 ---
ifTable (old) U $2 ~3.5 O mibII/interfaces.c
ifTable (new) L 5.2 M if-mib/ifTable/*
ifTable (new) FOS 5.4 M if-mib/ifTable/*
ifXTable L 5.2 M if-mib/ifXTable/*
ifXTable FOS 5.4 M if-mib/ifXTable/*
ifStackLastChange.0 ---
ifStackTable ---
ifTestTable ---
ifRcvAddressTable ---
------------------------------------------------------------------------------
RFC1213-MIB
atTable (D) U $2 ~3.5 O mibII/at.c
egp.*.0 ---
egpNeighTable ---
------------------------------------------------------------------------------
IP-MIB
ip.*.0 U $2 ~3.2 G mibII/ip.c
icmp.*.0 U $2 ~3.2 G mibII/icmp.c
ipSystemStatsTable L 5.2 M ip-mib/=/*
ipSystemStatsTable S 5.5 M ip-mib/=/*
ipIfStatsTableLastChange.0 ---
ipIfStatsTable L-- 5.5 M ip-mib/=/*
ipAddrTable (D) U $2 4.2 O mibII/ipAddr.c
ipAddressSpinLock.0 A 5.5 O mibII/ipAddr.c
ipAddressTable L 5.2 M ip-mib/=/*
ipAddressTable S 5.5 M ip-mib/=/*
ipAddressPrefixTable L 5.3 M ip-mib/=/*
ipRouteTable (D) U $2 ~3.5 O mibII/*route*.c
ipNetToMediaTable (D) U $2 ~3.5 O mibII/at.c
ipNetToPhysicalTable (implemented as inetNetToMediaTable)
inetNetToMediaTable L 5.2 M ip-mib/=/*
ipDefaultRouterTable L 5.5 M ip-mib/=/*
icmpStatsTable ---
icmpMsgStatsTable ---
ipv4InterfaceTableLastChange ---
ipv4InterfaceTable L 5.3 M ip-mib/=/*
ipv6InterfaceTableLastChange ---
ipv6InterfaceTable L 5.3 M ip-mib/=/*
ipv6RouterAdvertTable ---
ipv6IpForwarding.0 L 5.3 S ip-mib/ip_scalars.c
ipv6IpDefaultHopLimit.0 L 5.3 S ip-mib/ip_scalars.c
ipv6RouterAdvertSpinLock.0 ---
ipv6ScopeZoneIndexTable ---
ipForwarding.0 L 5.4 S ip-mib/ip_scalars.c
ipDefaultTTL.0 L 5.4 S ip-mib/ip_scalars.c
------------------------------------------------------------------------------
IPV6-MIB
ipv6MIBObjects.?.0 U 4.1 O mibII/ipv6.c
.ipv6IfTableLastChange.0 ---
.ipv6RouteNumber.0 ---
.ipv6DiscardedRoutes.0 ---
ipv6Interfaces U1 4.1 O mibII/ipv6.c
ipv6IfTable U1 4.1 O mibII/ipv6.c
ipv6IfStatsTable U1 4.1 O mibII/ipv6.c
ipv6AddrPrefixTable ---
ipv6AddrTable ---
ipv6RouteTable ---
ipv6NetToMediaTable ---
------------------------------------------------------------------------------
IPV6-TCP-MIB
ipv6TcpConnTable U1 4.1 O mibII/ipv6.c
------------------------------------------------------------------------------
IPV6-UDP-MIB
ipv6UdpTable U1 4.1 O mibII/ipv6.c
------------------------------------------------------------------------------
IPV6-ICMP-MIB
ipv6IfIcmpTable U1 4.1 O mibII/ipv6.c
------------------------------------------------------------------------------
IP-FORWARD-MIB
ipForward.*.0 ---
ipForwardTable (D) ---
ipCidrRouteTable (D)(new) L 5.2 A mibII/=
ipCidrRouteTable (D)(newer) L 5.2 M ip-forward-mib/=/*
inetCidrRouteTable L 5.2 M ip-forward-mib/=/*
------------------------------------------------------------------------------
TCP-MIB
tcp.*.0 U $2 ~3.2 G mibII/tcp.c
tcpConnTable (D) U $2 4.2 I mibII/tcpTable.c
tcpConnectionTable L 5.3 M tcp-mib/=/*
tcpConnectionTable S 5.4 M tcp-mib/=/*
tcpListenerTable L 5.3 M tcp-mib/=/*
tcpListenerTable S 5.4 M tcp-mib/=/*
------------------------------------------------------------------------------
UDP-MIB
udpEndpointTable L 5.3 M udp-mib/=/*
udpEndpointTable S 5.4 M udp-mib/=/*
udp.*.0 U $2 ~3.2 G mibII/udp.c
udpTable (D) U $2 4.2 I mibII/udpTable.c
------------------------------------------------------------------------------
IF-INVERTED-STACK-MIB
* ---
------------------------------------------------------------------------------
RMON-MIB
etherStatsTable U 5.0 O Rmon/statistics.c
.etherStatsJabbers L3 5.5 M rmon-mib/=/*
etherHistoryControlTable U 5.0 O Rmon/history.c
etherHistoryTable U 5.0 O Rmon/history.c
alarmTable U 3.2 O Rmon/alarm.c
eventTable U 3.2 O Rmon/event.c
logTable U 5.0 O Rmon/event.c
hostControlTable ---
hostTable ---
hostTimeTable ---
hostTopNControlTable ---
hostTopNTable ---
matrixControlTable ---
matrixSDTable ---
matrixDSTable ---
filterTable ---
channelTable ---
bufferControlTable ---
captureBufferTable ---
------------------------------------------------------------------------------
HOST-RESOURCES-MIB
hrSystem.*.0 U ~3.3 O host/hr_system.c
hrMemorySize U ~3.3 O host/hr_storage.c
hrStorageTable U ~3.3 O host/hr_storage.c
hrDeviceTable U ~3.3 O host/hr_device.c
hrProcessorTable U ~3.3 O host/hr_proc.c
hrNetworkTable U ~3.3 O host/hr_network.c
hrPrinterTable U ~3.3 O host/hr_print.c
hrDiskStorageTable U ~3.3 O host/hr_disk.c
hrPartitionTable U ~3.3 O host/hr_partition.c
hrFSTable U ~3.3 O host/hr_filesys.c
hrSWOSIndex.0 --- ~3.3 O host/hr_swrun.c
hrSWRunTable U ~3.3 O host/hr_swrun.c
hrSWRunPerfTable U ~3.3 O host/hr_swrun.c
hrSWInstalled.*.0 U ~3.3 O host/hr_swinst.c
hrSWInstalledTable U ~3.3 O host/hr_swinst.c
------------------------------------------------------------------------------
DISMAN-EVENT-MIB
mteTriggerTable A 5.0 O disman/=
mteTriggerFailures.0 ---
mteTriggerDeltaTable A 5.0 O disman/=
mteTriggerExistenceTable A 5.0 O disman/=
mteTriggerBooleanTable A 5.0 O disman/=
mteTriggerThresholdTable A 5.0 O disman/=
mteObjectsTable A 5.0 O disman/=
mteEventTable A 5.0.7 D disman/=
mteEventFailures.0 ---
mteEventNotificationTable A 5.0.7 D disman/=
mteResource.*.0 ---
mteEventSetTabel ---
------------------------------------------------------------------------------
DISMAN-SCHEDULE-MIB
schedLocalTime.0 A 5.3 D disman/schedule/=
schedTable A 5.3 D disman/schedule/=
------------------------------------------------------------------------------
DISMAN-EXPRESSION-MIB (expired ID)
expErrorTable U 5.2 O disman/expression/=
expExpressionTable U 5.2 O disman/expression/=
expObjectTable U 5.2 O disman/expression/=
expValueTable U 5.2 O disman/expression/=
------------------------------------------------------------------------------
DISMAN-PING-MIB (draft-ietf-disman-remops-mib-v2*)
pingCtlTable U 5.2 O disman/ping/=
pingProbeHistoryTable U 5.2 O disman/ping/=
pingResultsTable U 5.2 O disman/ping/=
------------------------------------------------------------------------------
DISMAN-TRACEROUTE-MIB (draft-ietf-disman-remops-mib-v2*)
traceRouteCtlTable U 5.2 O disman/traceroute/=
traceRouteHopsTable U 5.2 O disman/traceroute/=
traceRouteProbeHistory U 5.2 O disman/traceroute/=
traceRouteResultsTable U 5.2 O disman/traceroute/=
------------------------------------------------------------------------------
DISMAN-NSLOOKUP-MIB (draft-ietf-disman-remops-mib-v2*)
lookupCtlTable U 5.2 O disman/nslookup/=
lookupResultsTable U 5.2 O disman/nslookup/=
------------------------------------------------------------------------------
DISMAN-SCRIPT-MIB
* ---
------------------------------------------------------------------------------
EtherLike-MIB
dot3StatsTable L 5.5 M etherlike-mib/=
------------------------------------------------------------------------------
AGENTX-MIB
* ---
------------------------------------------------------------------------------
LM-SENSORS-MIB
lmTempSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
lmFanSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
lmVoltSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
lmMiscSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
------------------------------------------------------------------------------
UCD-SNMP-MIB
prTable U $ ~3.2 O ucd-snmp/proc.c
memory.*.0 U ~3.2 O ucd-snmp/memory*.c
extTable U $ ~3.2 D ucd-snmp/extensible.c
dskTable U 3.2 O ucd-snmp/disk.c
fileTable A 3.6 O ucd-snmp/file.c
laTable U $ ~3.2 O ucd-snmp/loadave.c
systemStats.*.0 U 3.4 O ucd-snmp/vmstat*.c
ipFwAccTable U 3.5 O misc/ipfwacc.c
dlModTable U 4.2 O ucd-snmp/dlmod.c
diskIOTable U 4.1 O ucd-snmp/diskio.c
ucdDemoMIBObjects A ~3.5 O examples/ucdDemoPublic.c
logMatch U ~3.5 O ucd-snmp/logmatch.c
version.*.0 A ~3.2 O ucd-snmp/versioninfo.c
snmperrs.*.0 A ~3.5 O ucd-snmp/errormib.c
mrTable (D) ---
------------------------------------------------------------------------------
NET-SNMP-EXTEND-MIB
nsExtendConfigTable U ~3.5 D agent/extend.c
nsExtendOutput1Table U ~3.5 D agent/extend.c
nsExtentOutput2Table U ~3.5 D agent/extend.c
------------------------------------------------------------------------------
NET-SNMP-AGENT-MIB
nsModuleTable A 5.0 I agent/nsModuleTable.c
nsCacheTable A 5.0 I agent/nsCache.c
nsConfigDebug.*.0 A 5.0 I agent/nsDebug.c
nsDebugTokenTable A 5.0 O
nsConfigLogging A 5.0 I agent/nsLogging.c
nsLoggingTable A 5.0 O
nsTransactionTable A 5.0 I agent/nsTransactionTable.c
netSnmpExampleScalars A 5.0 O
netSnmpIETFWGTable A 5.0 D examples/data_set.c
netSnmpHostsTable A 5.0 A examples/=*
nstAgentModules A 5.0 O
------------------------------------------------------------------------------
NET-SNMP-VACM-MIB
nsVacmAccessTable A 5.4 I agent/nsVacmAccessTable.c
------------------------------------------------------------------------------
MTA-MIB
mtaTable U 4.2 O mibII/mta_sendmail.c
mtaGroupTable U 4.2 O mibII/mta_sendmail.c
------------------------------------------------------------------------------
SMUX-MIB
smuxPeerTable ---
smuxTreeTable ---
------------------------------------------------------------------------------
BGP4-MIB (draft-ietf-idr-bgp4-mib)
bgpPeerTable A 3.5 O smux/snmp_bgp.c
------------------------------------------------------------------------------
OSPF-MIB (draft-ietf-ospf-mib-update)
* A 3.5 O smux/snmp_ospf.c
------------------------------------------------------------------------------
RIPv2-MIB
* A 3.5 O smux/snmp_rip2.c
------------------------------------------------------------------------------
TUNNEL-MIB
tunnelIfTable L 4.2 O tunnel/tunnel.c
tunnelConfigTable L 4.2 O tunnel/tunnel.c
tunnelInetConfigTable ---
------------------------------------------------------------------------------
SCTP-MIB
sctpStats L 5.5 S sctp-mib/sctpScalars*
sctpParameters L 5.5 S sctp-mib/sctpScalars*
sctpAssocTable L 5.5 C sctp-mib/=
sctpAssocLocalAddrTable L 5.5 C sctp-mib/=
sctpAssocRemAddrTable L 5.5 C sctp-mib/=
sctpLookupLocalPortTable L 5.5 C sctp-mib/=
sctpLookupRemPortTable L 5.5 C sctp-mib/=
sctpLookupRemHostNameTable L 5.5 C sctp-mib/=
sctpLookupRemPrimIPAddrTable L 5.5 C sctp-mib/=
sctpLookupRemIPAddrTable L 5.5 C sctp-mib/=
==============================================================================
Misc notes
----------
1: available for systems using KAME ipv6
2: with platform SDK. See README.win32
3: works only with Intel and Broadcom network cards and must run as root only
Other feature info
------------------
smux 3.2
AgentX 4.0
proxy support 4.2
override token 5.0
proper context support 5.2
DISMAN-EVENT-MIB implementation rewrite 5.3
AgentX, host, disman/event by default 5.3
date: Thu, 26 Apr 2012 11:30:00 +0000
link: CyberAsylum.eu/sint-snmptranslate-and-snmpwalk
