?Changing NET-SNMP's default operating system name for debian

?Changing NET-SNMP's default operating system name for debian

The default behavior of NET-SNMP is to have a bland reporting of the linux operating system as NET-SNMP. This is how to fix it.

Firstly, modify the /etc/snmp/snmpd.conf file:

agentAddress udp:161,udp6:[::1]:161

rocommunity pxblxc 102.132.102.132/29

sysLocation    GP;Fourways;34Dias;Upstairs
sysContact     [email protected]

sysServices    72

extend osname /usr/local/sbin/osname.sh

Next create the following script osname.sh in /usr/local/sbin:

#!/bin/bash
lsb_release -d | awk '{ print $2, $4, $5, $6}'

Make certain you have awk install via $ sudo apt-get install gawk.

Make the script executable using $ sudo chmod +x osname.sh

Test it by excecuting ./osname.sh which should result in something similar to: Debian 8.11 (jessie)

Now restart the snmp daemon using $ sudo service snmpd restart

In the SNMP poller use the oid .1.3.6.1.4.1.8072.1.3.2.4.1.2.6.111.115.110.97.109.101.1 as the device type.

要查看或添加评论,请登录

Ronald Bartels的更多文章

社区洞察

其他会员也浏览了