Page 1 of 2

Switch/Router Wizard not writing out service or mrtg configs

Posted: Thu Aug 09, 2018 3:32 pm
by bawood
I accidentally posted this in the general list earlier, so I'm reposting here.

We are running a fresh manual install (not upgraded from a previous version) of 5.5.2 on Centos 7.5, in a clustered configuration. I'm attempting to use the switch/router wizard to monitor some switches and everything appears to work correctly in the GUI ( I get the list of ports and I'm able to select which ones to monitor and the apply says it was successful), however only the host and ping service get created, not the availability or Bandwidth services, nor the mrtg config file that would normally go in /etc/mrtg/conf.d. Does anyone know what might be wrong or how to debug the wizard process?
Thanks,
Brian

Re: Switch/Router Wizard not writing out service or mrtg con

Posted: Fri Aug 10, 2018 11:25 am
by cdienger
What is meant by "in a clustered configuration." ? Could this be preventing the config from being written to the database or filesystem? Are you able to add these checks if you spin up a new machine that isn't in a cluster configuration?

The source code for the wizard is in Admin > System Extensions > Manage config Wizards > Network Switch / Router if you'd like to know exactly what is occuring to create the checks.

Is there anything in /var/log/httpd/access.log or error.log when you try to add these checks via the wizard? You can increase php logging for debugging by editting /etc/php.ini and setting the error_reporting line:

error_reporting = E_ALL & ~E_DEPRECATED

You may need to restart apache after making this logging change:

service httpd restart

Re: Switch/Router Wizard not writing out service or mrtg con

Posted: Fri Aug 10, 2018 11:52 am
by bawood
We're using drbd/corosync/pacemaker to cluster two servers in a active/passive setup. Other host & service checks we add get written out to the filesystem and seem to be working ok, also it does write a Host-Ping service for the network device, so I don't think it relates to the cluster setup itself.
I see some info logged to the Apache err_log that looks like the snmpwalk output like;
Subroutine SNMP_Session::pack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib/mrtg2/SNMP_Session.pm line 149.
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib/mrtg2/SNMP_Session.pm line 149.
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib/mrtg2/SNMP_Session.pm line 604.
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib/mrtg2/SNMP_Session.pm line 604.
--base: Get Device Info on [email protected]:161::::2
--base: Vendor Id: juniper
--base: Populating confcache
--base: Get Interface Info
--base: Walking ifIndex
.....etc

I'll try adding the php debugging and see if we get any additional information. To me, the especially weird part is that no error is generated in the GUI, it thinks everything worked successfully, but the services and mrtg configs don't actually get written out.

Re: Switch/Router Wizard not writing out service or mrtg con

Posted: Fri Aug 10, 2018 11:55 am
by bawood
Looks like our php.ini already had this set.

Code: Select all

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

Re: Switch/Router Wizard not writing out service or mrtg con

Posted: Fri Aug 10, 2018 5:01 pm
by cdienger
I don't see a reason why it shouldn't be, but is teh wizard up to date and at 2.4.0?

What do the permission look like for /tmp and /etc/mrtg ?

Would you be able to PM me screenshots of the settings as you walk through the wizard? Perhaps there is an odd input we're not account for causing this to fail.

Re: Switch/Router Wizard not writing out service or mrtg con

Posted: Mon Aug 13, 2018 10:10 am
by bawood
Yes, It says it's version 2.4.0. I'll try to create some screen shots from the wizard and share them. Permissions on /etc/mrtg and /tmp
# ls -Lla /etc/mrtg/
total 8
drwxr-xr-x 4 root root 72 Aug 8 13:36 .
drwxr-xr-x 4 root root 32 Aug 8 13:35 ..
drwxrwxr-x 2 apache nagios 6 Jul 26 22:06 archive
drwxrwxr-x 2 apache nagios 31 Aug 8 14:54 conf.d
-rwxrwxr-x 1 apache nagios 788 Jul 26 22:06 mrtg.cfg
-rwxrwxr-x 1 apache nagios 872 Jul 26 22:06 mrtg.cfg.orig

