Page 1 of 2

Config wizard doesn't detect switch ports

Posted: Wed May 24, 2017 7:10 pm
by jericho_g
Hello -

We are running Nagios XI 5.4.4 on RHEL7.3 64-bit virtual machine, manual installation. Running the config wizard does not detect my switchports on my Cisco switch. Running cfgmaker from CLI detects my ports as seen below. Any ideas?

[nagios@ubmnag01 ~]$ /usr/bin/cfgmaker --show-op-down --noreversedns --zero-speed '100000000' --enablesnmpv3 --snmp-options=:::::3 --username='***************' --authprotocol='sha' --authpassword='*******' --privprotocol='aes' --privpassword='*****' --contextengineid=0 '10.11.36.1'
--base: SNMP V3 libraries found, SNMP V3 enabled.
--base: Get Device Info on [email protected]:::::3
--base: Vendor Id: cisco
--base: Populating confcache
--base: Get Interface Info
--base: Walking ifIndex
--snpd: [email protected]:::::3 -> 1 -> ifIndex = 1
--snpd: [email protected]:::::3 -> 2 -> ifIndex = 2
--snpd: [email protected]:::::3 -> 3 -> ifIndex = 3
--snpd: [email protected]:::::3 -> 4 -> ifIndex = 4
--snpd: [email protected]:::::3 -> 5 -> ifIndex = 5
--snpd: [email protected]:::::3 -> 6 -> ifIndex = 6
--snpd: [email protected]:::::3 -> 7 -> ifIndex = 7
--snpd: [email protected]:::::3 -> 8 -> ifIndex = 8
--snpd: [email protected]:::::3 -> 9 -> ifIndex = 9
--snpd: [email protected]:::::3 -> 10 -> ifIndex = 10
--snpd: [email protected]:::::3 -> 11 -> ifIndex = 11
--snpd: [email protected]:::::3 -> 12 -> ifIndex = 12
--snpd: [email protected]:::::3 -> 13 -> ifIndex = 13
--snpd: [email protected]:::::3 -> 14 -> ifIndex = 14
--snpd: [email protected]:::::3 -> 15 -> ifIndex = 15
--snpd: [email protected]:::::3 -> 16 -> ifIndex = 16
--snpd: [email protected]:::::3 -> 17 -> ifIndex = 17
--snpd: [email protected]:::::3 -> 18 -> ifIndex = 18
.
.
.
<output truncated>

Re: Config wizard doesn't detect switch ports

Posted: Thu May 25, 2017 9:30 am
by tgriep
Does the username or password you are using have special characters?
If so, you would have to create user macros and use them in place of the username and password field in the wizard.

To do that, edit this file:

Code: Select all

/usr/local/nagios/etc/resource.cfg
Add your special character username / passwords:

Code: Select all

$USER9$=User*!name
$USER10$=Pass*!Word
Then restart nagios by running the following as root.

Code: Select all

service nagios restart
Then, when you run the Wizard, you would use $USER9$ in place of the username and $USER10$ in place of the password.

Also, make sure you are running the Latest Wizard by going to the Admin > Manage Config Wizards menu in the GUI, click the "Check for Updates" button and update if needed.

Re: Config wizard doesn't detect switch ports

Posted: Thu May 25, 2017 9:48 am
by jericho_g
Hi -

My SNMPv3 username and password do not have special characters. Did you mean the account I use for the web console? I have the latest config wizard installed for network/switch devices.

Thanks
-Jericho

Re: Config wizard doesn't detect switch ports

Posted: Thu May 25, 2017 11:48 am
by tgriep
Can you post a screen shot of the error you are seeing in the GUI when running the wizard?
The account I was talking about is the username and password for your device and not the Nagios server.

Re: Config wizard doesn't detect switch ports

Posted: Thu May 25, 2017 3:47 pm
by jericho_g
My device username and password are not using special characters either. See attached for screenshot.

Re: Config wizard doesn't detect switch ports

Posted: Thu May 25, 2017 4:22 pm
by tgriep
How many ports is on the device you are trying to setup?
If it has a lot of ports, it could be timing out and if you follow the procedure below, that should increase the timeout and other settings and hopefully it will finish.
Edit the /etc/php.ini file and change the following from

Code: Select all

max_execution_time = 30
max_input_time = 60
memory_limit = 128M
to

Code: Select all

max_execution_time = 120
max_input_time = 240
memory_limit = 512M
Then add this to the bottom of that file

Code: Select all

max_input_vars=5000
Save the file

Then edit this file

Code: Select all

/etc/httpd/conf/httpd.conf
Add this line to the bottom

Code: Select all

LimitRequestLine 100000
Save the file and restart Apache by running the command below for the changes to take affect.

Code: Select all

service httpd restart
Try running the wizard again and it it fails, run this as root on the Nagios server

Code: Select all

tail -f /var/log/httpd/*_log
Then run the wizard and post the output of the tail command so we can view the errors if any.

Re: Config wizard doesn't detect switch ports

Posted: Fri Jun 09, 2017 2:09 pm
by jericho_g
We applied the changes but it's still failing to complete from the GUI. From CLI it completes the command in roughly 5 minutes. Should we increase max_execution_time to 300 seconds?
This switch is a Cisco Cat6500 series with lots of interfaces and located in the UK, connected via WAN link.

Re: Config wizard doesn't detect switch ports

Posted: Fri Jun 09, 2017 2:38 pm
by scottwilkerson
jericho_g wrote:We applied the changes but it's still failing to complete from the GUI. From CLI it completes the command in roughly 5 minutes. Should we increase max_execution_time to 300 seconds?
This switch is a Cisco Cat6500 series with lots of interfaces and located in the UK, connected via WAN link.
Yes, you will need to make it something higher than the amount of time it takes from the CLI

Then restart httpd again

Re: Config wizard doesn't detect switch ports

Posted: Mon Jun 12, 2017 10:11 am
by jericho_g
Hi Scott -

We increased the max_execution_time to 330 seconds and restarted httpd, but the wizard still failed to grab the interfaces. It doesn't take long either, maybe a few seconds, and the next page is shown with 'No ports were detected on the switch'. Via command-line still works. Any other suggestions?

-Jericho

Re: Config wizard doesn't detect switch ports

Posted: Mon Jun 12, 2017 10:27 am
by jericho_g
Our sysadmin sees this in the log files:

In the apache error log:

sh: /usr/local/nagiosxi/tmp/mrtg-10.11.36.1: Permission denied
touch: cannot touch '/usr/local/nagiosxi/tmp/mrtg-10.11.36.1.done': Permission denied

In the ssl_error_log

[Mon Jun 12 11:05:02.238023 2017] [:error] [pid 29510] [client 10.150.36.231:62152] PHP Warning: base64_decode() expects parameter 1 to be string, array given in /usr/local/nagiosxi/html/includes/utilsl.inc.php on line 3457, referer: https://nagios-host/nagiosxi/config/mon ... ard.php?&=
[Mon Jun 12 11:05:38.844375 2017] [:error] [pid 18789] [client 10.150.36.231:62179] PHP Warning: fopen(/usr/local/nagiosxi/tmp/mrtg-10.11.36.1): failed to open stream: No such file or directory in /usr/local/nagiosxi/html/includes/configwizards/switch/switch.inc.php on line 1117, referer: https://nagios-host/nagiosxi/config/mon ... ard=switch

And finally in the Nagios log:

[1497280101] SERVICE NOTIFICATION: nagiosadmin;nagios-host;Current Load;CRITICAL;xi_service_notification_handler;CHECK_NRPE: Error - Could not complete SSL handshake.