From: Florian G. <re...@us...> - 2007-06-06 09:53:16
|
Update of /cvsroot/perfparse/_perfparse/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29306/modules Modified Files: storage_gnuplot.c storage_mysql.c storage_socket_output.c Log Message: enhance error logging Index: storage_socket_output.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/modules/storage_socket_output.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** storage_socket_output.c 26 Sep 2005 14:36:33 -0000 1.1.1.1 --- storage_socket_output.c 6 Jun 2007 09:53:14 -0000 1.2 *************** *** 3,8 **** * storage_print.c - Parse Nagios data and store in relational database. * ! * Copyright (c) 2004 Yves Mettier (yme...@li...) ! * Last Modified: 2004-09-01 * * License: --- 3,9 ---- * storage_print.c - Parse Nagios data and store in relational database. * ! * Copyright (c) 2004-2007 Yves Mettier (yme...@li...) ! * Florian Gleixner ! * Last Modified: $Id$ * * License: *************** *** 53,57 **** write(socket_id, "\n", 1); } else { ! pp_log(__FILE__,__LINE__, _("Socket not connected")); return(-1); } --- 54,58 ---- write(socket_id, "\n", 1); } else { ! pp_log(__FILE__,__LINE__, LOG_ERROR,_("Socket not connected")); return(-1); } *************** *** 70,74 **** tmp = malloc(sizeof(char)*l); if(NULL == tmp) { ! pp_log(__FILE__,__LINE__, _("Not enough memory")); exit(EXIT_FAILURE); } --- 71,75 ---- tmp = malloc(sizeof(char)*l); if(NULL == tmp) { ! pp_log(__FILE__,__LINE__, LOG_ERROR,_("Not enough memory")); exit(EXIT_FAILURE); } *************** *** 77,81 **** free(tmp); } else { ! pp_log(__FILE__,__LINE__, _("Socket not connected")); return(-1); } --- 78,82 ---- free(tmp); } else { ! pp_log(__FILE__,__LINE__, LOG_ERROR,_("Socket not connected")); return(-1); } *************** *** 99,103 **** if(sig == SIGPIPE) { socket_close(); ! pp_log(__FILE__,__LINE__, _("Connection break (SIGPIPE caught)")); } } --- 100,104 ---- if(sig == SIGPIPE) { socket_close(); ! pp_log(__FILE__,__LINE__, LOG_ERROR,_("Connection break (SIGPIPE caught)")); } } *************** *** 125,129 **** if ((address = gethostbyname (host)) == NULL) { ! pp_log(__FILE__,__LINE__, _("Could not find host '%s'. Plugin storage_socket_output disabled"), host); this->enabled=0; socket_id = -1; --- 126,130 ---- if ((address = gethostbyname (host)) == NULL) { ! pp_log(__FILE__,__LINE__, LOG_ERROR,_("Could not find host '%s'. Plugin storage_socket_output disabled"), host); this->enabled=0; socket_id = -1; *************** *** 137,141 **** if ((socket_id = socket (AF_INET, SOCK_STREAM, 6)) == -1) { ! pp_log(__FILE__,__LINE__, _("Could not create a new socket to host '%s'. Plugin storage_socket_output disabled"), host); this->enabled=0; socket_id = -1; --- 138,142 ---- if ((socket_id = socket (AF_INET, SOCK_STREAM, 6)) == -1) { ! pp_log(__FILE__,__LINE__, LOG_ERROR,_("Could not create a new socket to host '%s'. Plugin storage_socket_output disabled"), host); this->enabled=0; socket_id = -1; *************** *** 147,151 **** if ((client_sockaddr_in = malloc (sizeof (struct sockaddr_in))) == NULL) { ! pp_log(__FILE__,__LINE__, _("Could not allocate memory for new socket to host '%s'. Plugin storage_socket_output disabled"), host); this->enabled=0; socket_id = -1; --- 148,152 ---- if ((client_sockaddr_in = malloc (sizeof (struct sockaddr_in))) == NULL) { ! pp_log(__FILE__,__LINE__, LOG_ERROR,_("Could not allocate memory for new socket to host '%s'. Plugin storage_socket_output disabled"), host); this->enabled=0; socket_id = -1; *************** *** 170,174 **** { free (client_sockaddr_in); ! pp_log(__FILE__,__LINE__, _("Could not connect the socket to the server '%s'. Plugin storage_socket_output disabled"), host); this->enabled=0; socket_id = -1; --- 171,175 ---- { free (client_sockaddr_in); ! pp_log(__FILE__,__LINE__, LOG_ERROR,_("Could not connect the socket to the server '%s'. Plugin storage_socket_output disabled"), host); this->enabled=0; socket_id = -1; Index: storage_gnuplot.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/modules/storage_gnuplot.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** storage_gnuplot.c 26 Sep 2005 14:36:33 -0000 1.1.1.1 --- storage_gnuplot.c 6 Jun 2007 09:53:14 -0000 1.2 *************** *** 3,8 **** * storage_gnuplot.c - Parse Nagios data and store in relational database. * ! * Copyright (c) 2005 Yves Mettier (yme...@li...) ! * Last Modified: 2005-01-06 * * License: --- 3,9 ---- * storage_gnuplot.c - Parse Nagios data and store in relational database. * ! * Copyright (c) 2005-2007 Yves Mettier (yme...@li...) ! * Florian Gleixner ! * Last Modified: $Id$ * * License: *************** *** 68,72 **** char*filename = config_get_value_as_string(CONFIG_ITEM_ID_STORAGE_GNUPLOT_OUTPUT_FILE); if(! filename[0]) { ! pp_log(__FILE__,__LINE__, _("Empty file name for gnuplot output")); this->enabled = 0; return(-1); --- 69,73 ---- char*filename = config_get_value_as_string(CONFIG_ITEM_ID_STORAGE_GNUPLOT_OUTPUT_FILE); if(! filename[0]) { ! pp_log(__FILE__,__LINE__,LOG_ERROR, _("Empty file name for gnuplot output")); this->enabled = 0; return(-1); *************** *** 76,80 **** if(log_fd == NULL) { ! pp_log(__FILE__,__LINE__, _("Could not create file '%s' (errno=%s)"), filename,strerror(errno)); this->enabled = 0; return(-1); --- 77,81 ---- if(log_fd == NULL) { ! pp_log(__FILE__,__LINE__,LOG_ERROR, _("Could not create file '%s' (errno=%s)"), filename,strerror(errno)); this->enabled = 0; return(-1); Index: storage_mysql.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/modules/storage_mysql.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** storage_mysql.c 1 Jun 2007 08:51:05 -0000 1.12 --- storage_mysql.c 6 Jun 2007 09:53:14 -0000 1.13 *************** *** 111,117 **** int storage_mysql_connect(struct storage_module_t *this) { ! if(NULL == this->params) {pp_log(__FILE__,__LINE__,_("Malloc failed")); exit(EXIT_FAILURE); } MYSQL_USER_PARAMS(this->params)->statistics = malloc(sizeof(mysql_statistics_t)); ! if(NULL == MYSQL_USER_PARAMS(this->params)->statistics) {pp_log(__FILE__,__LINE__,_("Malloc failed")); exit(EXIT_FAILURE); } MYSQL_USER_PARAMS(this->params)->statistics->iAddedHost = 0; MYSQL_USER_PARAMS(this->params)->statistics->iAddedService = 0; --- 111,117 ---- int storage_mysql_connect(struct storage_module_t *this) { ! if(NULL == this->params) {pp_log(__FILE__,__LINE__,LOG_ERROR,_("Malloc failed")); exit(EXIT_FAILURE); } MYSQL_USER_PARAMS(this->params)->statistics = malloc(sizeof(mysql_statistics_t)); ! if(NULL == MYSQL_USER_PARAMS(this->params)->statistics) {pp_log(__FILE__,__LINE__,LOG_ERROR,_("Malloc failed")); exit(EXIT_FAILURE); } MYSQL_USER_PARAMS(this->params)->statistics->iAddedHost = 0; MYSQL_USER_PARAMS(this->params)->statistics->iAddedService = 0; *************** *** 143,147 **** gchar *str = db_version_error(); this->enabled = 0; ! pp_log(__FILE__, __LINE__, "%s", str); g_free(str); exit(EXIT_FAILURE); --- 143,147 ---- gchar *str = db_version_error(); this->enabled = 0; ! pp_log(__FILE__, __LINE__,LOG_ERROR, "%s", str); g_free(str); exit(EXIT_FAILURE); |