Page 1 of 1

Re: [Nagios-devel] navbar search box

Posted: Thu Jun 08, 2006 10:14 am
by Guest


> -----Original Message-----
> From: [email protected] [mailto:nagios-devel-
> [email protected]] On Behalf Of [email protected]
> Sent: Thursday, June 08, 2006 12:56 PM
> To: [email protected]
> Subject: [Nagios-devel] navbar search box
>=20
> Can anyone tell me how to make the navbarsearch box (Show Host on
> side.html) only return EXACT results for either host name or hostgroup
> name?
> For example:
> I have a hostgroup called xyz consisting of the following servers:
> serverxyz01
> serverxyz02
> serverxyz03
> If I type "xyz" into the search box, it returns serverxyz01 instead of
the
> hostgroup xyz.
> I assume it is just doing a "grep" style search and returning the
first
> host it finds.
> I would like it to operate like this:
> search hosts for exact match "xyz"
> if no exact match found in hosts, proceed to hostgroups,
servicegroups,
> etc. for exact name match.

Untested but in status.c, change line 253 from=20

if((strstr(temp_host->name,host_name)=3D=3Dtemp_host->name) ||
!strncasecmp(temp_host->name,host_name,strlen(host_name))){

to=20

if(!strncasecmp(temp_host->name,host_name,strlen(host_name))){

That will eliminate the substring search.

--
Marc





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]