" method="POST">
Hostname
(Label)
IP Address
(Resolvable Name)
Notification Interval
(When messages are sent)
Notification Interval
(How often you get messages)
Mins
Notification Options:
(When do you want a Message.)
Down > Unreachable > Recovery >
Services to Check:
(What is to be checked)
SMTP > HTTP > FTP >
POP > NNTP > TELNET >
No Hostname Given
"; $fail=true; } if ( $IPADDRESS == "" ) { echo "No IP Address Given
"; $fail=true; } if ( $NOTIFICATIONS_R == "" and $NOTIFICATIONS_U == "" and $NOTIFICATIONS_D == "" ) { echo "No Notification Options Selected
"; $fail=true; } if ( $SERVICECHECK_SMTP == "" and $SERVICECHECK_HTTP == "" and $SERVICECHECK_FTP == "" and $SERVICECHECK_POP == "" and $SERVICECHECK_NNTP == "" and $SERVICECHECK_TELNET == "") { echo "No Service Checks Selected
"; $fail=true; } htmlhead(); if ( $fail == true) { printform(); } else { echo "

TOC

Contents for Hosts.cfg
Contents for Services.cfg
Other .cfg files
"; echo "

host config

The following should appended to the end of hosts.cfg (located in /etc/nagios or /usr/local/nagios/etc)
"; printhost(); echo "

services config

The following should appended to the end of hosts.cfg (located in /etc/nagios or /usr/local/nagios/etc)
"; if ( $SERVICECHECK_SMTP == "on") { $SERVICE_DESCRIPTION = "SMTP"; $SERVICE_CHECK = "check_smtp"; printservice(); } if ( $SERVICECHECK_HTTP == "on") { $SERVICE_DESCRIPTION = "HTTP"; $SERVICE_CHECK = "check_http"; printservice(); } if ( $SERVICECHECK_FTP == "on") { $SERVICE_DESCRIPTION = "FTP"; $SERVICE_CHECK = "check_ftp"; printservice(); } if ( $SERVICECHECK_POP == "on") { $SERVICE_DESCRIPTION = "POP"; $SERVICE_CHECK = "check_pop"; printservice(); } if ( $SERVICECHECK_NNTP == "on") { $SERVICE_DESCRIPTION = "NNTP"; $SERVICE_CHECK = "check_nntp"; printservice(); } if ( $SERVICECHECK_TELNET == "on") { $SERVICE_DESCRIPTION = "TELNET"; $SERVICE_CHECK = "check_telnet"; printservice(); } echo "

Other Files

You may also need timeperiods.cfg or checkcommands.cfg
"; } htmlfoot(); } function printhost() { global $self,$HOSTNAME,$IPADDRESS,$NOTIFICATION,$NOTIFICATIONINTERVAL,$NOTIFICATIONS_D,$NOTIFICATIONS_U,$NOTIFICATIONS_R,$SERVICECHECK_SMTP,$SERVICECHECK_HTTP,$SERVICECHECK_FTP,$SERVICECHECK_POP,$SERVICECHECK_NNTP,$SERVICECHECK_TELNET; ?>
#  host definition for "; ?>
define host{
use                     generic-host            ; Name of host template to use
host_name               "; ?>
alias                   "; ?>
address                 "; ?>
check_command           check-host-alive
max_check_attempts      10
notification_interval   ";?>
notification_period     ";?>
notification_options    
}	
# Service definition for "; ?>
define service{
use				generic-service		; Name of service template to use
host_name			"; ?>
service_description		"; ?>
is_volatile			0
check_period			24x7
max_check_attempts		3
normal_check_interval		3
retry_check_interval		1
contact_groups			technical,support
notification_interval		";?>
notification_period		";?>
notification_options		w,u,c,r
check_command			"; ?>
}
################################################################################
# TIMEPERIOD DEFINITIONS
#
# SYNTAX:
#
################################################################################

# '24x7' timeperiod definition
define timeperiod{
	timeperiod_name	24x7
	alias		24 Hours A Day, 7 Days A Week
	sunday		00:00-24:00
	monday		00:00-24:00
	tuesday		00:00-24:00
	wednesday	00:00-24:00
	thursday	00:00-24:00
	friday		00:00-24:00
	saturday	00:00-24:00
	}


# 'workhours' timeperiod definition
define timeperiod{
	timeperiod_name	workhours
	alias		"Normal" Working Hours
	monday		09:00-17:00
	tuesday		09:00-17:00
	wednesday	09:00-17:00
	thursday	09:00-17:00
	friday		09:00-17:00
	}


# 'nonworkhours' timeperiod definition
define timeperiod{
	timeperiod_name	nonworkhours
	alias		Non-Work Hours
	sunday		00:00-24:00
	monday		00:00-09:00,17:00-24:00
	tuesday		00:00-09:00,17:00-24:00
	wednesday	00:00-09:00,17:00-24:00
	thursday	00:00-09:00,17:00-24:00
	friday		00:00-09:00,17:00-24:00
	saturday	00:00-24:00
	}


# 'none' timeperiod definition
define timeperiod{
	timeperiod_name	none
	alias		No Time Is A Good Time
	}
	
################################################################################
#
# SAMPLE SERVICE CHECK COMMANDS
#
# These are some example service check commands.  They may or may not work on
# your system, as they must be modified for your plugins.  See the HTML 
# documentation on the plugins for examples of how to configure command definitions.
#
################################################################################


# 'check_tcp' command definition
define command{
	command_name	check_tcp
	command_line	$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
	}


# 'check_udp' command definition
define command{
	command_name	check_udp
	command_line	$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$
	}


# 'check_ftp' command definition
define command{
	command_name	check_ftp
	command_line	$USER1$/check_ftp -H $HOSTADDRESS$
	}


# 'check_pop' command definition
define command{
	command_name	check_pop
	command_line	$USER1$/check_pop -H $HOSTADDRESS$
	}


# 'check_smtp' command definition
define command{
	command_name	check_smtp
	command_line	$USER1$/check_smtp -H $HOSTADDRESS$
	}


# 'check_nntp' command definition
define command{
	command_name	check_nntp
	command_line	$USER1$/check_nntp -H $HOSTADDRESS$
	}


# 'check_http' command definition
define command{
	command_name	check_http
	command_line	$USER1$/check_http -H $HOSTADDRESS$
	}


# 'check_telnet' command definition
define command{
	command_name	check_telnet
	command_line	$USER1$/check_tcp -H $HOSTADDRESS$ -p 23
	}


# 'check_ping' command definition
define command{
	command_name	check_ping
	command_line	$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
	}


# 'check_dns' command definition
define command{
	command_name	check_dns
	command_line	$USER1$/check_dns -H www.yahoo.com -s $HOSTADDRESS$
	}


# 'check_hpjd' command definition
define command{
	command_name	check_hpjd
	command_line	$USER1$/check_hpjd -H $HOSTADDRESS$ -C public
	}


# 'check_local_disk' command definition
define command{
	command_name	check_local_disk
	command_line	$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
	}


# 'check_local_users' command definition
define command{
	command_name	check_local_users
	command_line	$USER1$/check_users -w $ARG1$ -c $ARG2$
	}


# 'check_local_procs' command definition
define command{
	command_name	check_local_procs
	command_line	$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
	}


# 'check_local_load' command definition
define command{
	command_name	check_local_load
	command_line	$USER1$/check_load -w $ARG1$ -c $ARG2$
	}

Welcome to the Nagios cfg file generator

This is a basic form that will generate some sample configs to be used in nagios.