#
# The tasks.cfg file is loaded by "xymonlaunch".
# It controls which of the Xymon modules to run, how often, and
# with which parameters, options and environment variables.
#

######################################################################################
### 
### xymond master daemon and worker modules below.
### You definitely need these on a Xymon server.
### 
######################################################################################

# This is the main Xymon daemon. This must be running on at least
# one server in your setup. If you are setting up a server to do
# just network tests or run xymonproxy, it is OK to disable this (then
# you also need to remove the "NEEDS xymond" lines for the tasks
# you want to run).
[xymond]
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	CMD xymond --pidfile=$XYMONSERVERLOGS/xymond.pid \
		--restart=$XYMONTMP/xymond.chk --checkpoint-file=$XYMONTMP/xymond.chk --checkpoint-interval=600 \
		--log=$XYMONSERVERLOGS/xymond.log \
		--admin-senders=127.0.0.1,$XYMONSERVERIP \
		--store-clientlogs=!msgs

# "history" keeps track of the status changes that happen.
[history]
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymond_channel --channel=stachg --log=$XYMONSERVERLOGS/history.log xymond_history --pidfile=$XYMONSERVERLOGS/xymond_history.pid

# "alert" sends out alerts.
[alert]
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymond_channel --channel=page  --log=$XYMONSERVERLOGS/alert.log xymond_alert --checkpoint-file=$XYMONTMP/alert.chk --checkpoint-interval=600

# The client back-end module. You need this if you are running the Xymon client on any system.
[clientdata]
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymond_channel --channel=client --log=$XYMONSERVERLOGS/clientdata.log xymond_client

# "rrdstatus" updates RRD files with information that arrives as "status" messages.
[rrdstatus]
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymond_channel --channel=status --log=$XYMONSERVERLOGS/rrd-status.log xymond_rrd --rrddir=$XYMONVAR/rrd

# "rrddata" updates RRD files with information that arrives as "data" messages.
[rrddata]
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymond_channel --channel=data   --log=$XYMONSERVERLOGS/rrd-data.log xymond_rrd --rrddir=$XYMONVAR/rrd

# "hostdata" stores the Xymon client messages on disk when some status for a host
# changes. This lets you access a lot of data collected from a host around the time
# when a problem occurred. However, it may use a significant amount of disk space
# if you have lots of Xymon clients.
# Note: The --store-clientlogs option for the [xymond] provides control over
#       which status-changes will cause a client message to be stored.
[hostdata]
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymond_channel --channel=clichg --log=$XYMONSERVERLOGS/hostdata.log xymond_hostdata

# "distribute" forwards enable/disable/drop/rename messages to other Xymon servers.
# You would use it when running Xymon in an active/passive (master/slave) configuration.
# I.e. one Xymon server is the primary server where users manage their hosts; the 
# other acts as a backup in case the primary server is down. This module then makes
# sure that all of the administrative commands are forwarded to the backup (slave)
# system.
# NOTE: xymond_distribute does NOT check if a message is looping between servers that
# forward to each other. So take care not to create forwarding loops.
[distribute]
	DISABLED
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymond_channel --channel=enadis --log=$XYMONSERVERLOGS/distribute.log xymond_distribute --peer=IP.OF.SLAVE.SERVER


######################################################################################
### 
### Xymon proxy and other means of passing client-side data to the Xymon server.
###
### Enable these if you have a server acting as gateway between some servers you
### monitor, and the main Xymon server (typically if your Xymon server is on 
### another network than the monitored servers).
### 
######################################################################################

# "xymonproxy" is the Xymon proxy server that allows you to forward status messages
# from a protected network to your Xymon server. It is not enabled by default,
# since it would conflict with the xymond task.
# If you need to run this, disable xymond and the xymond-modules
# above and enable this. Make sure you enter the IP-address of your 
# Xymon server in the command-line, so that the proxy knows where to forward
# status messages.
[xymonproxy]
	DISABLED
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	CMD $XYMONHOME/bin/xymonproxy --server=YOUR.XYMON.SERVER.IP --report=$MACHINE.xymonproxy --no-daemon --pidfile=$XYMONSERVERLOGS/xymonproxy.pid
	LOGFILE $XYMONSERVERLOGS/xymonproxy.log


# "xymonfetch" is used when you have clients that cannot connect to your Xymon server,
# but the Xymon server can connect to the client. Normally the clients will initiate
# a connection to the Xymon server to deliver the data they collect, but this is
# forbidden in some firewall setups. By enabling the xymonfetch task, hosts that have
# the "pulldata" tag in the hosts.cfg file will be polled by xymonfetch for their data.
#
# NOTE: On the clients you must enable the "msgcache" task, since this is what 
#       xymonfetch is talking to.
[xymonfetch]
	DISABLED
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	CMD $XYMONHOME/bin/xymonfetch --server=YOUR.XYMON.SERVER.IP --no-daemon --pidfile=$XYMONSERVERLOGS/xymonfetch.pid
	LOGFILE $XYMONSERVERLOGS/xymonfetch.log


