Windows SNMP wizard broken

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Windows SNMP wizard broken

Post by jacek »

Hi,
I'm on the Nagios XI 2024R1.2, Windows SNMP wizard version: 2.0.0, Ubuntu 20.04.6 LTS (up to date).

Getting this error immediately after starting the wizard, doesn't matter if I put a new or existing host:
This server does not respond to SNMP requests (not snmp, or possibly wrong auth).
SNMP from the server works just fine, no issues at all, running snmpwalk towards hosts from the server via ssh also works without issues.

I found interesting errors in the apache log:
==> /var/log/apache2/error.log <==
[Mon Aug 26 10:09:58.705709 2024] [php7:warn] [pid 503763] [client 192.168.11.1:53382] PHP Warning: snmp2_real_walk(): No response from 192.168.11.6 in /usr/local/nagiosxi/html/includes/configwizards/windowssnmp/windowssnmp.inc.php on line 163, referer: https://XXXX/nagiosxi/config/monitoringwizard.php
[Mon Aug 26 10:09:58.734720 2024] [php7:notice] [pid 503763] [client 192.168.11.1:53382] PHP Notice: Undefined variable: selectedhostconfig in /usr/local/nagiosxi/html/includes/configwizards/windowssnmp/steps/step1.php on line 1, referer: https://XXXX/nagiosxi/config/monitoringwizard.php
[Mon Aug 26 10:09:58.734965 2024] [php7:notice] [pid 503763] [client 192.168.11.1:53382] PHP Notice: Undefined variable: cfg in /usr/local/nagiosxi/html/includes/configwizards/windowssnmp/steps/step1.php on line 187, referer: https://XXXX/nagiosxi/config/monitoringwizard.php
[Mon Aug 26 10:09:58.735011 2024] [php7:notice] [pid 503763] [client 192.168.11.1:53382] PHP Notice: Trying to access array offset on value of type null in /usr/local/nagiosxi/html/includes/configwizards/windowssnmp/steps/step1.php on line 187, referer: https://XXXX/nagiosxi/config/monitoringwizard.php
[Mon Aug 26 10:09:58.735165 2024] [php7:warn] [pid 503763] [client 192.168.11.1:53382] PHP Warning: parse_ini_file(/var/xi-sys.cfg): failed to open stream: No such file or directory in /usr/local/nagiosxi/html/includes/configwizards/windowssnmp/steps/step1.php on line 188, referer: https://XXXX/nagiosxi/config/monitoringwizard.php
[Mon Aug 26 10:09:58.735198 2024] [php7:notice] [pid 503763] [client 192.168.11.1:53382] PHP Notice: Trying to access array offset on value of type bool in /usr/local/nagiosxi/html/includes/configwizards/windowssnmp/steps/step1.php on line 192, referer: https://XXXX/nagiosxi/config/monitoringwizard.php
[Mon Aug 26 10:09:58.735276 2024] [php7:notice] [pid 503763] [client 192.168.11.1:53382] PHP Notice: Trying to access array offset on value of type bool in /usr/local/nagiosxi/html/includes/configwizards/windowssnmp/steps/step1.php on line 192, referer: https://XXXX/nagiosxi/config/monitoringwizard.php

==> /var/log/apache2/access.log <==
192.168.11.1 - - [26/Aug/2024:10:09:58 +0000] "POST /nagiosxi/config/monitoringwizard.php HTTP/1.1" 200 13610 "https://XXXX/nagiosxi/config/monitoringwizard.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0"
192.168.11.1 - - [26/Aug/2024:10:09:58 +0000] "GET /nagiosxi/includes/components/usermacros/?mode=query&raw=0 HTTP/1.1" 200 677 "https://XXXX/nagiosxi/config/monitoringwizard.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0"
gwesterman
Posts: 268
Joined: Wed Aug 23, 2023 11:29 am

Re: Windows SNMP wizard broken

Post by gwesterman »

Hi @jacek,

Do you have an xi-sys.cfg file? It should be in your root directory (usr/local/nagiosxi by default) + /var/xi-sys.cfg. If it isn't located there, you will have to move it there (and change permissions to nagios:nagios, 644) or perhaps change where your root directory is. If you don't have an xi-sys.cfg file, let us know.
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Windows SNMP wizard broken

Post by jacek »

Hi,

