net-snmp can call external script extensions, such as: vi /etc/snmp/snmpd.conf
exec .1.3.6.1.4.1.2021.18 tcpCurrEstab /etc /snmp/tcpconn.shexec .1.3.6.1.4.1.2021.19 tcpCurrHttp /etc/snmp/tcphttp.shexec .1.3.6.1.4.1.2021.20 tcpCurrPhp-fpm /etc/snmp/tcpphp.shexec .1.3.6.1.4.1.2021.21 tcpCurrMemcache /etc/snmp/tcpmemcache.sh above is the old version of the configuration, has been deprecated, the new version uses:
extend .1.3.6.1.4.1.2021.18 tcpCurrEstab /etc/snmp/tcpconn.shextend .1.3 .6.1.4.1.2021.19 tcpCurrHttp /etc/snmp/tcphttp.shextend .1.3.6.1.4.1.2021.20 tcpCurrPhp-fpm /etc/snmp/tcpphp.shextend .1.3.6.1.4.1.2021.21 tcpCurrMemcache /etc/snmp/tcpmemcache. Shsnmpd wants to allow a segment access, configured as:
com2sec notConfigUser 192.168.1.0/24 public[root@ha1 log]# cat /etc/snmp/tcpconn.sh
#!/bin /shconn=`netstat -s -t |
Grep connections\\ established |
Awk '{print $1}'`echo $conn[root@ha1 log]# cat /etc/snmp/tcphttp.sh
#!/bin/shnetstat -an |
Grep ':80 ' |
Grep ESTABLISHED |
Wc -l[root@ha1 log]# cat /etc/snmp/tcpmemcache.sh
#!/bin/shnetstat -an |
Grep :11211 |
Grep ESTABLISHED |
Wc -l[root@ha1 log]# cat /etc/snmp/tcpphp.sh
#!/bin/shnetstat -an |
Grep :9000 |
Grep ESTABLISHED |
Wc -l restart net-snmpd:
service snmpd restart test: [root@ha1 log]# snmpwalk -v 2c -c public 192.168.1.4 .1.3.6.1.4.1.2021.18
UCD-SNMP-MIB::ucdavis.18.1.1 = INTEGER: 1UCD-SNMP-MIB::ucdavis.18.2.1 = STRING: "tcpCurrEstab"UCD-SNMP-MIB::ucdavis.18.3.1 = STRING: " ;/etc/snmp/tcpconn.sh"UCD-SNMP-MIB::ucdavis.18.100.1 = INTEGER: 0UCD-SNMP-MIB::ucdavis.18.101.1 = STRING: "5023"UCD-SNMP-MIB: :ucdavis.18.102.1 = INTEGER: 0UCD-SNMP-MIB::ucdavis.18.103.1 = ""There is an information output indicating success. The default net-snmpd output logs to /var/log/messes and want to output to a separate log file, configured as: vi /etc/sysconfig/snmpd.options
# snmpd command line options# OPTIONS=" -Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"OPTIONS="-Lf /var/log/snmpd.log"Restart net-snmpd:
service snmpd restartcat /var/log/snmpd.log
under Windows we have the power management system is very familiar with, we can achieve STR, STD and
If you want to try a desktop system other than Mac and Windows, Linux should definitely be your fir
HAProxy provides high availability, load balancing, and proxy for TCP and HTTP applications, support
Format: printf("\\033[word background color; font color m string \\033[0m" ); printf("
Linux modification file creation time
Linux kernel compiler often solves the problem
Teach you to make a USB boot disk for the Linux operating system
Linux NFS slow startup problem Boot acceleration Redhat change computer name Embedded linu
The linux shell implements multiple methods of random numbers (date, random, uuid)
64-bit Ubuntu can not install 32-bit compatible library solution
10 important Linux ps commands are actually
Linux command introduction: VI command application highlights
Share the magic trick of open computer management under win7
Windows 8.1 new version 9369 has been leaked in private sites
Win7 system prompts that the memory can not be solved for Read?
Win8 third-party browser to Metro IE can not open the default
How to cancel the quick access function in the win10 system
Windows 7 operating system how to format C drive
Various problem solving techniques that occur during the installation of Win8.1
Restore the error FlashGet right-click menu
How to solve the problem of Win7 broadband router DNS being tampered with?