######################################################################################
### 
### Xymon generator for the overview web-pages.
### 
######################################################################################

# "xymongen" runs the xymongen tool to generate the Xymon webpages from the status information that
# has been received.
[xymongen]
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	GROUP generators
	CMD xymongen $XYMONGENOPTS --report
	LOGFILE $XYMONSERVERLOGS/xymongen.log
	INTERVAL 1m


######################################################################################
### 
### Xymon network tests
### 
######################################################################################

# "xymonnet" runs the xymonnet tool to perform the network based tests - i.e. http, smtp, ssh, dns and
# all of the various network protocols we need to test.
[xymonnet]
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymonnet --report --ping --checkresponse
	LOGFILE $XYMONSERVERLOGS/xymonnet.log
	INTERVAL 5m

# "xymonnetagain" picks up the tests that the normal network test consider "failed", and re-does those
# tests more often. This enables Xymon to pick up a recovered network service faster than
# if it were tested only by the "xymonnet" task (which only runs every 5 minutes). So if you have
# servers with very high availability guarantees, running this task will make your availability
# reports look much better.
[xymonnetagain]
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD $XYMONHOME/ext/xymonnet-again.sh
	LOGFILE $XYMONSERVERLOGS/xymonnetagain.log
	INTERVAL 1m



######################################################################################
### 
### Miscellaneous Xymon modules
### 
######################################################################################

# combostatus is an extension script for the Xymon display server. It generates
# status messages that are combined from the status of one or more normal statuses.
# It is controlled via the combo.cfg file.
[combostatus]
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD $XYMONHOME/bin/combostatus
	LOGFILE $XYMONSERVERLOGS/combostatus.log
	INTERVAL 5m


######################################################################################
### 
### Xymon client for monitoring the Xymon server itself.
### 
######################################################################################

# "xymonclient" runs the Xymon client. The client is installed automatically
# when you install a Xymon server (presumably, you do want to monitor the 
# Xymon server ?), but there's no need to have two xymonlaunch instances
# running at the same time. So we'll just run it from here.
[xymonclient]
	ENVFILE @XYMONTOPDIR@/client/etc/xymonclient.cfg
	NEEDS xymond
	CMD @XYMONTOPDIR@/client/bin/xymonclient.sh
	LOGFILE $XYMONSERVERLOGS/xymonclient.log
	INTERVAL 5m



######################################################################################
### 
### xymond_filestore entries below here. 
### These are for Big Brother compatibility, normally you do not need them.
### 
######################################################################################

# "storestatus" saves status-logs in text- and html-format, like the old Big Brother 
# daemon does. Unless you are using add-ons that directly access the log-files, you 
# will not need to run this module, and it is recommended that you keep it disabled
# since storing the raw logs on disk can cause a significant load on your server.
[storestatus]
	DISABLED
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymond_channel --channel=status --log=$XYMONSERVERLOGS/status.log xymond_filestore --status --html

# "storedata" saves information sent using the BB "data" protocol, like the old Big Brother 
# daemon does. Unless you are using add-ons that directly access the data-files, you 
# will not need to run this module, and it is recommended that you keep it disabled
# since storing the raw data on disk can cause a significant load on your Xymon server.
# RRD graphs uses data-files, but since RRD is handled by the xymond_rrd module, you do
# not need to run the "storedata" module to get RRD graphs.
[storedata]
	DISABLED
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymond_channel --channel=data   --log=$XYMONSERVERLOGS/data.log xymond_filestore --data

# "storeenadis" updates the files used to indicate that a host or test has been enabled or disabled.
# Unless you are running server side scripts that look at these files, you do not need this.
[storeenadis]
	DISABLED
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymond_channel --channel=enadis --log=$XYMONSERVERLOGS/enadis.log xymond_filestore --enadis

# "storenotes" saves web note-files, that are sent using the BB "notes" protocol. This is
# disabled by default; if you use the Big Brother "notes" protocol, then you should enable this.
[storenotes]
	DISABLED
	ENVFILE @XYMONHOME@/etc/xymonserver.cfg
	NEEDS xymond
	CMD xymond_channel --channel=notes  --log=$XYMONSERVERLOGS/notes.log xymond_filestore --notes



# Include add-on modules.
directory @XYMONHOME@/etc/tasks.d

