1 |
+ |
/* |
2 |
+ |
* i-scream central monitoring system |
3 |
+ |
* http://www.i-scream.org.uk |
4 |
+ |
* Copyright (C) 2000-2002 i-scream |
5 |
+ |
* |
6 |
+ |
* This program is free software; you can redistribute it and/or |
7 |
+ |
* modify it under the terms of the GNU General Public License |
8 |
+ |
* as published by the Free Software Foundation; either version 2 |
9 |
+ |
* of the License, or (at your option) any later version. |
10 |
+ |
* |
11 |
+ |
* This program is distributed in the hope that it will be useful, |
12 |
+ |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
+ |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
+ |
* GNU General Public License for more details. |
15 |
+ |
* |
16 |
+ |
* You should have received a copy of the GNU General Public License |
17 |
+ |
* along with this program; if not, write to the Free Software |
18 |
+ |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 |
+ |
*/ |
20 |
+ |
|
21 |
|
#include <iostream.h> |
22 |
|
#include <unistd.h> // linux header for the sleep function |
23 |
|
#include <stdlib.h> // itoa() |
84 |
|
if ( debug == 1 ){ |
85 |
|
std::cout << "Using Default Tolerance\n"; |
86 |
|
} // if |
87 |
< |
MaxFilterRetrys = 5; |
87 |
> |
MaxFilterRetrys = 1; |
88 |
|
} // if |
89 |
|
|
90 |
|
|
91 |
< |
std::cout << "Configuring Alerter\n"; |
91 |
> |
// std::cout << "Configuring Alerter\n"; |
92 |
|
// Set the values at which the Alerter should kick in. and how many packets it should |
93 |
|
// send |
94 |
|
|
226 |
|
nextUDPTime = localTime + UDPUpdateTime; |
227 |
|
// package up the system data |
228 |
|
string host = config.getFQDN(); |
229 |
< |
string ip = (config.getSmallNet())->getHostIP(); |
229 |
> |
// string ip = (config.getSmallNet())->getHostIP(); |
230 |
|
|
231 |
|
string seq = ""; |
232 |
|
// char * buffer; |
236 |
|
string date = ""; |
237 |
|
sprintf(buffer,"%u", localTime); |
238 |
|
date = buffer; |
239 |
< |
string attributes = "type=\"data\" machine_name=\""+host+"\" date=\""+date+"\" seq_no=\""+seq+"\""; |
239 |
> |
string attributes = "type=\"data\" machine_name=\""+host+"\" ip=\"0.0.0.0\" date=\""+date+"\" seq_no=\""+seq+"\""; |
240 |
|
|
241 |
|
XMLFormatter xml("packet",attributes); |
242 |
|
// put in the data |