Page 1 of 3

2012R1.0 needs fix for "Undefined index: uid"

Posted: Thu Oct 25, 2012 7:20 pm
by nagiosadmin42
2012R1.0 included a fix for post http://support.nagios.com/forum/viewtop ... 58&p=32620 where the http error log had a lot of entries with "Undefined index: user_id".

Thank you!

I'm seeing a similar issue with 2012R1.0, now the message is:

Code: Select all

PHP Notice:  Undefined index: uid in /usr/local/nagiosxi/html/includes/dbauth.inc.php on line 346
dbauth.inc.php is a file protected by SourceGuardian, so we can't modify it. It would be nice to have it cleaned up as well. Thanks!

Re: 2012R1.0 needs fix for "Undefined index: uid"

Posted: Fri Oct 26, 2012 7:09 am
by scottwilkerson
I have added a fix for this, not sure if it will make it in to 2012R1.1 but will be in 2012R1.2 for sure

Re: 2012R1.0 needs fix for "Undefined index: uid"

Posted: Wed Dec 12, 2012 12:29 pm
by paul.jobb
My release is at version 2012R1.3 and my log seems to be full of these:

[Wed Dec 12 10:13:01 2012] [error] [client 172.22.216.195] PHP Notice: Undefined index: uid in /usr/local/nagiosxi/html/includes/dbauth.inc.php on line 347

I did an upgrade from 2012R1.1 directly to 2012R1.3 if that matters. I am trying to troubleshoot why the apply config takes so long to run.

Re: 2012R1.0 needs fix for "Undefined index: uid"

Posted: Wed Dec 12, 2012 1:01 pm
by scottwilkerson
<facepalm/>

I typoed this in the fix (it actually is in an if statement that is for future use, doesn't do anything)

So this will have no bearing on a configuration taking a long time to apply.

If you go to CCM -> Tools -> Write Config Files

If you click "Verify Config" do you have many warnings?

How long does it take to apply? How many hosts/services? Are you seeing a lot of IO Wait time on the server?

Re: 2012R1.0 needs fix for "Undefined index: uid"

Posted: Wed Dec 12, 2012 2:08 pm
by paul.jobb
We had a consultant in last week to work on system performance, listed is apply times we were seeing. The mysql database has been offloaded to its own vm, about half of our service checks run at 5 min intervals with the rest running every 15 - 60 minutes. Attached the system and monitoring status screen shots. My coworker here Jason may have spoken to you about this last week as well.
system_status.PNG
monitoring_engine_perf.PNG
applyconfig timings:

failure - 7m 41s
baseline - 7m 28 s
after db repair - 7m 33s
lowered php.ini 512mb ->256Mb - 7m 34s
after vmware tools install - 7m 9s
with nagios shutdown - 5m 43
after ramdisk changes - 6m 48s (both status.dat and perfdata spool writing to ramdisks)
after sysctl tuning and upgrade - 8m 47s (upgrade to version 1.3, increased values for sysctl)
after 4 vCPU -> 2 vCPU - 7m 29s - moved server back to 2 vcpu's, VM cpu scheduling in our environment has a hugely negative impact on nagios i.e. high latency



Outside of the four duplicate definitions the rest of the warnings are for no check time period.

Warning: Duplicate definition found for service 'CPU Usage' on host 'VNN1170' (config file '/usr/local/nagios/etc/services/windows-servers-ds.cfg', starting on line 65)
Warning: Duplicate definition found for service 'Memory Usage' on host 'VNN1170' (config file '/usr/local/nagios/etc/services/windows-servers-ds.cfg', starting on line 114)
Warning: Duplicate definition found for service 'Page File Usage' on host 'VNN1170' (config file '/usr/local/nagios/etc/services/windows-servers-ds.cfg', starting on line 128)
Warning: Duplicate definition found for service 'System Uptime' on host 'VNN1170' (config file '/usr/local/nagios/etc/services/windows-servers-ds.cfg', starting on line 144)
......
Warning: Service 'Memory Usage' on host 'vnn995' has no check time period defined!
Warning: Service 'Page File Usage' on host 'vnn995' has no check time period defined!
Warning: Service 'System Uptime' on host 'vnn995' has no check time period defined!
Checked 13021 services.
Checking hosts...
Checked 1694 hosts.
Checking host groups...
Checked 36 host groups.
Checking service groups...
Checked 2 service groups.
Checking contacts...
Checked 54 contacts.
Checking contact groups...
Checked 7 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 128 commands.
Checking time periods...
Checked 44 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 7385
Total Errors: 0

Re: 2012R1.0 needs fix for "Undefined index: uid"

Posted: Thu Dec 13, 2012 10:49 am
by scottwilkerson
These aren't totally unheard of times considering the size of your deployment.

Can I have you time individually the write and verify from
CCM -> Tools -> Write Config Files

Re: 2012R1.0 needs fix for "Undefined index: uid"

Posted: Thu Dec 13, 2012 3:22 pm
by paul.jobb
oddly enough the write config only took 44 seconds to complete and didn't indicate any errors but the verify config errored out after that claiming it was missing a host entry. I ran /usr/local/nagiosxi/scripts/reconfigure_nagios.sh and that ran in about 7 minutes 48 seconds, I did a verify after and it worked, the verify runs in seconds(i.e. less than 10). The nagios engine appears to take 4 minutes and 40 seconds to fully restart.

Re: 2012R1.0 needs fix for "Undefined index: uid"

Posted: Thu Dec 13, 2012 3:32 pm
by mguthrie
Can you post the output from:

Code: Select all

ll /usr/local/nagios/var

Re: 2012R1.0 needs fix for "Undefined index: uid"

Posted: Thu Dec 13, 2012 3:57 pm
by paul.jobb
attached is a zip file of that folder, strangely enough nagios loaded a large number of hosts I previuosly deleted. I checked the number of records on the nagiosql db and its 1665 but I have 2781 hosts displaying, I don't know how to explain that somewhat out of the blue. I could only update the nagios log file, size restrictions

Re: 2012R1.0 needs fix for "Undefined index: uid"

Posted: Fri Dec 14, 2012 3:51 pm
by scottwilkerson
This is super strange.

Can you post you latest configuration snapshot