Re: SNMP configuration issue from Nagios XI
Posted: Mon Aug 24, 2015 3:33 pm
You're on the right track, Nagios only honers $USER1$ through $USER255$ though.
Support for Nagios products and services
https://support.nagios.com/forum/
IF the snmpwalk fails at the command line then you need to resolve this first before playing with Nagios configs.raamardhani7 wrote:password is having exclamatory mark ! in it and whenever snmpwalk command is coming across ! it is terminating.
snmpwalk -v 3 -u username -l authPriv -a sha -A A*ABC!FM$!Tue&A -x aes -X P*QRS!FM$!Tue&P xx.xx.xx.xx
-bash: !FM$!Tue: event not found.
Code: Select all
snmpwalk -v 3 -u username -l authPriv -a sha -A A*ABC\!FM$\!Tue&A -x aes -X P*QRS\!FM$\!Tue&P xx.xx.xx.xxHi Box,Box293 wrote:IF the snmpwalk fails at the command line then you need to resolve this first before playing with Nagios configs.raamardhani7 wrote:password is having exclamatory mark ! in it and whenever snmpwalk command is coming across ! it is terminating.
snmpwalk -v 3 -u username -l authPriv -a sha -A A*ABC!FM$!Tue&A -x aes -X P*QRS!FM$!Tue&P xx.xx.xx.xx
-bash: !FM$!Tue: event not found.
You *might* be able to escape them with a backslash.
Once you get it working at the command line, proceed to using user macros in resource.cfg. You will need to escape them in the user macros as well.Code: Select all
snmpwalk -v 3 -u username -l authPriv -a sha -A A*ABC\!FM$\!Tue&A -x aes -X P*QRS\!FM$\!Tue&P xx.xx.xx.xx
Code: Select all
snmpwalk -v 3 -u username -l authPriv -a sha -A A*ABC\!FM$\!Tue\&A -x aes -X P*QRS\!FM$\!Tue\&P xx.xx.xx.xxThe $USERxx$ macros do not work at the command line, they only work when Nagios Core evaluates them. Make sure it works at the command line before proceeding to Nagios, if it doesn't work at the command line it's not going to work in Nagios.raamardhani7 wrote:ave made necessary changes updated in the resource.cfg and ram the command.
[root@lussvpnagiosxi00 etc]# snmpwalk -v 3 -u username -l authPriv -a sha -A USER33 -x aes -X USER44 xx.xx.xx.xx
No log handling enabled - turning on stderr logging
Error: passphrase chosen is below the length requirements of the USM (min=8).
snmpwalk: (The supplied password length is too short.)
Error generating a key (Ku) from the supplied authentication pass phrase.
[root@lussvpnagiosxi00 etc]# snmpwalk -v 3 -u username -l authPriv -a sha -A $USER33$ -x aes -X $USER44$ xx.xx.xx.xx
No log handling enabled - turning on stderr logging
Error: passphrase chosen is below the length requirements of the USM (min=8).
snmpwalk: (The supplied password length is too short.)
Error generating a key (Ku) from the supplied authentication pass phrase.
Could you please advise here. thanks.
Hi Box293,Box293 wrote:So now it's getting past the ! but I think it's getting stuck on the &. Try escaping it as well:
Code: Select all
snmpwalk -v 3 -u username -l authPriv -a sha -A A*ABC\!FM$\!Tue\&A -x aes -X P*QRS\!FM$\!Tue\&P xx.xx.xx.xxThe $USERxx$ macros do not work at the command line, they only work when Nagios Core evaluates them. Make sure it works at the command line before proceeding to Nagios, if it doesn't work at the command line it's not going to work in Nagios.raamardhani7 wrote:ave made necessary changes updated in the resource.cfg and ram the command.
[root@lussvpnagiosxi00 etc]# snmpwalk -v 3 -u username -l authPriv -a sha -A USER33 -x aes -X USER44 xx.xx.xx.xx
No log handling enabled - turning on stderr logging
Error: passphrase chosen is below the length requirements of the USM (min=8).
snmpwalk: (The supplied password length is too short.)
Error generating a key (Ku) from the supplied authentication pass phrase.
[root@lussvpnagiosxi00 etc]# snmpwalk -v 3 -u username -l authPriv -a sha -A $USER33$ -x aes -X $USER44$ xx.xx.xx.xx
No log handling enabled - turning on stderr logging
Error: passphrase chosen is below the length requirements of the USM (min=8).
snmpwalk: (The supplied password length is too short.)
Error generating a key (Ku) from the supplied authentication pass phrase.
Could you please advise here. thanks.
Code: Select all
./check_snmp -H xx.xx.xx.xx -o ".1.3.6.1.4.1.12356.101.1.1403" -P 3 -U username -L authPriv -a sha -A A*ABC\!FM$\!Tue\&A -x aes -X P*QRS\!FM$\!Tue\&PThanks a lot Tgriep,tgriep wrote:The authlevel command is a capital L. Try running the command below and see if it works for you.Code: Select all
./check_snmp -H xx.xx.xx.xx -o ".1.3.6.1.4.1.12356.101.1.1403" -P 3 -U username -L authPriv -a sha -A A*ABC\!FM$\!Tue\&A -x aes -X P*QRS\!FM$\!Tue\&P
Code: Select all
SNMP OK - Such Object available on this agent at this OID |Code: Select all
-x aes -X P*QRS\!FM$\!Tue\&PCode: Select all
/usr/local/nagios/etc/resource.cfgCode: Select all
$USER9$=A*ABC!FM$!Tue&A
$USER10$=P*QRS!FM$!Tue&PCode: Select all
service nagios restartCode: Select all
check_snmpCode: Select all
-o '.1.3.6.1.4.1.12356.101.1.1403' -P 3 -U username -L authPriv -a sha -A '$USER9$' -x aes -X '$USER10$'Hi Ssax,ssax wrote:Here is how you set it up so it will work.
Edit this file:
Add your special character passwords:Code: Select all
/usr/local/nagios/etc/resource.cfg
Restart nagios:Code: Select all
$USER9$=A*ABC!FM$!Tue&A $USER10$=P*QRS!FM$!Tue&P
Setup your service like this:Code: Select all
service nagios restart
Check command:$ARG1$:Code: Select all
check_snmpIt won't work when you click test but it should work when the service check runs.Code: Select all
-o '.1.3.6.1.4.1.12356.101.1.1403' -P 3 -U username -L authPriv -a sha -A '$USER9$' -x aes -X '$USER10$'