aboutsummaryrefslogtreecommitdiffstats
path: root/modules/xymon
diff options
context:
space:
mode:
authorBuchan Milne <buchan@mageia.org>2011-02-24 21:55:40 +0000
committerBuchan Milne <buchan@mageia.org>2011-02-24 21:55:40 +0000
commit67c32a756bca28fab9947c3561a8e723fef9f018 (patch)
tree84074bfc7ac7473ddaedac5431219d51eb2f748d /modules/xymon
parent6d52ec12264d581389d39a658007c993d0b3bb5b (diff)
downloadpuppet-67c32a756bca28fab9947c3561a8e723fef9f018.tar
puppet-67c32a756bca28fab9947c3561a8e723fef9f018.tar.gz
puppet-67c32a756bca28fab9947c3561a8e723fef9f018.tar.bz2
puppet-67c32a756bca28fab9947c3561a8e723fef9f018.tar.xz
puppet-67c32a756bca28fab9947c3561a8e723fef9f018.zip
Add initial module for xymon
Diffstat (limited to 'modules/xymon')
-rw-r--r--modules/xymon/manifests/init.pp88
-rw-r--r--modules/xymon/templates/bb-hosts32
-rw-r--r--modules/xymon/templates/client-local.cfg130
-rw-r--r--modules/xymon/templates/hobbit-alerts.cfg122
-rw-r--r--modules/xymon/templates/hobbit-clients.cfg359
-rw-r--r--modules/xymon/templates/hobbitserver.cfg224
6 files changed, 955 insertions, 0 deletions
diff --git a/modules/xymon/manifests/init.pp b/modules/xymon/manifests/init.pp
new file mode 100644
index 00000000..93f03050
--- /dev/null
+++ b/modules/xymon/manifests/init.pp
@@ -0,0 +1,88 @@
+class xymon {
+
+ class client {
+ package { xymon-client:
+ ensure => installed
+ }
+ service { xymon-client:
+ ensure => running
+ path => '/etc/init.d/xymon-client'
+ }
+ file { '/etc/sysconfig/xymon-client':
+ content => template("xymon/xymon-client"),
+ }
+ }
+
+ class server {
+ package { xymon:
+ ensure => installed
+ }
+ service { xymon:
+ ensure => running,
+ path => '/etc/init.d/xymon',
+ }
+ # Environment variables user by hobbitd,hobbitlaunch,hobbitd_rrd,CGIs
+ # and bbgen (which generates the static html pages)
+ # hobbitlaunch (started by init script) may need to be restarted for
+ # changes here, for hobbitd_rrd (e.g. TEST2RRD), it is sufficient to
+ # kill hobbitd_rrd, hobbitlaunch will respawn it
+ file { '/etc/xymon/hobbitserver.cfg':
+ ensure => present,
+ user => root,
+ group => xymon,
+ mode => 644,
+ require => Package["xymon"],
+ notify => [Service["xymon"],
+ content => template("xymon/hobbitserver.cfg"),
+ }
+ # Define hosts and web view layout, and lists tests to be run against
+ # host by e.g. network tests from xymon server
+ file {'/etc/xymon/bb-hosts':
+ ensure => present,
+ user => root,
+ group => xymon,
+ mode => 644,
+ content => template("xymon/bb-hosts"),
+ }
+
+ # Defines thresholds for test data reported by clients, e.g. load
+ # disk, procs, ports, memory, as well as those which require some
+ # configuration server side to the client: files, msgs,
+ file { 'hobbit-clients.cfg':
+ path => '/etc/xymon/hobbit-clients.cfg'
+ ensure => present,
+ user => root,
+ group => xymon,
+ mode => 644,
+ content => template("xymon/hobbit-clients.cfg"),
+ }
+ # Configuration for the xymon clients, which log files to process etc.
+ file {'client-local.cfg':
+ path => '/etc/xymon/client-local.cfg',
+ ensure => present,
+ user => root,
+ group => xymon,
+ mode => 644,
+ content => template("xymon/client-local.cfg"),
+ }
+
+ # Used for alerting, changes should be taken into effect immediately
+ file {'hobbit-alerts.cfg':
+ path => '/etc/xymon/hobbit-alerts.cfg':
+ ensure => present,
+ user => root,
+ group => xymon,
+ mode => 644,
+ content => template("xymon/hobbit-alerts.cfg"),
+ }
+ # Most changes should take effect immediately, but sometimes threshold
+ # changes take effect sooner if hobbit is HUPd
+ exec { "service xymon reload":
+ refreshonly => true,
+ subscribe => [
+ File["hobbit-clients.cfg"],
+ File["hobbit-alerts.cfg"],
+ File["client-local.cfg"],
+ ]
+ }
+ }
diff --git a/modules/xymon/templates/bb-hosts b/modules/xymon/templates/bb-hosts
new file mode 100644
index 00000000..af144913
--- /dev/null
+++ b/modules/xymon/templates/bb-hosts
@@ -0,0 +1,32 @@
+#
+# Master configuration file for Xymon
+#
+# This file defines several things:
+#
+# 1) By adding hosts to this file, you define hosts that are monitored by Xymon
+# 2) By adding "page", "subpage", "group" definitions, you define the layout
+# of the Xymon webpages, and how hosts are divided among the various webpages
+# that Xymon generates.
+# 3) Several other definitions can be done for each host, see the bb-hosts(5)
+# man-page.
+#
+# You need to define at least the Xymon server itself here.
+
+page visible Visible Services
+0.0.0.0 blog.mageia.org # http://blog.mageia.org
+0.0.0.0 identity.mageia.org # https://identity.mageia.org
+0.0.0.0 bugs.mageia.org # https://bugs.mageia.org
+
+
+page servers Servers
+group-compress Marseille
+212.85.158.146 alamut.mageia.org # testip bbd dns ssh
+212.85.158.147 valstar.mageia.org # testip ssh rsync
+212.85.158.148 ecosse.mageia.org # testip ssh
+212.85.158.149 jonund.mageia.org # testip ssh
+#212.85.158.150 fiona.mageia.org # testip ssh
+
+group-compress Gandi
+95.142.164.207 krampouezh.mageia.org # ssh dns
+88.190.12.224 rabbit.mageia.org # ssh
+217.70.188.116 champagne.mageia.org # ssh
diff --git a/modules/xymon/templates/client-local.cfg b/modules/xymon/templates/client-local.cfg
new file mode 100644
index 00000000..04165993
--- /dev/null
+++ b/modules/xymon/templates/client-local.cfg
@@ -0,0 +1,130 @@
+# The client-local.cfg file contains configuration for
+# the Xymon clients running on monitored systems. When
+# clients contact the Xymon server, they get the section
+# from this file which matches their hostname or operating
+# system.
+#
+# The following configuration items are currently possible:
+# "log:FILENAME:MAXDATA"
+# Monitor the text-based logfile FILENAME, and report
+# back at most MAXDATA bytes. The Xymon client will
+# only report back entries generated during the past
+# 30 minutes, so MAXDATA is an upper limit.
+# "ignore EXPRESSION"
+# Must follow a "log:..." entry. Lines matching the
+# regular EXPRESSION are not sent to the Xymon server.
+# "trigger EXPRESSION"
+# Must follow a "log:..." entry. Lines matching the
+# regular EXPRESSION are always sent to the Xymon server.
+# Use this for extremely critical errors that must be
+# reported.
+#
+# "linecount:FILENAME"
+# Monitor the text-based logfile FILENAME, but just
+# count the number of times certain expressions appear.
+# This processes the entire file every time. It must
+# be followed by one or more lines with
+# "KEYWORD PATTERN"
+# KEYWORD identifies this count. You can use any string
+# except whitespace. PATTERN is a regular expression
+# that you want to search for in the file.
+#
+# "file:FILENAME[:hash]"
+# Monitor the file FILENAME by reporting file metadata.
+# The Xymon client will report back all of the file
+# meta-data, e.g. size, timestamp, filetype, permissions
+# etc. The optional "hash" setting is "md5", "sha1" or
+# "rmd160", and causes the Xymon client to compute a
+# file hash using the MD5, SHA-1 or RMD160 algorithm.
+# Note: Computing the hash value may be CPU-intensive,
+# so You should use this sparingly. For large-scale
+# file integrity monitoring, use a real host-based
+# IDS (Tripwire, AIDE or similar).
+#
+# "dir:DIRECTORY"
+# Monitor the size of DIRECTORY, including sub-directories.
+# This causes the Xymon client to run a "du" on DIRECTORY
+# and send this back to the Xymon server.
+# Note: Running "du" on large/deep directory structures can
+# cause a significant system load.
+#
+# NB: If FILENAME and/or DIRECTORY are of the form `COMMAND`,
+# then COMMAND is run on the client, and the lines output
+# by the command are used as the file- or directory-names.
+# This allows you to monitor files where the names change,
+# as long as you can script some way of determining the
+# interesting filenames.
+
+[sunos]
+log:/var/adm/messages:10240
+
+[osf1]
+log:/var/adm/messages:10240
+
+[aix]
+log:/var/adm/syslog/syslog.log:10240
+
+[hp-ux]
+log:/var/adm/syslog/syslog.log:10240
+
+[win32]
+
+[freebsd]
+log:/var/log/messages:10240
+
+[netbsd]
+log:/var/log/messages:10240
+
+[openbsd]
+log:/var/log/messages:10240
+
+[linux]
+log:/var/log/messages:10240
+ignore MARK
+
+[linux22]
+log:/var/log/messages:10240
+ignore MARK
+
+[redhat]
+log:/var/log/messages:10240
+ignore MARK
+
+[debian]
+log:/var/log/messages:10240
+ignore MARK
+
+[suse]
+log:/var/log/messages:10240
+ignore MARK
+
+[mandrake]
+log:/var/log/messages:10240
+ignore MARK
+
+[mandrivalinux]
+log:/var/log/messages:10240
+#log:/var/log/secure:10240
+ignore MARK
+
+[redhatAS]
+log:/var/log/messages:10240
+ignore MARK
+
+[redhatES]
+log:/var/log/messages:10240
+ignore MARK
+
+[rhel3]
+log:/var/log/messages:10240
+ignore MARK
+
+[irix]
+log:/var/adm/SYSLOG:10240
+
+[darwin]
+log:/var/log/system.log:10240
+
+[sco_sv]
+log:/var/adm/syslog:10240
+
diff --git a/modules/xymon/templates/hobbit-alerts.cfg b/modules/xymon/templates/hobbit-alerts.cfg
new file mode 100644
index 00000000..d928d289
--- /dev/null
+++ b/modules/xymon/templates/hobbit-alerts.cfg
@@ -0,0 +1,122 @@
+#
+# The hobbit-alerts.cfg file controls who receives alerts
+# when a status in the BB system goes into a critical
+# state (usually: red, yellow or purple).
+#
+# This file is made up from RULES and RECIPIENTS.
+#
+# A RULE is a filter made from the PAGE where a host
+# is located in BB; the HOST name, the SERVICE name,
+# the COLOR of the status, the TIME of day, and the
+# DURATION of the event.
+#
+# A RECIPIENT can be a MAIL address, or a SCRIPT.
+#
+# Recipients can also have rules associated with them,
+# that modify the rules for a single recipient, e.g.
+# you can define a rule for alerting, then add an
+# extra criteria e.g. so a single recipient does not get
+# alerted until after 20 minutes.
+#
+# A sample rule:
+#
+# HOST=www.foo.com SERVICE=http
+# MAIL webadmin@foo.com REPEAT=20 RECOVERED
+# MAIL cio@foo.com DURATION>60 COLOR=red
+# SCRIPT /usr/local/bin/sendsms 1234567890 FORMAT=SMS
+#
+# The first line sets up a rule that catches alerts
+# for the host "www.foo.com" and the "http" service.
+# There are three recipients for these alerts: The first
+# one is the "webadmin@foo.com" - they get alerted
+# immediately when the status goes into an alert state,
+# and the alert is repeated every 20 minutes until it
+# recovers. When it recovers, a message is sent about
+# the recovery.
+#
+# The second recipient is "cio@foo.com". He gets alerted
+# only when the service goes "red" for more than 60 minutes.
+#
+# The third recipient is a script, "/usr/local/bin/sendsms".
+# The real recipient is "1234567890", but it is handled
+# by the script - the script receives a set of environment
+# variables with the details about the alert, including the
+# real recipient. The alert message is preformatted for
+# an SMS recipient.
+#
+# You can use Perl-compatible "regular expressions" for
+# the PAGE, HOST and SERVICE definitions, by putting a "%"
+# in front of the regex. E.g.
+#
+# HOST=%^www.*
+# MAIL webadmin@foo.com EXHOST=www.testsite.foo.com
+#
+# This sets up a rule so that alerts from any hostname
+# beginning with "www" goes to "webadmin@foo.com", EXCEPT
+# alerts from "www.testsite.foo.com"
+#
+# The following keywords are recognized:
+# PAGE - rule matching an alert by the name of the
+# page in BB. This is the name following
+# the "page", "subpage" or "subparent" keyword
+# in the bb-hosts file.
+# EXPAGE - rule excluding an alert if the pagename matches.
+# HOST - rule matching an alert by the hostname.
+# EXHOST - rule excluding an alert by matching the hostname.
+# SERVICE - rule matching an alert by the service name.
+# EXSERVICE - rule excluding an alert by matching the hostname.
+# GROUP - rule matching an alert by the group ID.
+# (Group ID's are associated with a status through the
+# hobbit-clients.cfg configuration).
+# EXGROUP - rule excluding an alert by matching the group ID.
+# COLOR - rule matching an alert by color. Can be "red",
+# "yellow", or "purple".
+# TIME - rule matching an alert by the time-of-day. This
+# is specified as the DOWNTIME timespecification
+# in the bb-hosts file (see bb-hosts(5)).
+# DURATION - Rule matcing an alert if the event has lasted
+# longer/shorter than the given duration. E.g.
+# DURATION>10 (lasted longer than 10 minutes) or
+# DURARION<30 (only sends alerts the first 30 minutes).
+# RECOVERED - Rule matches if the alert has recovered from an
+# alert state.
+# NOTICE - Rule matches if the message is a "notify" message
+# (typically sent when a status is enabled or disabled).
+# MAIL - Recipient who receives an e-mail alert. This takes
+# one parameter, the e-mail address.
+# SCRIPT - Recipient that invokes a script. This takes two
+# parameters: The script filename, and the recipient
+# that gets passed to the script.
+# FORMAT - format of the text message with the alert. Default
+# is "TEXT" (suitable for e-mail alerts). "SMS" is
+# a short message with no subject for SMS alerts.
+# "SCRIPT" is a brief message template for scripts.
+# REPEAT - How often an alert gets repeated, in minutes.
+# STOP - Valid for a recipient: If this recipient gets an
+# alert, recipients further down in hobbit-alerts.cfg
+# are ignored.
+# UNMATCHED - Matches if no alerts have been sent so far.
+#
+#
+# Script get the following environment variables pre-defined so
+# that they can send a meaningful alert:
+#
+# BBCOLORLEVEL - The color of the alert: "red", "yellow" or "purple"
+# BBALPHAMSG - The full text of the status log triggering the alert
+# ACKCODE - The "cookie" that can be used to acknowledge the alert
+# RCPT - The recipient, from the SCRIPT entry
+# BBHOSTNAME - The name of the host that the alert is about
+# MACHIP - The IP-address of the host that has a problem
+# BBSVCNAME - The name of the service that the alert is about
+# BBSVCNUM - The numeric code for the service. From SVCCODES definition.
+# BBHOSTSVC - HOSTNAME.SERVICE that the alert is about.
+# BBHOSTSVCCOMMAS - As BBHOSTSVC, but dots in the hostname replaced with commas
+# BBNUMERIC - A 22-digit number made by BBSVCNUM, MACHIP and ACKCODE.
+# RECOVERED - Is "1" if the service has recovered.
+# DOWNSECS - Number of seconds the service has been down.
+# DOWNSECSMSG - When recovered, holds the text "Event duration : N" where
+# N is the DOWNSECS value.
+
+
+HOST=%.*.mageia.org
+ MAIL=mageia-sysadm@mageia.org DURATION>5 RECOVERED NOTICE REPEAT=3h
diff --git a/modules/xymon/templates/hobbit-clients.cfg b/modules/xymon/templates/hobbit-clients.cfg
new file mode 100644
index 00000000..c65d3de5
--- /dev/null
+++ b/modules/xymon/templates/hobbit-clients.cfg
@@ -0,0 +1,359 @@
+# hobbit-clients.cfg - configuration file for clients reporting to Xymon
+#
+# This file is used by the hobbitd_client module, when it builds the
+# cpu, disk, files, memory, msgs and procs status messages from the
+# information reported by clients running on the monitored systems.
+#
+# This file must be installed on the Xymon server - client installations
+# do not need this file.
+#
+# The file defines a series of rules:
+# UP : Changes the "cpu" status when the system has rebooted recently,
+# or when it has been running for too long.
+# LOAD : Changes the "cpu" status according to the system load.
+# CLOCK : Changes the "cpu" status if the client system clock is
+# not synchronized with the clock of the Xymon server.
+# DISK : Changes the "disk" status, depending on the amount of space
+# used of filesystems.
+# MEMPHYS: Changes the "memory" status, based on the percentage of real
+# memory used.
+# MEMACT : Changes the "memory" status, based on the percentage of "actual"
+# memory used. Note: Not all systems report an "actual" value.
+# MEMSWAP: Changes the "memory" status, based on the percentage of swap
+# space used.
+# PROC : Changes the "procs" status according to which processes were found
+# in the "ps" listing from the client.
+# LOG : Changes the "msgs" status according to entries in text-based logfiles.
+# Note: The "client-local.cfg" file controls which logfiles the client will report.
+# FILE : Changes the "files" status according to meta-data for files.
+# Note: The "client-local.cfg" file controls which files the client will report.
+# DIR : Changes the "files" status according to the size of a directory.
+# Note: The "client-local.cfg" file controls which directories the client will report.
+# PORT : Changes the "ports" status according to which tcp ports were found
+# in the "netstat" listing from the client.
+# DEFAULT: Set the default values that apply if no other rules match.
+#
+# All rules can be qualified so they apply only to certain hosts, or on certain
+# times of the day (see below).
+#
+# Each type of rule takes a number of parameters:
+# UP bootlimit toolonglimit
+# The cpu status goes yellow if the system has been up for less than
+# "bootlimit" time, or longer than "toolonglimit". The time is in
+# minutes, or you can add h/d/w for hours/days/weeks - eg. "2h" for
+# two hours, or "4w" for 4 weeks.
+# Defaults: bootlimit=1h, toolonglimit=-1 (infinite).
+#
+# LOAD warnlevel paniclevel
+# If the system load exceeds "warnlevel" or "paniclevel", the "cpu"
+# status will go yellow or red, respectively. These are decimal
+# numbers.
+# Defaults: warnlevel=5.0, paniclevel=10.0
+#
+# CLOCK maximum-offset
+# If the system clock of the client differs from that of the Xymon
+# server by more than "maximum-offset" seconds, then the CPU status
+# column will go yellow. Note that the accuracy of this test is limited,
+# since it is affected by the time it takes a client status report to
+# go from the client to the Xymon server and be processed. You should
+# therefore allow for a few seconds (5-10) of slack when you define
+# your max. offset.
+# It is not wise to use this test, unless your servers are synchronized
+# to a common clock, e.g. through NTP.
+#
+# DISK filesystem warnlevel paniclevel
+# DISK filesystem IGNORE
+# If the utilization of "filesystem" is reported to exceed "warnlevel"
+# or "paniclevel", the "disk" status will go yellow or red, respectively.
+# "warnlevel" and "paniclevel" are either the percentage used, or the
+# space available as reported by the local "df" command on the host.
+# For the latter type of check, the "warnlevel" must be followed by the
+# letter "U", e.g. "1024U".
+# The special keyword "IGNORE" causes this filesystem to be ignored
+# completely, i.e. it will not appear in the "disk" status column and
+# it will not be tracked in a graph. This is useful for e.g. removable
+# devices, backup-disks and similar hardware.
+# "filesystem" is the mount-point where the filesystem is mounted, e.g.
+# "/usr" or "/home". A filesystem-name that begins with "%" is interpreted
+# as a Perl-compatible regular expression; e.g. "%^/oracle.*/" will match
+# any filesystem whose mountpoint begins with "/oracle".
+# Defaults: warnlevel=90%, paniclevel=95%
+#
+# MEMPHYS warnlevel paniclevel
+# MEMACT warnlevel paniclevel
+# MEMSWAP warnlevel paniclevel
+# If the memory utilization exceeds the "warnlevel" or "paniclevel", the
+# "memory" status will change to yellow or red, respectively.
+# Note: The words "PHYS", "ACT" and "SWAP" are also recognized.
+# Defaults: MEMPHYS warnlevel=100 paniclevel=101 (i.e. it will never go red)
+# MEMSWAP warnlevel=50 paniclevel=80
+# MEMACT warnlevel=90 paniclevel=97
+#
+# PROC processname minimumcount maximumcount color [TRACK=id] [TEXT=displaytext]
+# The "ps" listing sent by the client will be scanned for how many
+# processes containing "processname" are running, and this is then
+# matched against the min/max settings defined here. If the running
+# count is outside the thresholds, the color of the "procs" status
+# changes to "color".
+# To check for a process that must NOT be running: Set minimum and
+# maximum to 0.
+#
+# "processname" can be a simple string, in which case this string must
+# show up in the "ps" listing as a command. The scanner will find
+# a ps-listing of e.g. "/usr/sbin/cron" if you only specify "processname"
+# as "cron".
+# "processname" can also be a Perl-compatiable regular expression, e.g.
+# "%java.*inst[0123]" can be used to find entries in the ps-listing for
+# "java -Xmx512m inst2" and "java -Xmx256 inst3". In that case,
+# "processname" must begin with "%" followed by the reg.expression.
+# If "processname" contains whitespace (blanks or TAB), you must enclose
+# the full string in double quotes - including the "%" if you use regular
+# expression matching. E.g.
+# PROC "%hobbitd_channel --channel=data.*hobbitd_rrd" 1 1 yellow
+# or
+# PROC "java -DCLASSPATH=/opt/java/lib" 2 5
+#
+# You can have multiple "PROC" entries for the same host, all of the
+# checks are merged into the "procs" status and the most severe
+# check defines the color of the status.
+#
+# The TRACK=id option causes the number of processes found to be recorded
+# in an RRD file, with "id" as part of the filename. This graph will then
+# appear on the "procs" page as well as on the "trends" page. Note that
+# "id" must be unique among the processes tracked for each host.
+#
+# The TEXT=displaytext option affects how the process appears on the
+# "procs" status page. By default, the process is listed with the
+# "processname" as identification, but if this is a regular expression
+# it may be a bit difficult to understand. You can then use e.g.
+# "TEXT=Apache" to make these processes appear with the name "Apache"
+# instead.
+#
+# Defaults: mincount=1, maxcount=-1 (unlimited), color="red".
+# Note: No processes are checked by default.
+#
+# Example: Check that "cron" is running:
+# PROC cron
+# Example: Check that at least 5 "httpd" processes are running, but
+# not more than 20:
+# PROC httpd 5 20
+#
+# LOG filename match-pattern [COLOR=color] [IGNORE=ignore-pattern] [TEXT=displaytext]
+# In the "client-local.cfg" file, you can list any number of files
+# that the client will collect log data from. These are sent to the
+# Xymon server together with the other client data, and you can then
+# choose how to analyze the log data with LOG entries.
+#
+# ************ IMPORTANT ***************
+# To monitor a logfile, you *MUST* configure both client-local.cfg
+# and hobbit-clients.cfg. If you configure only the client-local.cfg
+# file, the client will collect the log data and you can view it in
+# the "client data" display, but it will not affect the color of the
+# "msgs" status. On the other hand, if you configure only the
+# hobbit-clients.cfg file, then there will be no log data to inspect,
+# and you will not see any updates of the "msgs" status either.
+#
+# "filename" is a filename or pattern. The set of files reported by
+# the client is matched against "filename", and if they match then
+# this LOG entry is processed against the data from a file.
+#
+# "match-pattern": The log data is matched against this pattern. If
+# there is a match, this log file causes a status change to "color".
+#
+# "ignore-pattern": The log data that matched "match-pattern" is also
+# matched against "ignore-pattern". If the data matches the "ignore-pattern",
+# this line of data does not affect the status color. In other words,
+# the "ignore-pattern" can be used to refine the strings which cause
+# a match.
+# Note: The "ignore-pattern" is optional.
+#
+# "color": The color which this match will trigger.
+# Note: "color" is optional, if omitted then "red" will be used.
+#
+# Example: Go yellow if the text "WARNING" shows up in any logfile.
+# LOG %.* WARNING COLOR=yellow
+#
+# Example: Go red if the text "I/O error" or "read error" appears.
+# LOG %/var/(adm|log)/messages %(I/O|read).error COLOR=red
+#
+# FILE filename [color] [things to check] [TRACK]
+# NB: The files you wish to monitor must be listed in a "file:..."
+# entry in the client-local.cfg file, in order for the client to
+# report any data about them.
+#
+# "filename" is a filename or pattern. The set of files reported by
+# the client is matched against "filename", and if they match then
+# this FILE entry is processed against the data from that file.
+#
+# [things to check] can be one or more of the following:
+# - "NOEXIST" triggers a warning if the file exists. By default,
+# a warning is triggered for files that have a FILE entry, but
+# which do not exist.
+# - "TYPE=type" where "type" is one of "file", "dir", "char", "block",
+# "fifo", or "socket". Triggers warning if the file is not of the
+# specified type.
+# - "OWNERID=owner" and "GROUPID=group" triggers a warning if the owner
+# or group does not match what is listed here. "owner" and "group" is
+# specified either with the numeric uid/gid, or the user/group name.
+# - "MODE=mode" triggers a warning if the file permissions are not
+# as listed. "mode" is written in the standard octal notation, e.g.
+# "644" for the rw-r--r-- permissions.
+# - "SIZE<max.size" and "SIZE>min.size" triggers a warning it the file
+# size is greater than "max.size" or less than "min.size", respectively.
+# You can append "K" (KB), "M" (MB), "G" (GB) or "T" (TB) to the size.
+# If there is no such modifier, KB is assumed.
+# E.g. to warn if a file grows larger than 1MB (1024 KB): "SIZE<1M".
+# - "SIZE=size" triggers a warning it the file size is not what is listed.
+# - "MTIME>min.mtime" and "MTIME<max.mtime" checks how long ago the file
+# was last modified (in seconds). E.g. to check if a file was updated
+# within the past 10 minutes (600 seconds): "MTIME<600". Or to check
+# that a file has NOT been updated in the past 24 hours: "MTIME>86400".
+# - "MTIME=timestamp" checks if a file was last modified at "timestamp".
+# "timestamp" is a unix epoch time (seconds since midnight Jan 1 1970 UTC).
+# - "CTIME>min.ctime", "CTIME<max.ctime", "CTIME=timestamp" acts as the
+# mtime checks, but for the ctime timestamp (when the files' directory
+# entry was last changed, eg. by chown, chgrp or chmod).
+# - "MD5=md5sum", "SHA1=sha1sum", "RMD160=rmd160sum" trigger a warning
+# if the file checksum using the MD5, SHA1 or RMD160 message digest
+# algorithms do not match the one configured here. Note: The "file"
+# entry in the client-local.cfg file must specify which algorithm to use.
+#
+# "TRACK" causes the size of this file to be tracked in an RRD file, and
+# shown on the graph on the "files" display.
+#
+# Example: Check that the /var/log/messages file is not empty and was updated
+# within the past 10 minutes, and go yellow if either fails:
+# FILE /var/log/messages SIZE>0 MTIME<600 yellow
+#
+# Example: Check the timestamp, size and SHA-1 hash of the /bin/sh program:
+# FILE /bin/sh MTIME=1128514608 SIZE=645140 SHA1=5bd81afecf0eb93849a2fd9df54e8bcbe3fefd72
+#
+# DIR directory [color] [SIZE<maxsize] [SIZE>minsize] [TRACK]
+# NB: The directories you wish to monitor must be listed in a "dir:..."
+# entry in the client-local.cfg file, in order for the client to
+# report any data about them.
+#
+# "directory" is a filename or pattern. The set of directories reported by
+# the client is matched against "directory", and if they match then
+# this DIR entry is processed against the data for that directory.
+#
+# "SIZE<maxsize" and "SIZE>minsize" defines the size limits that the
+# directory must stay within. If it goes outside these limits, a warning
+# will trigger. Note the Xymon uses the raw number reported by the
+# local "du" command on the client. This is commonly KB, but it may be
+# disk blocks which are often 512 bytes.
+#
+# "TRACK" causes the size of this directory to be tracked in an RRD file,
+# and shown on the graph on the "files" display.
+#
+# PORT [LOCAL=addr] [EXLOCAL=addr] [REMOTE=addr] [EXREMOTE=addr] [STATE=state] [EXSTATE=state] [MIN=mincount] [MAX=maxcount] [COLOR=color] [TRACK=id] [TEXT=displaytext]
+# The "netstat" listing sent by the client will be scanned for how many
+# sockets match the criteria listed.
+# "addr" is a (partial) address specification in the format used on
+# the output from netstat. This is typically "10.0.0.1:80" for the IP
+# 10.0.0.1, port 80. Or "*:80" for any local address, port 80.
+# NB: The Xymon clients normally report only the numeric data for
+# IP-adresses and port-numbers, so you must specify the port
+# number (e.g. "80") instead of the service name ("www").
+# "state" causes only the sockets in the specified state to be included;
+# it is usually LISTEN or ESTABLISHED.
+# The socket count is then matched against the min/max settings defined
+# here. If the count is outside the thresholds, the color of the "ports"
+# status changes to "color".
+# To check for a socket that must NOT exist: Set minimum and
+# maximum to 0.
+#
+# "addr" and "state" can be a simple strings, in which case these string must
+# show up in the "netstat" at the appropriate column.
+# "addr" and "state" can also be a Perl-compatiable regular expression, e.g.
+# "LOCAL=%(:80|:443)" can be used to find entries in the netstat local port for
+# both http (port 80) and https (port 443). In that case, portname or state must
+# begin with "%" followed by the reg.expression.
+#
+# The TRACK=id option causes the number of sockets found to be recorded
+# in an RRD file, with "id" as part of the filename. This graph will then
+# appear on the "ports" page as well as on the "trends" page. Note that
+# "id" must be unique among the ports tracked for each host.
+#
+# The TEXT=displaytext option affects how the port appears on the
+# "ports" status page. By default, the port is listed with the
+# local/remote/state rules as identification, but this may be somewhat
+# difficult to understand. You can then use e.g. "TEXT=Secure Shell" to make
+# these ports appear with the name "Secure Shell" instead.
+#
+# Defaults: state="LISTEN", mincount=1, maxcount=-1 (unlimited), color="red".
+# Note: No ports are checked by default.
+#
+# Example: Check that there is someone listening on the https port:
+# PORT "LOCAL=%([.:]443)$" state=LISTEN TEXT=https
+#
+# Example: Check that at least 5 "ssh" connections are established, but
+# not more than 10; warn but do not error; graph the connection count:
+# PORT "LOCAL=%([.:]22)$" state=ESTABLISHED min=5 max=20 color=yellow TRACK=ssh "TEXT=SSH logins"
+#
+# Example: Check that ONLY ports 22, 80 and 443 are open for incoming connections:
+# PORT STATE=LISTEN LOCAL=%0.0.0.0[.:].* EXLOCAL=%[.:](22|80|443)$ MAX=0 "TEXT=Bad listeners"
+#
+#
+# To apply rules to specific hosts, you can use the "HOST=", "EXHOST=", "PAGE="
+# "EXPAGE=", "CLASS=" or "EXCLASS=" qualifiers. (These act just as in the
+# hobbit-alerts.cfg file).
+#
+# Hostnames are either a comma-separated list of hostnames (from the bb-hosts file),
+# "*" to indicate "all hosts", or a Perl-compatible regular expression.
+# E.g. "HOST=dns.foo.com,www.foo.com" identifies two specific hosts;
+# "HOST=%www.*.foo.com EXHOST=www-test.foo.com" matches all hosts with a name
+# beginning with "www", except the "www-test" host.
+# "PAGE" and "EXPAGE" match the hostnames against the page on where they are
+# located in the bb-hosts file, via the bb-hosts' page/subpage/subparent
+# directives. This can be convenient to pick out all hosts on a specific page.
+#
+# Rules can be dependant on time-of-day, using the standard Xymon syntax
+# (the bb-hosts(5) about the NKTIME parameter). E.g. "TIME=W:0800:2200"
+# applied to a rule will make this rule active only on week-days between
+# 8AM and 10PM.
+#
+# You can also associate a GROUP id with a rule. The group-id is passed to
+# the alert module, which can then use it to control who gets an alert when
+# a failure occurs. E.g. the following associates the "httpd" process check
+# with the "web" group, and the "sshd" check with the "admins" group:
+# PROC httpd 5 GROUP=web
+# PROC sshd 1 GROUP=admins
+# In the hobbit-alerts.cfg file, you could then have rules like
+# GROUP=web
+# MAIL webmaster@foo.com
+# GROUP=admins
+# MAIL root@foo.com
+#
+# Qualifiers must be placed after each rule, e.g.
+# LOAD 8.0 12.0 HOST=db.foo.com TIME=*:0800:1600
+#
+# If you have multiple rules that you want to apply the same qualifiers to,
+# you can write the qualifiers *only* on one line, followed by the rules. E.g.
+# HOST=%db.*.foo.com TIME=W:0800:1600
+# LOAD 8.0 12.0
+# DISK /db 98 100
+# PROC mysqld 1
+# will apply the three rules to all of the "db" hosts on week-days between 8AM
+# and 4PM. This can be combined with per-rule qualifiers, in which case the
+# per-rule qualifier overrides the general qualifier; e.g.
+# HOST=%.*.foo.com
+# LOAD 7.0 12.0 HOST=bax.foo.com
+# LOAD 3.0 8.0
+# will result in the load-limits being 7.0/12.0 for the "bax.foo.com" host,
+# and 3.0/8.0 for all other foo.com hosts.
+#
+# The special DEFAULT section can modify the built-in defaults - this must
+# be placed at the end of the file.
+
+
+DEFAULT
+ # These are the built-in defaults.
+ UP 1h
+ LOAD 5.0 10.0
+ DISK %^/mnt/cdrom 101 101
+ DISK * 90 95
+ MEMPHYS 100 101
+ MEMSWAP 50 80
+ MEMACT 90 97
+ CLOCK 60
diff --git a/modules/xymon/templates/hobbitserver.cfg b/modules/xymon/templates/hobbitserver.cfg
new file mode 100644
index 00000000..0c990561
--- /dev/null
+++ b/modules/xymon/templates/hobbitserver.cfg
@@ -0,0 +1,224 @@
+# NB : Even though it might look like a shell-script, it is NOT.
+#
+BBSERVERROOT="/usr/lib64/xymon" # Where Xymon is installed - holds the server and bbvar sub-dirs.
+BBSERVERLOGS="/var/log/xymon" # Directory for server logs. The hobbit user must have write-access here.
+HOBBITCLIENTHOME="/usr/lib64/xymon/client" # BBHOME directory for the client
+
+
+BBSERVERHOSTNAME="xymon.<%= domain %>" # The hostname of your server
+BBSERVERIP="212.85.158.146" # The IP-address of your server. Use the real one, not 127.0.0.1 .
+BBSERVEROS="linux" # The operating system of your server. linux,freebsd,solaris,hpux,aix,osf
+
+BBSERVERWWWNAME="xymon.mageia.org" # The name used for this hosts' webserver
+BBSERVERWWWURL="/xymon" # The top URL for the Xymon webpages
+BBSERVERCGIURL="/xymon-cgi" # The URL for the Xymon CGI scripts.
+BBSERVERSECURECGIURL="/xymon-seccgi" # The URL for the secured Xymon CGI scripts.
+
+# BBLOCATION="foo" # The network location, makes bbtest-net test only hosts with NET:foo
+ # You only need to set this if you have multiple network test servers with
+ # a shared bb-hosts file.
+
+# Make sure the path includes the directories where you have fping, mail and (optionally) ntpdate installed,
+# as well as the BBHOME/bin directory where all of the Xymon programs reside.
+PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/lib64/xymon/server/bin"
+
+# Some systems need extra settings e.g. to locate run-time libraries.
+# You can add these extra settings here:
+
+
+
+##### Normally you do not need to modify anything below this point #####
+
+# General settings
+BBPORT="1984" # Portnumber where hobbitd/bbd listens
+BBDISP="$BBSERVERIP" # IP of a single hobbit/bbd server
+BBDISPLAYS="" # IP of multiple hobbit/bbd servers. If used, BBDISP must be 0.0.0.0
+FQDN="TRUE" # Use fully-qualified hostnames internally. Keep it TRUE unless you know better.
+BBGHOSTS="1" # How to handle status messages from unknown hosts.
+ # 0=accept message, 1=discard message, 2=discard message and log the event
+BBLOGSTATUS="DYNAMIC" # Are HTML status logs statically or dynamically generated?
+ # Use DYNAMIC with Xymon, unless you run hobbitd_filestore --status --html
+
+PINGCOLUMN="conn" # Column where the ping-test reports results.
+INFOCOLUMN="info" # Column where the info-pages are reported.
+TRENDSCOLUMN="trends" # Column where the RRD graphs are reported.
+
+BBMAXMSGSPERCOMBO="100" # How many individual messages to combine in a combo-message. 0=unlimited.
+BBSLEEPBETWEENMSGS="0" # Delay between sending each combo message, in milliseconds.
+
+
+# Specific to this host
+BBOSTYPE="$BBSERVEROS" # Hosttype (operating system). Not used by server-side, but clients use this.
+MACHINEDOTS="$BBSERVERHOSTNAME" # This systems hostname
+MACHINEADDR="$BBSERVERIP" # This systems IP-address
+
+# URL's generated/used by bbgen
+BBWEBHOST="http://$BBSERVERWWWNAME" # Just the host part of the URL - http://www.foo.com
+BBWEBHOSTURL="$BBWEBHOST$BBSERVERWWWURL" # Prefix for all static Xymon pages - http://www.foo.com/bb
+BBWEBHTMLLOGS="$BBWEBHOSTURL/html" # Prefix for the Xymon HTML logs (only if BBLOGSTATUS=STATIC)
+BBWEB="$BBSERVERWWWURL" # Xymon URL prefix without the host part
+BBSKIN="$BBSERVERWWWURL/gifs" # Xymon URL prefix for the GIF files
+BBHELPSKIN="$BBSERVERWWWURL/help" # Xymon URL prefix for the online help files.
+BBNOTESSKIN="$BBSERVERWWWURL/notes" # Xymon URL prefix for the online notes-files.
+BBMENUSKIN="$BBSERVERWWWURL/menu" # Xymon URL prefix for the webpage menu files.
+BBREPURL="$BBSERVERWWWURL/rep" # Xymon URL prefix for the Xymon availability reports
+BBSNAPURL="$BBSERVERWWWURL/snap" # Xymon URL prefix for the Xymon snapshots
+BBWAP="$BBSERVERWWWURL/wml" # Xymon URL prefix for the WAP/WML files.
+CGIBINURL="$BBSERVERCGIURL" # URL prefix for the Xymon CGI-scripts - /cgi-bin
+SECURECGIBINURL="$BBSERVERSECURECGIURL" # URL prefix for the secured Xymon CGI-scripts - /cgi-secure
+
+# Locations of system-wide files and directories
+BBHOME="/usr/lib64/xymon/server" # The Xymon server directory, where programs and configurations go.
+BBTMP="$BBHOME/tmp" # Directory used for temporary files.
+BBHOSTS="$BBHOME/etc/bb-hosts" # The bb-hosts file
+BB="$BBHOME/bin/bb" # The 'bb' client program
+BBGEN="$BBHOME/bin/bbgen" # The bbgen program
+
+# Server specific directories
+BBVAR="/var/lib/xymon" # The bbvar directory holds all monitoring data
+BBACKS="$BBVAR/acks" # Acknowledge event info stored here (hobbitd_alert)
+BBDATA="$BBVAR/data" # Data files go here (hobbitd_filestore --data)
+BBDISABLED="$BBVAR/disabled" # Enabled/disabled flags are stored here (hobbitd_filestore --enadis)
+BBHIST="$BBVAR/hist" # History logs are stored here (hobbitd_history)
+BBHISTLOGS="$BBVAR/histlogs" # Historical detail status-loge are stored here (hobbitd_history)
+BBLOGS="$BBVAR/logs" # Status logs go here (hobbitd_filestore --status). Not needed by Xymon.
+BBWWW="$BBHOME/www" # The directory for Xymon webpage files.
+BBHTML="$BBWWW/html" # HTML status logs go here (hobbitd_filestore --status --html)
+BBNOTES="$BBWWW/notes" # For notes-files (hobbitd_filestore --notes)
+BBREP="$BBWWW/rep" # Top-level directory for Xymon reports.
+BBSNAP="$BBWWW/snap" # Top-level directory for Xymon snapshots.
+
+# For the hobbitd_history module
+BBALLHISTLOG="TRUE" # Save a common log of all events (used for the bb2 webpage)
+BBHOSTHISTLOG="TRUE" # Save a log of all events for a host (not used by any tool currently)
+SAVESTATUSLOG="TRUE" # Save the detailed status log each time the status changes.
+
+# For the hobbitd_alert module
+MAILC="mail" # Command used to send an e-mail with no subject
+MAIL="$MAILC -s" # Command used to send an e-mail with a subject
+SVCCODES="disk:100,cpu:200,procs:300,svcs:350,msgs:400,conn:500,http:600,dns:800,smtp:725,telnet:723,ftp:721,pop:810,pop3:810,pop-3:810,ssh:722,imap:843,ssh1:722,ssh2:722,imap2:843,imap3:843,imap4:843,pop2:809,pop-2:809,nntp:819,test:901"
+ALERTCOLORS="red,yellow,purple" # Colors that may trigger an alert message
+OKCOLORS="green,blue,clear" # Colors that may trigger a recovery message
+ALERTREPEAT="30" # The default interval between repeated alert-messages (in minutes)
+
+# For bbtest-net
+CONNTEST="TRUE" # Should we 'ping' hosts ?
+IPTEST_2_CLEAR_ON_FAILED_CONN="TRUE" # If TRUE, then failing network tests go CLEAR if conn-test fails.
+NONETPAGE="" # Network tests that go YELLOW upon failure
+FPING="/bin/fping -Ae" # Path and options for the ping program.
+NTPDATE="ntpdate" # Path to the 'ntpdate' program
+TRACEROUTE="traceroute" # How to do traceroute on failing ping tests. Requires "trace" in bb-hosts.
+BBROUTERTEXT="router" # What to call a failing intermediate network device.
+NETFAILTEXT="not OK" # Text indicating a network test failed
+
+
+# Settings for the RRD graphs
+
+# Top level directory for the RRD files
+BBRRDS="$BBVAR/rrd"
+
+# Size of the generated graph images
+RRDHEIGHT="120"
+RRDWIDTH="576" # The RRD's contain 576 data points, so this is a good value
+
+# TEST2RRD defines the status- and data-messages you want to collect RRD data
+# about. You will normally not need to modify this, unless you have added a
+# script to pick up RRD data from custom tests (the hobbitd_larrd --extra-script
+# and --extra-tests options).
+# Note that network tests defined in the bb-services file are automatically
+# included.
+# The format here is "COLUMN=RRDSERVICE". If you leave out the "=RRDSERVICE"
+# part, it is assumed to be the same as the COLUMN value.
+#
+# This is also used by the bb-hostsvc.cgi script to determine if the detailed
+# status view of a test should include a graph.
+TEST2RRD="cpu=la,disk,inode,qtree,memory,$PINGCOLUMN=tcp,http=tcp,dns=tcp,dig=tcp,time=ntpstat,vmstat,iostat,netstat,temperature,apache,bind,sendmail,mailq,nmailq=mailq,socks,bea,iishealth,citrix,bbgen,bbtest,bbproxy,hobbitd,files,procs=processes,ports,clock,lines,ops,stats,cifs,JVM,JMS,HitCache,Session,JDBCConn,ExecQueue,JTA,TblSpace,RollBack,MemReq,InvObj,snapmirr,snaplist,snapshot,if_load=devmon,temp=devmon"
+
+# This defines which RRD files to include on the "trends" column webpage,
+# and the order in which they appear.
+GRAPHS="la,disk,inode,qtree,files,processes,memory,users,vmstat,iostat,tcp.http,tcp,ncv,netstat,ifstat,mrtg::1,ports,temperature,ntpstat,apache,bind,sendmail,mailq,socks,bea,iishealth,citrix,bbgen,bbtest,bbproxy,hobbitd,clock,lines,ops,stats,cifs,JVM,JMS,HitCache,Session,JDBCConn,ExecQueue,JTA,TblSpace,RollBack,MemReq,InvObj,snapmirr,snaplist,snapshot,devmon::1,if_load::1,temp"
+
+# These two settings can be used to restrict what filesystems are being
+# tracked (i.e. have their utilisation graphed) by Xymon.
+# NORRDDISKS="" # Filesystems that will NOT be tracked
+# RRDDISKS="" # Only track these filesystems
+
+
+############################################################
+# These determine some parts of how bbgen generates webpages
+############################################################
+BBGENOPTS="--recentgifs --subpagecolumns=2" # Standard options for bbgen.
+SUMMARY_SET_BKG="FALSE" # Do summaries affect the background color of the BB webpage ?
+BBMKBB2EXT="eventlog.sh acklog.sh" # What extensions to have on the BB2 page.
+DOTHEIGHT="16" # Height (in pixels) of the color GIF's
+DOTWIDTH="16" # Width (in pixels) of the color GIF's
+COLUMNDOCURL="$CGIBINURL/hobbitcolumn.sh?%s" # URL formatting string for column-links
+
+# HTML content
+HTMLCONTENTTYPE="text/html" # You can add charset options here.
+
+# Fonts and texts
+HOBBITLOGO="Mageia monitoring" # HTML inserted on all header pages at top-left corner.
+MKBBLOCAL="<B><I>Pages Hosted Locally</I></B>"
+MKBBREMOTE="<B><I>Remote Status Display</I></B>"
+MKBBSUBLOCAL="<B><I>Subpages Hosted Locally</I></B>"
+MKBBACKFONT="COLOR=\"#33ebf4\" SIZE=\"-1\"" # Size and color of the 'Current acknowledgement...' text in the html log.
+MKBBCOLFONT="COLOR=\"#87a9e5\" SIZE=\"-1\"" # Size and color of the column headings text
+MKBBROWFONT="SIZE=\"+1\" COLOR=\"#FFFFCC\" FACE=\"Tahoma, Arial, Helvetica\"" # Size,color,font of text in each row (hostname)
+MKBBTITLE="COLOR=\"#FFFFF0\" SIZE=\"+1\"" # Size and color of the BB titles (the old "ivory" is invalid HTML)
+BBDATEFORMAT="%a %b %d %H:%M:%S %Y" # Date format
+BBRSSTITLE="Xymon Alerts" # Title for the RSS and WML outputs.
+ACKUNTILMSG="Next update at: %H:%M %Y-%m-%d" # strftime format for the acknowledgement status display.
+
+# For WML output
+WMLMAXCHARS="1500" # Max number of bytes in a WAP message
+
+# For BB reports
+BBREPWARN="97" # Default availability causing yellow status on availability report.
+BBREPGREEN="99.995" # Default availability causing green status on availability report.
+BBGENREPOPTS="$BBGENOPTS" # bbgen(1) options used when generating availability reports.
+BBREPEXT="" # What extensions to run on report pages.
+
+# For BB snapshots
+BBGENSNAPOPTS="$BBGENOPTS" # bbgen(1) options used when generating snapshots.
+
+# For the bb-hist CGI
+BBHISTEXT="" # What extensions to run on history pages.
+
+
+# The following defines a bunch of commands that BB extensions expect to be present.
+# Hobbit does not use them, but they are provided here so if you use BB extension
+# scripts, then they will hopefully run without having to do a lot of tweaking.
+
+UPTIME="/usr/bin/uptime"
+AWK="/usr/bin/awk"
+CAT="/bin/cat"
+CP="/bin/cp"
+CUT="/usr/bin/cut"
+DATE="/bin/date"
+EGREP="/bin/egrep"
+EXPR="/usr/bin/expr"
+FIND="/usr/bin/find"
+GREP="/bin/grep"
+HEAD="/usr/bin/head"
+ID="/bin/id"
+LN="/bin/ln"
+LS="/bin/ls"
+MV="/bin/mv"
+RM="/bin/rm"
+SED="/bin/sed"
+SORT="/bin/sort"
+TAIL="/usr/bin/tail"
+TOP="/usr/bin/top"
+TOUCH="/bin/touch"
+TR="/usr/bin/tr"
+UNIQ="/usr/bin/uniq"
+WHO="/usr/bin/who"
+WC="/usr/bin/wc -l"
+WCC="/usr/bin/wc"
+# DF,DFCMD and PS are for compatibility only, NOT USED by the Hobbit client
+DF="/bin/df -Pk"
+DFCMD="/bin/df -Pk"
+PS="ps ax"
+
+MAXLINE="32768"