SNMP client trap configuration - script failure alert
by skagnola from LinuxQuestions.org on (#51491)
Hello!
I am new to using snmp for alerting and need some wise eyes.
The environment is CentOS 7.7 using net-snmp 5.7.2 on the client/agent machine. The snmp 'receiver'(?) is a Solarwinds instance that I am not in control of / don't have access to. The current snmpd.conf is set up as follows and works for these metrics, as expected.
Code:com2sec notConfigUser default Machine_admin
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup "" any noauth exact all none none
view all included .1 80
com2sec notConfigUser default Machine_adminI have snmp set up and running on a CentOS 7 'client', or what I guess is considered as the agent sending the snmp alerts to an snmp server. The question is if it is possible to send info from a failed script, lets say the result of the script goes to Code:RTN=1 instead of Code:RTN=0 if it fails?
I dug around in an snmpwalk to see what things it can poke, but I'm not sure what much of it means, outside the stuff above.
Code:snmpwalk -v2c -c Machine_admin localhost > /tmp/snmp.outAlso browsed this doc, but it was a little confusing :-\ http://www.net-snmp.org/wiki/index.php/TUT:snmptrap
I have also seen some web docs mention trap2sink? Is this for the agent sending the trap info to a receiver and is the syntax different in CentOS/RHEL 7?
Can you send a failed script to an snmp trap destination, and how?


I am new to using snmp for alerting and need some wise eyes.
The environment is CentOS 7.7 using net-snmp 5.7.2 on the client/agent machine. The snmp 'receiver'(?) is a Solarwinds instance that I am not in control of / don't have access to. The current snmpd.conf is set up as follows and works for these metrics, as expected.
Code:com2sec notConfigUser default Machine_admin
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup "" any noauth exact all none none
view all included .1 80
com2sec notConfigUser default Machine_adminI have snmp set up and running on a CentOS 7 'client', or what I guess is considered as the agent sending the snmp alerts to an snmp server. The question is if it is possible to send info from a failed script, lets say the result of the script goes to Code:RTN=1 instead of Code:RTN=0 if it fails?
I dug around in an snmpwalk to see what things it can poke, but I'm not sure what much of it means, outside the stuff above.
Code:snmpwalk -v2c -c Machine_admin localhost > /tmp/snmp.outAlso browsed this doc, but it was a little confusing :-\ http://www.net-snmp.org/wiki/index.php/TUT:snmptrap
I have also seen some web docs mention trap2sink? Is this for the agent sending the trap info to a receiver and is the syntax different in CentOS/RHEL 7?
Can you send a failed script to an snmp trap destination, and how?