Page 2 of 3

Re: SNMP v3 switch setup

Posted: Thu May 29, 2014 10:19 am
by akepley
I clicked "Write" and waited until the screen went blank (about 1 minute). Then I went back into Write Config Tool and chose "Verify". This is the error:

Code: Select all

Error: There are no services defined!

Nagios Core 4.0.5
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 04-11-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Warning: use_embedded_perl_implicitly is deprecated and will be removed.
Warning: sleep_time is deprecated and will be removed.
Warning: p1_file is deprecated and will be removed.
Warning: external_command_buffer_slots is deprecated and will be removed. All commands are always processed upon arrival
Warning: enable_embedded_perl is deprecated and will be removed.
Warning: command_check_interval is deprecated and will be removed. Commands are always handled on arrival
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Error: There are no services defined!
Checked 0 services.
Checked 179 hosts.
Checked 10 host groups.
Checked 0 service groups.
Checked 14 contacts.
Checked 7 contact groups.
Checked 117 commands.
Checked 22 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 179 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 22 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 1

***> One or more problems was encountered while running the pre-flight check...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed. 
This is weird because there should be a thousand services configured. This has only been a problem since trying to setup a network switch.

Re: SNMP v3 switch setup

Posted: Thu May 29, 2014 10:23 am
by akepley
Sure enough, if I restore a good snapshot and apply configuration, everything goes back to normal and there are all my services in the services directory under /usr/local/nagios/etc/services. But if I try to configure a Network Switch / Router through the wizard, it seems to delete or clear the services directory except for the config for the new switch which is empty.

Re: SNMP v3 switch setup

Posted: Thu May 29, 2014 12:19 pm
by sreinhardt
The screen on write should not end up blank. It sounds like you effectively aborted the write or attempted to verify before it completed. You should see a blue window stating your config files were written correctly when write is done, only then do a verify. Please try again and see if this still occurs.

Re: SNMP v3 switch setup

Posted: Thu May 29, 2014 1:06 pm
by akepley
I didn't abort the write. I click Write, it says "Waiting for nagiosxi" at the bottom of the browser. When it finally finishes, the main frame goes blank while the side "Quick Tools", etc. frame stays up and the options across the top stay up. The main frame is what goes blank, and it doesn't recover from there. It is 'busy' or 'waiting', it just goes blank. See the attached for screenshots.

Re: SNMP v3 switch setup

Posted: Thu May 29, 2014 1:53 pm
by abrist
That potentially looks like a php error. Do a running tail on the apache error log, try to "write" the configs, and then kill the tail with ctrl-c and post the output here:

Code: Select all

tail -f /var/log/http/error_log

Re: SNMP v3 switch setup

Posted: Thu May 29, 2014 2:02 pm
by akepley
You are correct:

Code: Select all

[Thu May 29 13:59:02 2014] [error] [client IP] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /usr/local/nagiosxi/html/includes/components/ccm/classes/config_class.php on line 909, referer: http://nagiosxi.nasba.int/nagiosxi//includes/components/ccm/?cmd=apply
I'm unfamiliar with php settings. Is this something I could extend?

Re: SNMP v3 switch setup

Posted: Thu May 29, 2014 2:20 pm
by sreinhardt
It is! You should find max_execution_time in the /etc/php.ini file. I would suggest updating it to something like 180, as it is referencing seconds, then trying again with the write\verify.

Re: SNMP v3 switch setup

Posted: Thu May 29, 2014 2:30 pm
by akepley
Yes, that worked and the write and verify finished up just fine. I was then able to apply the configuration.

Now the services and everything are working, but I'm getting an error on the output of the Port Status:

(No output on stdout) stderr: Error in packet.
Reason: authorizationError (access denied to that object)
Error in packet
Reason: authorizationError (access denied to that object)
/usr/local/nagios/libexec/check_ifoperstatnag: line 27: [: -eq: unary operator expected
/usr/local/nagios/libexec/check_ifoperstatnag: line 30: [: -eq: unary operator expected

Thanks for the continued help!

Re: SNMP v3 switch setup

Posted: Thu May 29, 2014 3:56 pm
by sreinhardt
We just caught a bug in this plugin, and it is almost definitely what you are seeing. Most likely your snmpwalk is not returning data, and there is an uncaught case for that. It should be updated shortly.

Re: SNMP v3 switch setup

Posted: Fri May 30, 2014 8:06 am
by akepley
Thanks!