Page 1 of 1

Switches without bandwidth data

Posted: Tue Aug 13, 2013 12:16 pm
by vmesquita
I am trying to figure out why some switches don't show bandwidth data. I have tried running this to colled data:

Code: Select all

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --confcache-file /var/lib/mrtg/mrtg.ok --log-only -debug=snmp -loggin /tmp/mrtg_teste2.log
and then I searched the log file /tmp/mrtg_teste2.log for the IP address of the switch with the issue and found this:

Code: Select all

2013-08-09 14:22:10 -- SNMP Error:
no response received
SNMPv2c_Session (remote host: "172.27.134.1" [172.27.134.1].161)
                   community: "n@g10s"
                  request ID: 1900662350
                 PDU bufsize: 8000 bytes
                     timeout: 2s
                     retries: 5
                     backoff: 1)
 at /usr/bin/../lib/mrtg2/SNMP_util.pm line 490
2013-08-09 14:22:10 -- SNMPGET Problem for ifHCInOctets.1 ifHCOutOctets.1 on n@[email protected]:::::2:v4only
 at /usr/bin/mrtg line 2035
2013-08-09 14:22:10 -- Friday, 9 August 2013 at 14:19: WARNING: skipping because at least the query for ifHCInOctets.1 on  172.27.134.1 did not succeed
2013-08-09 14:22:10 -- Friday, 9 August 2013 at 14:19: WARNING: no data for ifHCInOctets&ifHCOutOctets:n@[email protected]. Skipping further queries for Host 172.27.134.1 in this round.
...
2013-08-09 14:22:29 -- Friday, 9 August 2013 at 14:22: ERROR: Target[172.27.134.1_1][_IN_] ' $target->[1031]{$mode} c' (warn): (Missing operator before c?)
2013-08-09 14:22:29 -- Friday, 9 August 2013 at 14:22: ERROR: Target[172.27.134.1_1][_OUT_] ' $target->[1031]{$mode} c' (warn): (Missing operator before c?)
2013-08-09 14:22:29 -- Friday, 9 August 2013 at 14:22: ERROR: Target[172.27.134.1_100][_IN_] ' $target->[1032]{$mode} c' (warn): (Missing operator before c?)
2013-08-09 14:22:29 -- Friday, 9 August 2013 at 14:22: ERROR: Target[172.27.134.1_100][_OUT_] ' $target->[1032]{$mode} c' (warn): (Missing operator before c?)
2013-08-09 14:22:29 -- Friday, 9 August 2013 at 14:22: ERROR: Target[172.27.134.1_101][_IN_] ' $target->[1033]{$mode} c' (warn): (Missing operator before c?)
2013-08-09 14:22:29 -- Friday, 9 August 2013 at 14:22: ERROR: Target[172.27.134.1_101][_OUT_] ' $target->[1033]{$mode} c' (warn): (Missing operator before c?)
....
2013-08-09 14:22:29 -- Friday, 9 August 2013 at 14:22: ERROR: Target[172.27.134.1_5001][_OUT_] ' $target->[1039]{$mode} c' (warn): (Missing operator before c?)
2013-08-09 14:22:29 -- Friday, 9 August 2013 at 14:22: ERROR: Target[172.27.134.1_5002][_IN_] ' $target->[1040]{$mode} c' (warn): (Missing operator before c?)
2013-08-09 14:22:29 -- Friday, 9 August 2013 at 14:22: ERROR: Target[172.27.134.1_5002][_OUT_] ' $target->[1040]{$mode} c' (warn): (Missing operator before c?)
2013-08-09 14:22:29 -- Friday, 9 August 2013 at 14:22: ERROR: Target[172.27.134.1_5179][_IN_] ' $target->[1041]{$mode} c' (warn): (Missing operator before c?)
2013-08-09 14:22:29 -- Friday, 9 August 2013 at 14:22: ERROR: Target[172.27.134.1_5179][_OUT_] ' $target->[1041]{$mode} c' (warn): (Missing operator before c?)
]

Any idea of what could be going on? I am a little lost on how to keep investigating.

Re: Switches without bandwidth data

Posted: Tue Aug 13, 2013 1:08 pm
by sreinhardt
I am going to guess that the first issue you are running into, is having the snmp community string contain an @, this is likely causing the values after the first @ to be included as a hostname instead of nagios and the ip address. Although at the same time just above that it does seem to happily understand how it works.

