Nagios Perl Script to add Hosts and Escalations

A couple of perl scripts to help add Hosts and Host Escalations into Nagios config files. 

DIRECTIONS: Edit .list file for script to read
FOR: addHost.pl edit host.list to include tab seperated parameter (5)options
use     host_name       alias   address host_groups

FOR: addEscalation.pl edit Escalation.list to include tab seperated parameter (2)options
host_name       contact_groups

Here is addHost.pl script

Here is addHostescalation.pl script

Linux, Network Security, Perl Scripts, Tutorials/Whitepapers

3 comments to Nagios Perl Script to add Hosts and Escalations

  • Todd

    This script was extremely helpful. I did find, however, that there were a few things missing. I wanted to make you aware and have listed only the updated lines below. I used the variable $line.

    while($line = ){
    ($field1, $field2, $field3, $field4, $field5, $field6)=split(“t” , $line);

    Thanks again for making this script available.

    T.

    Reply
  • Todd

    First line should have been…..

    while($line = ){

    my bad.

    Reply
  • triz

    That’s awesome Todd. I put this together real quickly and haven’t looked at it much since. We moved away from Nagios.

    Reply

Leave a Reply

Comment
Name*
Mail*
Website*