SNMP
From Ye Ole Stash
Contents |
General Information
- Below is a setup we use on our network for custom SNMP monitoring for MRTG. You can change and modify to your hearts content, this is just one mans idea for sanity in this insane world.
SNMP config file
- /etc/snmp/snmpd.conf (CentOS, might differ in other distros)
Custom OiDs
OiD Groups
Legacy Exec OiDs
- Filesystem Information (1.3.6.1.4.1.2021.10-19)
- Asterisk
- Network (1.3.6.1.4.1.2021.30-39)
- General System (1.3.6.1.4.1.2021.40-49)
- Firewall (1.3.6.1.4.1.2021.50-59)
- DNS (1.3.6.1.4.1.2021.60-69)
- email (1.3.6.1.4.1.2021.70-79)
- MySQL (1.3.6.1.4.1.2021.80-89)
- Vserver (1.3.6.1.4.1.2021.90-99)
Extend OiDs
- You can use 1.3.6.1.4.1.7594 for all extend or divide them up by .1 .2 and so on like I did with exec above.
- Disk (1.3.6.1.4.1.7594.1-9)
- Disk Inodes (1.3.6.1.4.1.7594.10)
OiD Chart
| OiD | OiD Group | Name | remote script | snmpd.conf entry | Programs needed | Extra Info |
|---|---|---|---|---|---|---|
| 1.3.6.1.4.1.2021.10 | Filesystem Information | XFSSTATS | xfsstat.sh | exec .1.3.6.1.4.1.2021.10 XFSSTATS /usr/bin/xfsstat.sh | ||
| 1.3.6.1.4.1.2021.11 | Filesystem Information | PERL_XFSSTATS | perl_xfsstat.sh | exec .1.3.6.1.4.1.2021.11 PERL_XFSSTATS /usr/bin/perl_xfsstat.sh | xfs_stats.pl | |
| 1.3.6.1.4.1.2021.20 | Asterisk | ASTERISKSTATS/usr/sbin/asteriskstats.sh | asteriskstats.sh | exec .1.3.6.1.4.1.2021.20 ASTERISKSTATS /usr/sbin/asteriskstats.sh | ||
| 1.3.6.1.4.1.2021.30 | Network | QDISCCHECK | checkqdisc | exec .1.3.6.1.4.1.2021.30 QDISCCHECK /usr/sbin/checkqdisc | ||
| 1.3.6.1.4.1.2021.31 | Network | network_pps | packetspersec.sh | exec .1.3.6.1.4.1.2021.31 network_pps /usr/local/sbin/packetspersec.sh | ||
| 1.3.6.1.4.1.2021.40 | General System | SARDISKIO | mrtg_diskio | exec .1.3.6.1.4.1.2021.40 SARDISKIO /usr/bin/mrtg_diskio | ||
| 1.3.6.1.4.1.2021.41 | General System | HUGEMEM | meminfo | |||
| 1.3.6.1.4.1.2021.42 | General System | DISKTRANSFER | disktransfer | exec .1.3.6.1.4.1.2021.42 DISKTRANSFER /usr/sbin/disktransfer | ||
| 1.3.6.1.4.1.2021.43 | General System | DISKIOPS | diskiops | exec .1.3.6.1.4.1.2021.42 DISKIOPS /usr/sbin/diskiops | ||
| 1.3.6.1.4.1.2021.44 | General System | DISKLATENCY | disklatency | exec .1.3.6.1.4.1.2021.42 DISKLATENCY /usr/sbin/disklatency | ||
| 1.3.6.1.4.1.2021.50 | Firewall | connection tracking | conntrack.sh | exec .1.3.6.1.4.1.2021.50 check_ip_conn /usr/local/sbin/conntrack.sh | ||
| 1.3.6.1.4.1.2021.61 | DNS | DJBCACHESTATS | qmailmrtg7 | exec .1.3.6.1.4.1.2021.61 dnscachestats1 /usr/local/bin/qmailmrtg7 Q /service/dnscache/log/main | qmailmrtg | |
| 1.3.6.1.4.1.2021.62 | DNS | DNSSTATS | dnsstats | exec .1.3.6.1.4.1.2021.62 DNSSTATS /usr/bin/stats | ||
| 1.3.6.1.4.1.2021.70 | TCPSERVER_BUSY | tcpbusy | exec .1.3.6.1.4.1.2021.70 TCPSERVER_BUSY /usr/bin/tcpbusy | |||
| 1.3.6.1.4.1.2021.71 | REMOTE_QUEUE | remotequeue | exec .1.3.6.1.4.1.2021.71 REMOTE_QUEUE /usr/bin/remotequeue | qmHandle | ||
| 1.3.6.1.4.1.2021.72 | QMAIL_MRTG | qmailmrtg7-remote | exec .1.3.6.1.4.1.2021.72 QMAIL_MRTG /usr/bin/qmailmrtg7-remote | qmailmrtg | See Below | |
| 1.3.6.1.4.1.7594.1 | disk | DISK_HEALTH | diskinfo.sh | extend .1.3.6.1.4.1.2022.1 DISK_HEALTH /usr/bin/diskinfo.sh | ||
| 1.3.6.1.4.1.7594.3 | WEATHER | WEATHER | weather.sh | extend .1.3.6.1.4.1.2022.1 DISK_HEALTH /usr/bin/diskinfo.sh | ||
| 1.3.6.1.4.1.7594.10 | disk | DISK_INODES | inodecheck.sh | extend . 1.3.6.1.4.1.7594.10 DISK_INODES /usr/bin/inodecheck.sh |
- QMAIL_MRTG - Extra Notes
- Returned Values
- SPAM (/usr/local/bin/qmailmrtg7 S)
- SMTP Totals (/usr/local/bin/qmailmrtg7 a)
- Bits Transfered (/usr/local/bin/qmailmrtg7 b)
- 1.3.6.1.4.1.2021.90 - VM_INFO - /usr/sbin/vminfo