Nagios showcase project !
Williams, P. Lane
Lane.Williams at jhuapl.edu
Thu Sep 25 18:40:55 CEST 2003
Because of the number of host that I have and to save a little time and
effort, I loop through the host file and generate my extended info config
using this little perl script. As far as assigning the images I have to do
that manually. .....Although since I tag my hostgroup names with OS specific
names (i.e. Microsoft-Print-Servers) I could loop through the hostgroup file
and add an 'if' statement that could assign the images based off that.
My main concern was the use of the notes_url portion.
#!/usr/bin/perl
@hosts = `cat /usr/local/nagios/etc/hosts.cfg | grep host_name | awk {'print
\$2'}`;
chomp @hosts;
foreach $host (@hosts){
print "define hostextinfo{\n";
print "\thost_name\t\t$host\n";
print
"\tnotes_url\t\thttp://someserver/scripts/nodes2.pl?QUERY_STRING=$host\n";
print "\ticon_image\t\t\n";
print "\tstatusmap_image\t\t\n";
print "\t}\n\n";}
Lane
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
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