X-Git-Url: http://www.andromeda.nl/gitweb/?a=blobdiff_plain;f=src%2Fgcm_input%2Fgcm_input.cpp;h=bcce2e84d8e9dc6364ba14c8dc0d0afd529de74e;hb=05a6ba0ae590f5a623fb1705420cdb3402f72891;hp=b1c50e67b8314e6090f414d14c3e9b62e607d81a;hpb=5595661037a8922a8ba639720fbe45a1550fd021;p=gnucomo.git diff --git a/src/gcm_input/gcm_input.cpp b/src/gcm_input/gcm_input.cpp index b1c50e6..bcce2e8 100644 --- a/src/gcm_input/gcm_input.cpp +++ b/src/gcm_input/gcm_input.cpp @@ -7,7 +7,7 @@ *********************** ** FILE NAME : gcm_input.cpp ** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring -** VERSION NUMBER : $Revision: 1.13 $ +** VERSION NUMBER : $Revision: 1.14 $ ** ** DESCRIPTION : Application to store client messages into the database ** The client message contains a log file from one of the @@ -54,7 +54,12 @@ /***************************** $Log: gcm_input.cpp,v $ - Revision 1.13 2003-12-22 10:20:21 arjen + Revision 1.14 2007-11-03 10:26:13 arjen + Added a new filter which can directly read the output + of the UNIX df command. A brief description is added in + the user manual. + + Revision 1.13 2003/12/22 10:20:21 arjen Report if the message type can not be detected. Revision 1.12 2003/12/04 10:38:09 arjen @@ -113,7 +118,7 @@ *****************************/ -static const char *RCSID = "$Id: gcm_input.cpp,v 1.13 2003-12-22 10:20:21 arjen Exp $"; +static const char *RCSID = "$Id: gcm_input.cpp,v 1.14 2007-11-03 10:26:13 arjen Exp $"; #include @@ -122,6 +127,7 @@ static const char *RCSID = "$Id: gcm_input.cpp,v 1.13 2003-12-22 10:20:21 arjen #include "message.h" #include "log_filter.h" #include "rpm_filter.h" +#include "df_filter.h" #include "xml_cooker.h" #include "syslog_cooker.h" @@ -134,7 +140,7 @@ bool testmode = false; bool incremental = false; std::ostream *Log = &std::cerr; -static char *Version = "gcm_input version 0.0.9 - Dec 22, 2003"; +static char *Version = "gcm_input version 0.0.11 - Nov 22, 2007"; /*========================================================================= @@ -272,9 +278,12 @@ int main(int argc, char *argv[]) client_message msg(&std::cin, db); + double message_probability; + message_filter shortcircuit(hostname, arrival, service); log_filter lf(hostname, arrival, service); rpm_filter rf(hostname, arrival, service); + df_filter df(hostname, arrival, service); syslog_cooker slc; irix_syslog_cooker islc; @@ -282,6 +291,7 @@ int main(int argc, char *argv[]) error_cooker elc; xml_cooker xlc; rpm_cooker rlc; + df_cooker dlc; msg.add_cooker(&xlc, &shortcircuit); msg.add_cooker(&slc, &lf); @@ -289,8 +299,11 @@ int main(int argc, char *argv[]) msg.add_cooker(&alc, &lf); msg.add_cooker(&elc, &lf); msg.add_cooker(&rlc, &rf); + msg.add_cooker(&dlc, &df); - if (msg.classify(hostname, arrival, service) > 0.9) + message_probability = msg.classify(hostname, arrival, service); + *Log << "Message type probability = " << message_probability << "\n"; + if (message_probability > 0.75) { try {