Page 2 of 2

Re: Bandwidth charts show 0/0 for us as well

Posted: Thu Feb 14, 2019 7:43 pm
by ganderson
I ran a full yum update and rebooted, so now we get better values:

Code: Select all

[root@nagiosxi ~]# cpan -l | grep -i snmp
SNMP    5.05
NetSNMP::default_store  5.05
NetSNMP::OID    5.05
NetSNMP::TrapReceiver   5.05
NetSNMP::agent  5.05
NetSNMP::ASN    5.05
NetSNMP::agent::default_store   5.05
NetSNMP::agent::Support 5.05
NetSNMP::agent::netsnmp_request_infoPtr undef
vendor_perl::SNMP       5.05
vendor_perl::NetSNMP::default_store     5.05
vendor_perl::NetSNMP::OID       5.05
vendor_perl::NetSNMP::TrapReceiver      5.05
vendor_perl::NetSNMP::agent     5.05
vendor_perl::NetSNMP::ASN       5.05
vendor_perl::NetSNMP::agent::default_store      5.05
vendor_perl::NetSNMP::agent::Support    5.05
vendor_perl::NetSNMP::agent::netsnmp_request_infoPtr    undef
SNMP_Session    1.12
SNMP_util       1.12
Net::SNMP
Net::SNMP::Transport
Net::SNMP::PDU
Net::SNMP::Security
Net::SNMP::Dispatcher
Net::SNMP::Message
Net::SNMP::MessageProcessing
Net::SNMP::Transport::TCP
Net::SNMP::Transport::UDP6
Net::SNMP::Transport::UDP
Net::SNMP::Transport::TCP6
Net::SNMP::Security::USM
Net::SNMP::Security::Community
PuTTYUseless use of a constant in void context at (eval 882) line 7, <FILE> line 75.
Useless use of a variable in void context at (eval 882) line 7, <FILE> line 75.
Use of uninitialized value $Tk::Pod::VERSION in numeric ge (>=) at (eval 882) line 7, <FILE> line 75.

[root@nagiosxi ~]# cpan --help
Loading internal logger. Log::Log4perl recommended for better logging
/usr/local/bin/cpan version 1.64 calling Getopt::Std::getopts (version 1.06 [paranoid]),
running under Perl version 5.10.1.

Usage: cpan [-OPTIONS [-MORE_OPTIONS]] [--] [PROGRAM_ARG1 ...]

The following single-character options are accepted:
        With arguments: -M -j
        Boolean (without arguments): -h -v -V -I -g -G -C -A -D -O -l -L -a -r -p -P -J -w -x -X -T -c -f -i -m -s -t -u

Options may be merged together.  -- stops processing of options.
Space is not required between options and their arguments.

For more details run
        perldoc -F /usr/local/bin/cpan
  [Now continuing due to backward compatibility and excessive paranoia.
   See ``perldoc Getopt::Std'' about $Getopt::Std::STANDARD_HELP_VERSION.]
Nothing to install!
[root@nagiosxi ~]#

Unfortunately, there still a 10 second delay when running with the --user=nagios arguement with no resultant data

Re: Bandwidth charts show 0/0 for us as well

Posted: Thu Feb 14, 2019 8:00 pm
by ganderson
And for some additional information - monitoring packets sent, when running MRTG as root without the --user arguement, I get a total of 6 SNMP packets in 3 send and receive pairs (in an instantaneous burst).

When I add the --user=nagios arguement, the behaviour changes. I can see initially a single send and receive pair, then a pause, and another send and receive pair exactly 5 seconds after the first. After another 5 second delay, the applications errors out, implying the host did not respond, but we can see that it did, and that the packet is being returned to the nagios server. But it is like MRTG is not getting the response for some reason, again, only when using --user=nagios

Re: Bandwidth charts show 0/0 for us as well

Posted: Fri Feb 15, 2019 1:06 pm
by tgriep
I think when the MRTG application is running as the nagios user, it cannot decode the SNMPv3 data so it retry's until it fails.
Change the config file to use SNMPv2 and it all works.

What OS and Release is the Nagios server running?

Re: Bandwidth charts show 0/0 for us as well

Posted: Sun Feb 17, 2019 7:08 pm
by ganderson
Except that if I su to nagios user and run MRTG without the arguments, I don't get any issues - it works just as well as running it as root.

It is only a problem when run as root, but with the MRTG arguments for --user=nagios (does that make sense?)

IE

root@nagiosxi: time LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg (0.712s, data OK)
root@nagiosxi: time LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --user=nagios --group=nagios (10.451s, SNMPv3 Data Fails)
nagios@nagiosxi: time LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg (0.471s, data OK)


Nagios is 5.5.9

uname version is "Linux 2.6.32-754.10.1.el6.x86_64 #1 SMP Tue Jan 15 17:07:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux"

Was deployed as the Nagios VMware appliance running Centos 6
Currently Centos release 6.10 (Final)
No packages marked for Update

Re: Bandwidth charts show 0/0 for us as well

Posted: Mon Feb 18, 2019 1:07 am
by ganderson
I just ran an upgrade to Nagios 5.5.10 but there is no change to behaviour.

Re: Bandwidth charts show 0/0 for us as well

Posted: Mon Feb 18, 2019 9:54 am
by tgriep
I did not mean that is fails while logged in as the nagios user, I meant that is failed when mrtg ran with the --user option set to nagios.
I have tried every combination that I could do and I could not get it to work using SNMPv3 for authentication.
I think that the Perl modules that encrypt the data, does not work on Centos6.
Good news is that it does work using Centos7.

Re: Bandwidth charts show 0/0 for us as well

Posted: Mon Feb 25, 2019 1:08 am
by ganderson
I ended up downloading the latest appliance based on CentOS 7, and confirmed that this worked as expected. Pretty strange.

So I have now migrated via backup and restore, and after fixing a plugin and reconfiguring postfix to deliver email correctly, I just have a dashboards issue left to go. I will probably have to raise a new ticket for that: I cannot edit or add dashboards anymore. The browser tab stops responding.

So coming to the end here, these commands:

Code: Select all

cd /var/lib/mrtg
chown apache:nagios *
chmod 0644 *

break MRTG. They are on this page:

https://support.nagios.com/kb/article.php?id=29

We need to fix that for both RHEL and Ubuntu.

Re: Bandwidth charts show 0/0 for us as well

Posted: Mon Feb 25, 2019 9:13 am
by tgriep
Thanks for letting us know about the permission example on the KB article not working.
It is updated with permissions that should work.

Re: Bandwidth charts show 0/0 for us as well

Posted: Mon Feb 25, 2019 6:59 pm
by ganderson
Great stuff. Thanks for the help on this, feel free to close this as I now have a new thread open for the dashboards issue.