qpage and nagios
William R. Nash
william at wrnash.net
Fri Dec 6 02:42:01 CET 2002
Hello,
I'm having a little problem now with qpage and nagios. Problem i can send a
page from the command line to my pager using qpage. When nagios tried to
send a page i get Connection refused by host. I have added my config files
from my test machine.
Thanks Bill Nash
medic5591 at msn.com for chat
-------------- next part --------------
#
# The qpage configuration file is made up of keyword=value pairs:
#
# administrator=<administrator's e-mail address>
#
# forcehostname=<"yes", "no", or @mailhost>
#
# queuedir=<queue directory>
#
# lockdir=<lock directory>
#
# identtimeout=<seconds to wait before giving up on ident query>
#
# snpptimeout=<seconds to wait before giving up on SNPP commands>
#
# include=<filename containing more configuration keywords>
#
# pidfile=<filename to write the server's process ID>
#
# synchronous=<"yes" or "no" to start queue runs immediately>
#
# modem=<modem name>
# text=<optional text, no whitespace allowed>
# device=<modem device e.g. /dev/ttya>
# initcmd=<modem initialization command>
# dialcmd=<modem dial command not including phone number>
#
# service=<service name>
# text=<optional text, no whitespace allowed>
# device=<name of modem as specified above>
# phone=<phone number of paging service>
# password=<password for logging into paging terminal>
# baudrate=<speed to use while talking to modem>
# parity=<"even", "odd", or "none">
# maxmsgsize=<biggest message the paging service will accept>
# maxpages=<how many pages to send before truncating message>
# maxtries=<number of tries before page fails
# identfrom=<"yes" or "no" to use rfc1413 as default CALLerid>
# allowpid=<"yes" or "no" to require pager entry in qpage.cf>
# msgprefix=<"yes" or "no" to include sender's name in message>
#
# pager=<pager name>
# text=<optional text, no whitespace allowed>
# pagerid=<numerical pager ID>
# service=<name of paging service as specified above>
#
# group=<group name>
# text=<optional text, no whitespace allowed>
# member=<pagerid>[/schedule]
#
# Keyword values may not contain whitespace. Major keywords (administrator,
# modem, pager, etc.) must start at the left column. Minor keywords (text,
# device, etc.) must not start at the left column (i.e. they must be
# preceeded by whitespace). Minor keywords may start on the same line
# as their corresponding major keyword as long as there is at least one
# space between the major keyword value and the minor keyword name.
#
# "true" or "false" may be specified instead of "yes" or "no"
#
# All text following a pound sign (#) is ignored.
#
administrator=william at wrnash.net
queuedir=/var/spool/qpage
identtimeout=5
snpptimeout=60
modem=ttya device=/dev/modem
modem=ttyb device=/dev/ttyS0
service=default
device=ttya,ttyb
baudrate=1200
parity=even
allowpid=yes
maxtries=6
phone=404-873-6337
service=supercom
phone=482-9768
service=range
phone=4048736337
maxmsgsize=120
maxpages=6
#
# start of pager list
#
pager=william
text=William
pagerid=7702233344
service=range
#pager=tony
# pagerid=711
# service=supercom
#group=sysadmin
# text=System_Administrator
# member=tomiii/Any0000-0800
# member=tomiii/Any1700-2359
# member=tony/Any0800-1700
-------------- next part --------------
################################################################################
# Sample object config file for Nagios 1.0
#
# Read the documentation for more information on this configuration file. I've
# provided some comments here, but things may not be so clear without further
# explanation, so make sure to read the HTML documentation!
#
# Last Modified: 03-07-2002
#
################################################################################
################################################################################
# CONTACT DEFINITIONS
#
# SYNTAX:
#
################################################################################
# 'nagios' contact definition
define contact{
contact_name nagios
alias Nagios Admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-qpager
host_notification_commands host-notify-by-qpager
pager william
}
-------------- next part --------------
################################################################################
# Sample object config file for Nagios 1.0
#
# Read the documentation for more information on this configuration file. I've
# provided some comments here, but things may not be so clear without further
# explanation, so make sure to read the HTML documentation!
#
# Last Modified: 05-27-2002
#
################################################################################
################################################################################
# COMMAND DEFINITIONS
#
# SYNTAX:
#
# define command{
# template <templatename>
# name <objectname>
# command_name <commandname>
# command_line <commandline>
# }
#
# WHERE:
#
# <templatename> = object name of another command definition that should be
# used as a template for this definition (optional)
# <objectname> = object name of command definition, referenced by other
# command definitions that use it as a template (optional)
# <commandname> = name of the command, as recognized/used by Nagios
# <commandline> = command line
#
################################################################################
################################################################################
#
# SAMPLE NOTIFICATION COMMANDS
#
# These are some example notification commands. They may or may not work on
# your system without modification.
#
################################################################################
# 'notify-by-email' command definition
define command{
command_name notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios 1.0 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional Info:\n\n$OUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
# 'notify-by-epager' command definition
define command{
command_name notify-by-epager
command_line /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
}
# 'host-notify-by-email' command definition
define command{
command_name host-notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios 1.0 *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n" | /bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
}
# 'host-notify-by-epager' command definition
define command{
command_name host-notify-by-epager
command_line /usr/bin/printf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $OUTPUT$\nTime: $DATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$
}
# notify-by-qpage command definition
define command{
command_name notify-by-qpager
command_line /usr/bin/printf "Service: %s\nHost: %s\nAddress: %s\nState: %s\nInfo: %s\nDate: %s" '$SERVICEDESC$' '$HOSTNAME$' '$HOSTADDRESS$' '$SERVICESTATES$' '$OUTPUT$' '$DATETIME$' | /usr/local/bin/qpage -l 0 -p $CONTACTPAGER$
}
# host-notify-by-qpage command definition
define command{
command_name host-notify-by-qpager
command_line /usr/bin/printf "Host '%s' is %s\nInfo: %s\nTime: %s" '$HOSTALIAS$' '$HOSTSTATE$' '$OUTPUT$' '$DATETIME$'b| /usr/local/bin/qpage -l 0 -p $CONTACTPAGER$
}
################################################################################
#
# SAMPLE PERFORMANCE DATA COMMANDS
#
# These are sample performance data commands that can be used to send performance
# data output to two text files (one for hosts, another for services). If you
# plan on simply writing performance data out to a file, consider compiling
# Nagios with native file support for performance data. This is done by
# supplying the --with-file-perfdata option to the configure script.
#
################################################################################
# 'process-host-perfdata' command definition
define command{
command_name process-host-perfdata
command_line /usr/bin/printf "%b" "$LASTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$STATETYPE$\t$EXECUTIONTIME$\t$OUTPUT$\t$PERFDATA$" >> /usr/local/nagios/var/host-perfdata.out
}
# 'process-service-perfdata' command definition
define command{
command_name process-service-perfdata
command_line /usr/bin/printf "%b" "$LASTCHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$STATETYPE$\t$EXECUTIONTIME$\t$LATENCY$\t$OUTPUT$\t$PERFDATA$" >> /usr/local/nagios/var/service-perfdata.out
}
More information about the Users
mailing list