Requirements
Nagios 3.x
Note that I'm assuming your base directory is "/usr/local/nagios".
The Vautour style
jquery.zip
Installation
Extract "jquery.zip" in the "share/js" folder.
You should now have "jquery.js", "jquery-ui.js", and a "jquery-ui" folder in the "share/js" folder.
Make sure that all files in there are readable and executable.
Note: I made modifications to the jQuery UI files, to make them work with the (slightly rigid) Nagios iframe setup.
This is why I recommend downloading the files from Nagios Exchange, rather than from the creators themselves.
By the way, kudos to the jQuery team and also to the guys at jQuery UI! Without them, this mod wouldn't be here. (:
Now, open "sidebar.html" (in the share folder) for editing.
Replace lines 10 and 11 (the two script references) with this:
Replace lines 15 through 21 (the "search_box" div) with these lines:
Save and close the file.
Now, we set-up the creation of a file named "hosts.txt".
This file contains a list of all your hosts, that will automatically get updated every hour by cron.
We use this list for our autocomplete entries.
Open a Terminal.
Edit your crontab by running:
crontab -e
If applicable, select your editor of choice. I use nano.
Now, add this to the bottom of the cron file (copy/paste is your friend!):
@hourly /bin/cat /usr/local/nagios/var/objects.cache | /bin/grep "host_name" | /bin/sed 's/\s*host_name\s*//g' | /usr/bin/sort | /usr/bin/uniq > /usr/local/nagios/share/hosts.txt
And finally, you should run the following command, to create hosts.txt immediately, without waiting for cron to kick in.
/bin/cat /usr/local/nagios/var/objects.cache | /bin/grep "host_name" | /bin/sed 's/\s*host_name\s*//g' | /usr/bin/sort | /usr/bin/uniq > /usr/local/nagios/share/hosts.txt
You can, if you want, check out /usr/local/nagios/share/hosts.txt, to verify that the list was created successfully.
Testing
You should now have a working autocomplete search box!
Open up your Nagios web page and try it out!