forked from dinuschen/fetchlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetchlog.cfg
executable file
·47 lines (42 loc) · 1.9 KB
/
fetchlog.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
##########################################################################
#
# fetchlog.cfg -- check commands for fetchlog services
#
# copy this file to .../plugins/config/ or append the contents to commands.cfg
#
# (C) 2010 Alexander Haderer
#
# cvs: $Id: fetchlog.cfg,v 1.2 2010/06/21 18:52:34 afrika Exp $
#
##########################################################################
# check local logfile using single line format
# with: ARG 1 abssolute path to monitored logfle
# ARG 2 column number from where on to read the messages from ARG 1
# ARG 3 column number up to read the messages from ARG 1
# ARG 4 filename bookmark file, for example: syslog_kernel, syslog_ntp
# ARG 5 optional: regex patterns
define command{
command_name check_fetchlog
command_line /usr/bin/fetchlog -F $ARG2$:$ARG3$:330:snob $ARG1$ /tmp/$ARG4$.bm $ARG5$
}
# check local logfile using multiline format
# with: ARG 1 abssolute path to monitored logfle
# ARG 2 column number from where on to read the messages from ARG 1
# ARG 3 column number up to read the messages from ARG 1
# ARG 4 filename bookmark file, for example: syslog_kernel, syslog_ntp
# ARG 5 optional: regex patterns
define command{
command_name check_fetchlog_ml
command_line /usr/bin/fetchlog -F $ARG2$:$ARG3$:2000:3snob $ARG1$ /tmp/$ARG4$.bm $ARG5$
}
# check remote logfile via snmp + fetchlog
# we ask for STRING because new snmp sends this back and we do exact match
# .1.3.6.1.4.1.2021.8.1.101.X: Xth exec command of snmpd: fetchlog in fetch mode
#
# with: ARG 1 SNMP secret
# ARG 2 number snmpd's exec command bound to a fetchlog call (1..N)
# ARG 3 Label for nagios message (e.g. 'syslog', 'kernel', ... )
define command{
command_name check_fetchlog_snmp
command_line $USER1$/check_snmp -m ALL -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.2021.8.1.101.$ARG2$ -s 'OK: no messages' -l $ARG3$ -t 30
}