Let's verify the port is open first: nmap -p 161 172.27.134.1
If that works, I would suggest changing the community string to have a 4 instead of @ in nagios and see how that works.

Re: Switches without bandwidth data

Posted: Tue Aug 13, 2013 1:28 pm
by vmesquita
Thanks sreinhardt.

How can I change the community name? I can't find any info on this at the NAGIOS XI interface.

The result of NMAP:

Code: Select all

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-08-13 15:27 BRT
Interesting ports on 172.27.134.1:
PORT    STATE  SERVICE
161/tcp closed snmp
It should be open and listening, right?

Re: Switches without bandwidth data

Posted: Tue Aug 13, 2013 1:34 pm
by sreinhardt
You are correct, this should be open and listening. Since that isn't working, lets focus on getting snmp started on those devices, I would suggest looking at your manufacturers documentation on how to implement this. Once that is started, verify with the nmap command again that it is open, neither filtered or closed will work.

Re: Switches without bandwidth data

Posted: Tue Aug 13, 2013 1:59 pm
by vmesquita
I talked to the people responsable for networks here, and they reminded me that SNMPT should use UDP. So we did this:

Code: Select all

nmap -p 161 -sU 172.27.134.1
and got:

Code: Select all

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-08-13 15:57 BRT
Interesting ports on 172.27.134.1:
PORT    STATE         SERVICE
161/udp open|filtered snmp
So I guess the issue might be on the community right? How can I change it? I can't find anything on the Nagios XI interface.

Re: Switches without bandwidth data

Posted: Tue Aug 13, 2013 2:10 pm
by sreinhardt
Ah good catch, not sure how I forget that one! Well first off, the community string would need to be changed on the remote device, then altered in mrtg configs on the nagios side. You should be able to just rerun the switch\router wizard with the new community string and it will use the same services with the new settings. Alternatively, you can directly modify /etc/mrtg/mrtg.cfg for each port with the new string. Either way should be just fine.

Re: Switches without bandwidth data

Posted: Wed Aug 14, 2013 10:11 am
by vmesquita
Partial success! After the change of the community, only this error remains in the log:

Code: Select all

2013-08-14 12:00:50 -- Wednesday, 14 August 2013 at 12:00: ERROR: Target[172.27.134.1_1][_IN_] ' $target->[1031]{$mode} c' (warn): (Missing operator before c?)
2013-08-14 12:00:50 -- Wednesday, 14 August 2013 at 12:00: ERROR: Target[172.27.134.1_1][_OUT_] ' $target->[1031]{$mode} c' (warn): (Missing operator before c?)
2013-08-14 12:00:50 -- Wednesday, 14 August 2013 at 12:00: ERROR: Target[172.27.134.1_100][_IN_] ' $target->[1032]{$mode} c' (warn): (Missing operator before c?)
2013-08-14 12:00:50 -- Wednesday, 14 August 2013 at 12:00: ERROR: Target[172.27.134.1_100][_OUT_] ' $target->[1032]{$mode} c' (warn): (Missing operator before c?)
2013-08-14 12:00:50 -- Wednesday, 14 August 2013 at 12:00: ERROR: Target[172.27.134.1_101][_IN_] ' $target->[1033]{$mode} c' (warn): (Missing operator before c?)
2013-08-14 12:00:50 -- Wednesday, 14 August 2013 at 12:00: ERROR: Target[172.27.134.1_101][_OUT_] ' $target->[1033]{$mode} c' (warn): (Missing operator before c?)
2013-08-14 12:00:50 -- Wednesday, 14 August 2013 at 12:00: ERROR: Target[172.27.134.1_1129][_IN_] ' $target->[1034]{$mode} c' (warn): (Missing operator before c?)
2013-08-14 12:00:50 -- Wednesday, 14 August 2013 at 12:00: ERROR: Target[172.27.134.1_1129][_OUT_] ' $target->[1034]{$mode} c' (warn): (Missing operator before c?)
...
Any idea on how I could fix it?

Re: Switches without bandwidth data

Posted: Wed Aug 14, 2013 11:05 am
by sreinhardt
Honestly, nope, not a clue off hand. Could you post your mrtg.conf, or better yet private message it to me directly. Let's take a look at how its configured and what this -c command might be that's causing the issue.