# ls -la /tmp/
total 4
drwxrwxrwt. 9 root root 260 Aug 13 11:09 .
dr-xr-xr-x. 19 root root 287 Jul 20 11:19 ..
-rw-r----- 1 apache apache 40 Aug 13 10:59 bs
drwxrwxrwt. 2 root root 6 May 11 13:46 .font-unix
drwxrwxrwt. 2 root root 6 May 11 13:46 .ICE-unix
drwx------ 3 root root 17 Jul 20 11:18 systemd-private-627b09230c7b41a092b7b3e1fed93abf-chronyd.service-rk7FTy
drwx------ 3 root root 17 Aug 8 16:23 systemd-private-627b09230c7b41a092b7b3e1fed93abf-ndo2db.service-2FKx86
drwxrwxrwt. 2 root root 6 May 11 13:46 .Test-unix
drwxrwxrwt. 2 root root 6 May 11 13:46 .X11-unix
drwxrwxrwt. 2 root root 6 May 11 13:46 .XIM-unix

Re: Switch/Router Wizard not writing out service or mrtg con

Posted: Mon Aug 13, 2018 12:23 pm
by bawood
This is all that gets written to the services file;

Code: Select all

###############################################################################
#
# Services configuration file
#
# Created by: Nagios CCM 2.7.0
# Date:       2018-08-13 13:04:01
# Version:    Nagios Core 4.x
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
    host_name                r-macc-c.umnet.umich.edu
    service_description      Ping
    use                      xiwizard_switch_ping_service
    max_check_attempts       5
    check_interval           5
    retry_interval           1
    check_period             xi_timeperiod_24x7
    notification_interval    60
    notification_period      xi_timeperiod_24x7
    contact_groups           admins
    _xiwizard                switch
    register                 1
}

###############################################################################
#
# Services configuration file
#
# END OF FILE
#
###############################################################################

Re: Switch/Router Wizard not writing out service or mrtg con

Posted: Mon Aug 13, 2018 2:31 pm
by tgriep
If the device that you are running the Wizard against has a log of ports, it could be that the PHP settings need to be increased to allow for that.
Edit the /etc/php.ini file and change these settings to the following

Code: Select all

max_execution_time = 120
max_input_time = 240
memory_limit = 1024M
add this to the bottom of the php.ini file

Code: Select all

max_input_vars=5000
Save the file

Then edit this file
/etc/httpd/conf/httpd.conf
add the following to the bottom of that file

Code: Select all

LimitRequestLine 100000
Save the file and restart Apache for the changes to take affect.
service httpd restart.

Another thing to look at.
When the Wizard runs, it creates a mrtg-xxx.xxx.xxx.xxx config file in the /usr/local/nagiosxi/tmp folder that is uses to create the commands.
The xxx.xxx.xxx.xxx would be the IP address of the device.
Check there to see if it exists and that the apache user and the nagios group has permissions to create the file.

Re: Switch/Router Wizard not writing out service or mrtg con

Posted: Mon Aug 13, 2018 2:58 pm
by bawood
I see the following files here;

Code: Select all

# ls -ltr /usr/local/nagiosxi/tmp/mrtg-198.108.12.61*
-rw-r----- 1 apache nagios 710075 Aug 13 12:55 /usr/local/nagiosxi/tmp/mrtg-198.108.12.61
-rw-r----- 1 apache nagios      0 Aug 13 12:55 /usr/local/nagiosxi/tmp/mrtg-198.108.12.61.done

# grep -c  "### Interface" /usr/local/nagiosxi/tmp/mrtg-198.108.12.61
660
There is a little less than 700 interfaces, which doesn't seem like it should be hitting any of those limits.

Re: Switch/Router Wizard not writing out service or mrtg con

Posted: Mon Aug 13, 2018 2:59 pm
by cdienger
What is the current state of selinux on the system? Run sestatus to check. It should be disabled. Also, do you see anything in /var/log/messages or /var/log/secure when you use the wizard?