initially I found xi-sys.cfg in these two locations:
/usr/local/nagiosxi/var/xi-sys.cfg
/usr/local/nagiosxi/etc/xi-sys.cfg
So I copied it to the two missing locations (also made sure the permissions are OK), so now the situation is as follows:
/usr/local/nagiosxi/xi-sys.cfg
/usr/local/nagiosxi/var/xi-sys.cfg
/usr/local/nagiosxi/etc/xi-sys.cfg
/var/xi-sys.cfg
Anyhow, this didn't fix the issue, no changes, only a bit less complaining in the logs:
==> /var/log/apache2/error.log <==
[Tue Aug 27 07:09:05.812900 2024] [php7:warn] [pid 1357] [client 192.168.11.1:63003] PHP Warning: snmp2_real_walk(): No response from 192.168.11.6 in /usr/local/nagiosxi/html/includes/configwizards/windowssnmp/windowssnmp.inc.php on line 163, referer: https://XXXX/nagiosxi/config/monitoringwizard.php
[Tue Aug 27 07:09:05.887043 2024] [php7:notice] [pid 1357] [client 192.168.11.1:63003] PHP Notice: Undefined variable: selectedhostconfig in /usr/local/nagiosxi/html/includes/configwizards/windowssnmp/steps/step1.php on line 1, referer: https://XXXX/nagiosxi/config/monitoringwizard.php
[Tue Aug 27 07:09:05.887550 2024] [php7:notice] [pid 1357] [client 192.168.11.1:63003] PHP Notice: Undefined variable: cfg in /usr/local/nagiosxi/html/includes/configwizards/windowssnmp/steps/step1.php on line 187, referer: https://XXXX/nagiosxi/config/monitoringwizard.php
[Tue Aug 27 07:09:05.887574 2024] [php7:notice] [pid 1357] [client 192.168.11.1:63003] PHP Notice: Trying to access array offset on value of type null in /usr/local/nagiosxi/html/includes/configwizards/windowssnmp/steps/step1.php on line 187, referer: https://XXXX/nagiosxi/config/monitoringwizard.php

==> /var/log/apache2/access.log <==
192.168.11.1 - - [27/Aug/2024:07:09:05 +0000] "POST /nagiosxi/config/monitoringwizard.php HTTP/1.1" 200 13603 "https://XXXX/nagiosxi/config/monitoringwizard.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0"
192.168.11.1 - - [27/Aug/2024:07:09:06 +0000] "GET /nagiosxi/includes/components/usermacros/?mode=query&raw=0 HTTP/1.1" 200 677 "https://XXXX/nagiosxi/config/monitoringwizard.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0"
Where should the xi-sys.cfg be placed by default?
Should I be having this many copies? I assume that there should be one file and symlinks?
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Windows SNMP wizard broken

Post by jacek »

:?:
gwesterman
Posts: 268
Joined: Wed Aug 23, 2023 11:29 am

Re: Windows SNMP wizard broken

Post by gwesterman »

Hi again @jacek,

After digging further into the errors you were seeing, it looks like they are unrelated to your inability to connect (although it certainly is a bug and I have noted it internally). Also your xi-sys.cfg file was in the correct places initially (usr/local/nagiosxi/var and usr/local/nagiosxi/etc) and you can delete the two new files you made.

Anyways, I cannot replicate your error with my own windows snmp v2c server from an XI1.2 on Ubuntu 20. Two things I would suggest trying at this point:
1. Likely unhelpful, but really make sure that the IP address, the snmp version, and the community string are correct.
2. Try to increase the time limit on the call to snmp2_real_walk(). Navigate to "/usr/local/nagiosxi/html/includes/configwizards/windowssnmp/steps/step1.php" and change the variable $test_timeout on line 133 to something extremely large (perhaps 100000).

Let us know if you find anything out.

Thank you!
gwesterman
Posts: 268
Joined: Wed Aug 23, 2023 11:29 am

Re: Windows SNMP wizard broken

Post by gwesterman »

Try also setting both the variable $snmptimeout and $test_timeout to 10000000 in that same file.

It may also be a browser caching issue. Try clearing your cache or trying a different wizard.
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Windows SNMP wizard broken

Post by jacek »

Hi,
I removed the obsolete xi-sys.cfg files.
This is not an timeout issue, I get that error immediately after I hit next on that form, again, when I run snmpwalk from cli from the nagios server it works like a charm.
Also, I can't find $test_timeout in the step1.php file.
gwesterman
Posts: 268
Joined: Wed Aug 23, 2023 11:29 am

Re: Windows SNMP wizard broken

Post by gwesterman »

Sry, $test_timeout is in windowssnmp.inc.php.

Were you able to successfully run other wizards? Did you try clearing your cache?
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Windows SNMP wizard broken

Post by jacek »

Hi,
changing the timeouts helped (I tried various browsers before).
Should I leave that this way? I suppose that these will get overwritten each time the system updates?
gwesterman
Posts: 268
Joined: Wed Aug 23, 2023 11:29 am

Re: Windows SNMP wizard broken

Post by gwesterman »

Glad you were able to get it working!

And yes, when wizards are updated, these changes will be overwritten. However, we are internally tracking this issue so you can keep an eye on our changelog for a fix.

Thank you!
Post Reply