projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
novi upstream verzije 2.8.3
[ossec-hids.git]
/
src
/
monitord
/
monitord.c
diff --git
a/src/monitord/monitord.c
b/src/monitord/monitord.c
index
b68d984
..
8ae5c93
100755
(executable)
--- a/
src/monitord/monitord.c
+++ b/
src/monitord/monitord.c
@@
-1,11
+1,12
@@
-/* @(#) $Id: monitord.c,v 1.9 2009/06/24 17:06:27 dcid Exp $ */
+/* @(#) $Id: ./src/monitord/monitord.c, 2011/09/08 dcid Exp $
+ */
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
* This program is a free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
* This program is a free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
- * License (version 3) as published by the FSF - Free Software
+ * License (version 2) as published by the FSF - Free Software
* Foundation
*/
* Foundation
*/
@@
-18,10
+19,10
@@
/* Real monitord global */
void Monitord()
{
/* Real monitord global */
void Monitord()
{
- time_t tm;
- struct tm *p;
+ time_t tm;
+ struct tm *p;
- int today = 0;
+ int today = 0;
int thismonth = 0;
int thisyear = 0;
int thismonth = 0;
int thisyear = 0;
@@
-31,18
+32,18
@@
void Monitord()
sleep(10);
memset(str, '\0', OS_SIZE_1024 +1);
sleep(10);
memset(str, '\0', OS_SIZE_1024 +1);
-
-
+
+
/* Getting currently time before starting */
tm = time(NULL);
p = localtime(&tm);
/* Getting currently time before starting */
tm = time(NULL);
p = localtime(&tm);
-
+
today = p->tm_mday;
thismonth = p->tm_mon;
thisyear = p->tm_year+1900;
today = p->tm_mday;
thismonth = p->tm_mon;
thisyear = p->tm_year+1900;
-
-
+
+
/* Connecting to the message queue
* Exit if it fails.
*/
/* Connecting to the message queue
* Exit if it fails.
*/
@@
-60,7
+61,7
@@
void Monitord()
merror(QUEUE_SEND, ARGV0);
}
merror(QUEUE_SEND, ARGV0);
}
-
+
/* Main monitor loop */
while(1)
{
/* Main monitor loop */
while(1)
{
@@
-73,10
+74,13
@@
void Monitord()
{
monitor_agents();
}
{
monitor_agents();
}
-
+
/* Day changed, deal with log files */
if(today != p->tm_mday)
{
/* Day changed, deal with log files */
if(today != p->tm_mday)
{
+ /* Generate reports. */
+ generate_reports(today, thismonth, thisyear, p);
+
manage_files(today, thismonth, thisyear);
today = p->tm_mday;
manage_files(today, thismonth, thisyear);
today = p->tm_mday;