[Fwd: All hosts status undetermined in reports]

Andy Shellam andy.shellam-lists at mailnetwork.co.uk
Fri May 30 00:05:32 CEST 2008


Hi Marc,

I've got a hold of this and a fix now.

In the availability report, if you selected a host or service group,  
it passed the host/group chosen in step 2 over in the URL to step 3  
as, for example, Telecity+Router+1 - which is correct.

However, it then URL encoded the value back to the HTML source of step  
3 - e.g.
<input type='hidden' name='host' value='Telecity+Router+1'>.

However when you submit this form, the browser then converts the +  
characters into %2B's - e.g. Telecity%2BRouter%2B1.  Nagios then  
interpets the host as Telecity+Router+1, which obviously doesn't exist.

It's a simple fix, thankfully!  Unfortunately I don't know how to  
create diff patches, so I can only tell you what to change:

In avail.cgi, line 650:

from:

printf("<input type='hidden' name='host'  
value='%s'>\n",url_encode(host_name));

to:

printf("<input type='hidden' name='host' value='%s'>\n",host_name);

In avail.cgi, line 654:

from:

printf("<input type='hidden' name='servicegroup'  
value='%s'>\n",url_encode(servicegroup_name));

to:

printf("<input type='hidden' name='servicegroup'  
value='%s'>\n",servicegroup_name);

Note that host groups and services didn't suffer this problem - just  
hosts and service groups!

Can this fix make into 3.0.3?

Thanks,

Andy

Quoting Andy Shellam <andy.shellam-lists at mailnetwork.co.uk>:

> Hi Marc,
>
> Quoting Marc Powell <marc at ena.com>:
>
>>
>> On May 29, 2008, at 1:23 PM, Andy Shellam wrote:
>>
>>> About the below e-mail I sent on Tuesday; the reports appears to have
>>> resolved themselves - all host statuses are now appearing as up from
>>> the
>>> 28th May onwards - not quite sure why they're showing as
>>> undetermined on
>>> the 27th because I have the event log covering all of the 27th,
>>> although
>>> there aren't any "CURRENT HOST STATE" lines in the 27th's log file,
>>> but
>>> there is in the 28th.
>>
>> You've just explained it. Nagios couldn't determine the host state
>> from the log files for the date range +backtracked archives that you
>> specified and it won't lie by arbitrarily choosing a state to start.
>> You can either increase the count of backtracked archives to include
>> one that definitively sets the host state, choose the First Assumed
>> State or configure nagios to log_initial_states at each log rotation.
>
> Ah, that last option is probably what I'm looking for - I thought I
> had that enabled, but possibly not.
>
>>
>>> Anyway.  It's still not possible for me to view the status of the
>>> "Telecity Router 1" or "Telehouse Router 1" hosts, with the same "you
>>> are not authorised" message, yet I can read the status perfectly
>>> fine in
>>> the other CGIs for these hosts.
>>
>> I don't have a suggestion here and don't have the time right now to go
>> poking around in the code to see what it's doing differently for a clue.
>
> I'll have a look myself when I get chance although I'm by no means a
> decent C programmer!  I'm guessing it has to do with the spaces in the
> hostname, as I've had issues with that before (previously on this and
> -devel list.)
>
> If I find anything I'll submit a patch to -devel.
>
> Thanks,
>
> Andy
>
> --
> Andy Shellam
> Business Systems Architect
>
> Network Mail
> NetServe Support
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when  
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>

-- 
Andy Shellam
Business Systems Architect

Network Mail
NetServe Support

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list