import torrus 1.0.9
[freeside.git] / torrus / xmlconfig / examples / monitors.xml
1 <?xml version="1.0"?>
2 <!--
3    Copyright (C) 2002  Stanislav Sinyagin
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18
19   $Id: monitors.xml,v 1.1 2010-12-27 00:04:29 ivan Exp $
20   Stanislav Sinyagin <ssinyagin@yahoo.com>
21
22 -->
23
24 <!--
25   These examples show how monitors can be built in Torrus and used together
26   with your data.
27  -->
28
29 <configuration>
30
31 <token-sets>
32
33   <token-set name="jumps">
34     <param name="comment" value="Traffic rate jumps" />
35   </token-set>
36
37   <token-set name="hw-failures">
38     <param name="comment" value="Holt-Winters prediction failures" />
39   </token-set>
40
41   <token-set name="devel">
42     <param name="comment"
43            value="Torrus development and testing" />
44   </token-set>
45
46 </token-sets>
47
48 <monitors>
49
50   <!-- First define the actions -->
51
52   <!-- This action will put the graphs of alarmed datasources in
53        a single alarm report page -->
54   <action name="graph-hw-failures">
55     <param name="action-type" value="tset" />
56     <param name="tset-name" value="hw-failures" />
57   </action>
58
59   <action name="graph-jumps">
60     <param name="action-type" value="tset" />
61     <param name="tset-name" value="jumps" />
62   </action>
63
64   <action name="graph-devel">
65     <param name="action-type" value="tset" />
66     <param name="tset-name" value="devel" />
67   </action>
68
69   <action name="report-file">
70     <param name="action-type" value="exec" />
71     <param name="command">
72       echo `date '+%d-%b-%Y %H:%M:%S'` \
73       $TORRUS_MONITOR $TORRUS_EVENT $TORRUS_NODEPATH \
74       &gt;&gt; /tmp/torrus-events
75     </param>
76     <param name="launch-when" value="set, repeat, clear, forget" />
77   </action>
78
79   <action name="snmptrap">
80     <param name="action-type" value="exec" />
81     <param name="command" value="$TORRUS_HOME/bin/action_snmptrap" />
82     <param name="launch-when" value="set, clear" />
83   </action>
84
85   <action name="report-email">
86     <param name="action-type" value="exec" />
87     <param name="command">
88       $TORRUS_HOME/bin/action_printemail | mail ssinyagin@yahoo.com
89     </param>
90     <param name="launch-when" value="set, clear" />
91   </action>
92
93   <monitor name="hw-failures">
94     <param name="monitor-type" value="failures" />
95     <param name="action"
96            value="graph-hw-failures, report-file" />
97     <param name="expires" value="21600" />
98     <param name="comment"
99            value="Holt-Winters prediction failures" />
100   </monitor>
101
102   <monitor name="strict-maximum">
103     <param name="monitor-type" value="expression" />
104     <param name="rpn-expr">
105       #max,GT
106     </param>
107     <param name="action" value="report-email" />
108     <param name="expires" value="3600" />
109     <param name="comment"
110            value="Value is more than specified maximum" />
111   </monitor>
112
113   <monitor name="strict-minimum">
114     <param name="monitor-type" value="expression" />
115     <param name="rpn-expr">
116       #min,LT
117     </param>
118     <param name="action" value="report-email" />
119     <param name="expires" value="3600" />
120     <param name="comment"
121            value="Value is less than specified minimum" />
122   </monitor>
123
124   <monitor name="high-jumps">
125     <param name="monitor-type" value="expression" />
126     <param name="rpn-expr">
127       {(LAST-300)},10,*,GT,
128       {(LAST)},{(LAST-300)},10,/,LT,
129       OR,
130       {T@(LAST)},3600,+,NOW,GE,
131       AND
132     </param>
133     <param name="action" value="graph-jumps, report-file" />
134     <param name="expires" value="3600" />
135     <param name="comment"
136            value="Value jumped more than 10-fold in 5 minutes" />
137   </monitor>
138
139   <monitor name="mon-devel">
140     <param name="monitor-type" value="expression" />
141     <param name="rpn-expr">
142       {(LAST-600)},-,ABS,10485760,GT,
143       {T@(LAST)},3600,+,NOW,GE,
144       AND
145     </param>
146     <param name="action">
147       graph-devel, report-file, snmptrap
148     </param>
149     <param name="expires" value="900" />
150     <param name="comment"
151            value="Traffic jumps more than 10mbps in 10 minutes" />
152   </monitor>
153
154 </monitors>
155
156 </configuration>