Page 1 of 1

Environmentals SNMPv3

Posted: Fri Jan 08, 2021 2:45 am
by coitop
Hello,

I was using below script for polling environmentals from various cisco devices.
https://exchange.nagios.org/directory/P ... on/details

Now all devices have turned to snmpv3 instead of 2 but I cannot make the script work, propably because of the syntax of the command. I have tried everything but I cannot make it work.

Anyone has the same script working with SNMPv3 or knows another script for polling environmental errors?

Thank you

Re: Environmentals SNMPv3

Posted: Fri Jan 08, 2021 3:18 pm
by vtrac
Hi coitop,
I looked and the v04 (check_cisco_envmon.0.4.pl) has added SNMPv3 supports.

May I see the command and errors you were getting?

Regards,
Vinh

Re: Environmentals SNMPv3

Posted: Sat Jan 09, 2021 1:43 pm
by coitop
vtrac wrote:Hi coitop,
I looked and the v04 (check_cisco_envmon.0.4.pl) has added SNMPv3 supports.

May I see the command and errors you were getting?

Regards,
Vinh
Hello Vinh,

This is the output I get. Mind you that the same credentials I use, are working for all the other services I have so that is not the issue.

[nagios@nagios libexec]$ ./check_cisco_envmon.0.4.pl -v3 -H <HOST IP> -C authPriv username=<username> authpassword=<authpass> privpassword=<privpass> authprotocol=SHA privprotocol=AES
UNKNOWN: SNMP error: Received usmStatsUnknownUserNames.0 Report-PDU with value 73
[nagios@nagios libexec]$

Re: Environmentals SNMPv3

Posted: Mon Jan 11, 2021 2:40 pm
by vtrac
Hi coitop,
Looks like your syntax might be wrong.
I looked inside the "check_cisco_envmon.0.4.pl" file and noticed that its used the ":" in the "split" function (below) for your "-C" option:

Code: Select all

elsif ($snmp_version == 3) {
	my ($v3_username,$v3_password,$v3_protocol,$v3_priv_passphrase,$v3_priv_protocol) = split(":",$community);
So, you might want to try the followings:

Code: Select all

From:
./check_cisco_envmon.0.4.pl -v3 -H <HOST IP> -C authPriv username=<username> authpassword=<authpass> privpassword=<privpass> authprotocol=SHA privprotocol=AES

To:

./check_cisco_envmon.0.4.pl -v 3 -H <HOST IP> -C <v3_username>:<v3_password>:<v3_protocol>:<v3_priv_passphrase>:<v3_priv_protocol>
Best Regards,
Vinh

Re: Environmentals SNMPv3

Posted: Tue Jan 12, 2021 4:18 am
by coitop
Thank you very much Vihn! As expected it was the syntax but I couldn't figure it...

Issue solved.

Re: Environmentals SNMPv3

Posted: Tue Jan 12, 2021 9:27 am
by scottwilkerson
coitop wrote:Thank you very much Vihn! As expected it was the syntax but I couldn't figure it...

Issue solved.
Locking thread