nagios-db-devel Mailing List for Nagios-DB (Page 4)
Status: Beta
Brought to you by:
bench23
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(62) |
Feb
(9) |
Mar
(27) |
Apr
(9) |
May
(17) |
Jun
|
Jul
(7) |
Aug
(11) |
Sep
(5) |
Oct
|
Nov
(7) |
Dec
|
2006 |
Jan
|
Feb
(2) |
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ben <be...@si...> - 2005-03-11 06:54:15
|
Excellent, glad you find it useful. On Mar 10, 2005, at 10:51 PM, Robert Bilbrey wrote: > That was it, don't know how it ever worked in the first place. I > should be able to take it from here. Thanks for the help. This is the > relevant nagios.log entry: > [1110523507] Nagios 2.0b2 starting... (PID=9223) > [1110523507] LOG VERSION: 2.0 > [1110523507] initializing nagios-db postgres inserter... > [1110523507] nagios-db: inserter failed to establish postgres > connection (fe_sendauth: no password supplied > ) > [1110523507] Event broker module '/usr/local/nagios/bin/inserter.o' > initialized successfully. > > Ben wrote: >> Ok, so it turns out I apparently can't read documentation. I bet the >> problem is that you aren't successfully connecting to your database. >> Have you checked your permissions? Or, better yet, your postgres >> logs? >> I'm not in a place where I can try this out, so give it a shot. If it >> passes the compile test, then I'll check it in. If we're lucky, it >> might even tell you what's wrong. :) >> ---------------------------------------------------------------------- >> -- >> #ifndef NSCORE >> #define NSCORE >> #endif >> /* we need this for postgres support */ >> #include "libpq-fe.h" >> /* include the needed event broker header files */ >> #include "../include/nebmodules.h" >> #include "../include/nebcallbacks.h" >> #include "../include/nebstructs.h" >> #include "../include/broker.h" >> /* include some Nagios stuff as well */ >> #include "../include/config.h" >> #include "../include/common.h" >> #include "../include/nagios.h" >> #include "../include/objects.h" >> #include <sys/types.h> >> #include <string.h> >> #include <stdlib.h> >> #define UNIX_PATH_MAX 108 >> /* specify event broker API version (required) */ >> NEB_API_VERSION(CURRENT_NEB_API_VERSION); >> #define BUFFER_ALLOC_SIZE 1024 >> #define NULL_STRING(x) (x?:"null") >> #define BOOLIFY_STRING(x) (x?"TRUE":"FALSE") >> #define FIRST_COMMAND_NUM NEBCALLBACK_PROCESS_DATA >> char * querify(char * src); >> extern hostgroup *hostgroup_list; >> extern servicegroup *servicegroup_list; >> extern host *host_list; >> extern service *service_list; >> extern int enable_flap_detection; >> extern int enable_notifications; >> extern int enable_event_handlers; >> extern int execute_service_checks; >> extern int execute_host_checks; >> extern int accept_passive_service_checks; >> extern int accept_passive_host_checks; >> static int processStart(int, void *); >> static int processStatus(int, void *); >> static int processCheck(int, void *); >> PGconn * pgconn = 0; >> /* this function gets called when the module is loaded by the event >> broker */ >> int nebmodule_init(int flags, char *args, nebmodule *handle) >> { >> write_to_all_logs("initializing nagios-db postgres >> inserter...",NSLOG_INFO_MESSAGE); >> if(!(pgconn = PQconnectdb("host=meatshake port=5432 dbname=nag >> user=postgres"))) >> { >> /* couldn't connect; this will be useless. */ >> write_to_all_logs("nagios-db: inserter failed to allocate postgres >> connection",NSLOG_INFO_MESSAGE); >> } >> else >> { >> if(CONNECTION_OK != PQstatus(pgconn)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: inserter failed to establish >> postgres connection (%s)",PQerrorMessage(pgconn)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> else >> write_to_all_logs("nagios-db: inserter locked into >> db",NSLOG_INFO_MESSAGE); >> } >> neb_register_callback(NEBCALLBACK_TIMED_EVENT_DATA, 0, processStart); >> return 0; >> } >> /* this function gets called when the module is unoaded by the event >> broker */ >> int nebmodule_deinit(int flags, int reason) >> { >> /* log a message to the Nagios log file */ >> write_to_all_logs("nagios-db: inserter >> unloading...",NSLOG_INFO_MESSAGE); >> PQfinish(pgconn); >> neb_deregister_callback(NEBCALLBACK_HOST_STATUS_DATA, processStatus); >> neb_deregister_callback(NEBCALLBACK_SERVICE_STATUS_DATA, >> processStatus); >> neb_deregister_callback(NEBCALLBACK_HOST_CHECK_DATA, processCheck); >> neb_deregister_callback(NEBCALLBACK_SERVICE_CHECK_DATA, >> processCheck); >> pgconn = 0; >> return 0; >> } >> /* helper function to make a string ready for inclusion into a sql >> query */ >> char * >> querify(char * src) >> { >> char * ret = 0; >> if(src) >> { >> int size = 2*strlen(src) + 3; /* +3 because we want to surround >> strings with single quotes, and we still need a null */ >> int written = 0; >> if(!(ret = malloc(size))) >> { >> return 0; >> } >> ret[0] = '\''; >> written = PQescapeString(ret+1, src, strlen(src)); >> ret[written + 1] = '\''; >> ret[written + 2] = 0; >> } >> return ret; >> } >> /* when Nagios starts up, we'll want to replicate configuration data >> into the database */ >> static int processStart(int cmd, void * data) >> { >> host *hl = 0; >> service *sl = 0; >> hostgroup *hg = 0; >> PGresult *res = 0; >> int groupcount = 0; >> char q[2048]; >> /* verify that we're dealing with the right kind of message. */ >> if(cmd != NEBCALLBACK_TIMED_EVENT_DATA) return 0; >> /* verify that our config data has been initialized. */ >> if(((nebstruct_timed_event_data*)data)->type != >> NEBTYPE_TIMEDEVENT_ADD) return 0; >> /* Clear out the previous config info.... */ >> res = PQexec(pgconn,"select empty_config()"); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't clear config info >> (%s)", PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> PQclear(res); >> /* .... and insert new config info. Start with the hosts. */ >> for(groupcount=0, hl = host_list; hl; hl = hl->next) >> { >> /* update this host */ >> char *hostName = querify(hl->name); >> snprintf(q,sizeof(q),"select >> configure_host(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)", >> NULL_STRING(hostName), >> BOOLIFY_STRING(hl->checks_enabled), >> BOOLIFY_STRING(hl->accept_passive_host_checks), >> BOOLIFY_STRING(hl->event_handler_enabled), >> BOOLIFY_STRING(hl->flap_detection_enabled), >> BOOLIFY_STRING(hl->notifications_enabled), >> BOOLIFY_STRING(hl->failure_prediction_enabled), >> BOOLIFY_STRING(hl->process_performance_data), >> BOOLIFY_STRING(hl->obsess_over_host), >> BOOLIFY_STRING(hl->should_be_scheduled)); >> if(hostName) free(hostName); >> res = PQexec(pgconn,q); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't configure host using >> '%s' (%s)", q, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> PQclear(res); >> groupcount++; >> } >> snprintf(q,sizeof(q),"nagios-db: configured %d hosts", groupcount); >> write_to_all_logs(q,NSLOG_INFO_MESSAGE); >> /* add hostgroup membership */ >> for(groupcount=0, hg=hostgroup_list; hg ; hg = hg->next) >> { >> hostgroupmember *hgm = 0; >> char *groupName, *groupAlias, *hostName; >> unsigned long groupid = 0; >> /* insert this hostgroup */ >> groupName = querify(hg->group_name); >> groupAlias = querify(hg->alias); >> snprintf(q,sizeof(q),"select new_hostgroup(%s,%s)", >> NULL_STRING(groupName), NULL_STRING(groupAlias)); >> if(groupName) free(groupName); >> if(groupAlias) free(groupAlias); >> res = PQexec(pgconn,q); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't configure hostgroup >> using '%s' (%s)", q, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> groupid = atol(PQgetvalue(res,0,0)); >> PQclear(res); >> for(hgm = hg->members; hgm; hgm = hgm->next) >> { >> /* add this host to the hostgroup */ >> hostName = querify(hgm->host_name); >> snprintf(q,sizeof(q),"select append_to_hostgroup(%lu,%s)", >> groupid, NULL_STRING(hostName)); >> if(hostName) free(hostName); >> res = PQexec(pgconn,q); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || >> PQresultStatus(res) == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't configure hostgroup >> membership using '%s' (%s)", q, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> PQclear(res); >> } >> groupcount++; >> } >> snprintf(q,sizeof(q),"nagios-db: loaded %d hostgroups", groupcount); >> write_to_all_logs(q,NSLOG_INFO_MESSAGE); >> /* mark all the configured services as such */ >> for(groupcount=0, sl = service_list; sl; sl = sl->next) >> { >> /* update this service */ >> char *hostName = querify(sl->host_name); >> char *serviceDesc = querify(sl->description); >> snprintf(q,sizeof(q),"select >> configure_service(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)", >> NULL_STRING(hostName), >> NULL_STRING(serviceDesc), >> BOOLIFY_STRING(sl->checks_enabled), >> BOOLIFY_STRING(sl->accept_passive_service_checks), >> BOOLIFY_STRING(sl->event_handler_enabled), >> BOOLIFY_STRING(sl->flap_detection_enabled), >> BOOLIFY_STRING(sl->notifications_enabled), >> BOOLIFY_STRING(sl->failure_prediction_enabled), >> BOOLIFY_STRING(sl->process_performance_data), >> BOOLIFY_STRING(sl->obsess_over_service), >> BOOLIFY_STRING(sl->should_be_scheduled)); >> if(hostName) free(hostName); >> if(serviceDesc) free(serviceDesc); >> res = PQexec(pgconn,q); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't configure service >> using '%s' (%s)", q, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> PQclear(res); >> >> groupcount++; >> } >> snprintf(q,sizeof(q),"nagios-db: set configured flag on %d >> services", groupcount); >> write_to_all_logs(q,NSLOG_INFO_MESSAGE); >> /* also insert various config parameters that we might want */ >> snprintf(q,sizeof(q),"select >> replace_config_param('accept_passive_host_checks',%d)",accept_passive_ >> host_checks); >> res = PQexec(pgconn,q); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", >> q, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> else >> { >> if(atoi(PQgetvalue(res,0,0)) < 0) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back >> %s", q, PQgetvalue(res,0,0)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> } >> PQclear(res); >> snprintf(q,sizeof(q),"select >> replace_config_param('execute_host_checks',%d)",execute_host_checks); >> res = PQexec(pgconn,q); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", >> q, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> else >> { >> if(atoi(PQgetvalue(res,0,0)) < 0) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back >> %s", q, PQgetvalue(res,0,0)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> } >> PQclear(res); >> snprintf(q,sizeof(q),"select >> replace_config_param('accept_passive_service_checks',%d)",accept_passi >> ve_service_checks); >> res = PQexec(pgconn,q); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", >> q, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> else >> { >> if(atoi(PQgetvalue(res,0,0)) < 0) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back >> %s", q, PQgetvalue(res,0,0)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> } >> PQclear(res); >> snprintf(q,sizeof(q),"select >> replace_config_param('execute_service_checks',%d)",execute_service_che >> cks); >> res = PQexec(pgconn,q); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", >> q, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> else >> { >> if(atoi(PQgetvalue(res,0,0)) < 0) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back >> %s", q, PQgetvalue(res,0,0)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> } >> PQclear(res); >> snprintf(q,sizeof(q),"select >> replace_config_param('enable_flap_detection',%d)",enable_flap_detectio >> n); >> res = PQexec(pgconn,q); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", >> q, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> else >> { >> if(atoi(PQgetvalue(res,0,0)) < 0) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back >> %s", q, PQgetvalue(res,0,0)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> } >> PQclear(res); >> snprintf(q,sizeof(q),"select >> replace_config_param('enable_notifications',%d)",enable_notifications) >> ; >> res = PQexec(pgconn,q); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", >> q, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> else >> { >> if(atoi(PQgetvalue(res,0,0)) < 0) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back >> %s", q, PQgetvalue(res,0,0)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> } >> PQclear(res); >> snprintf(q,sizeof(q),"select >> replace_config_param('enable_event_handlers',%d)",enable_event_handler >> s); >> res = PQexec(pgconn,q); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", >> q, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> else >> { >> if(atoi(PQgetvalue(res,0,0)) < 0) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back >> %s", q, PQgetvalue(res,0,0)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> } >> PQclear(res); >> write_to_all_logs("nagios-db: configuration complete. Registering >> for status notifications...",NSLOG_INFO_MESSAGE); >> neb_deregister_callback(NEBCALLBACK_TIMED_EVENT_DATA, processStart); >> neb_register_callback(NEBCALLBACK_HOST_STATUS_DATA, 0, >> processStatus); >> neb_register_callback(NEBCALLBACK_SERVICE_STATUS_DATA, 0, >> processStatus); >> neb_register_callback(NEBCALLBACK_HOST_CHECK_DATA, 0, processCheck); >> neb_register_callback(NEBCALLBACK_SERVICE_CHECK_DATA, 0, >> processCheck); >> return 0; >> } >> static int processCheck(int cmd, void * data) { >> PGresult *res; >> char temp_buffer[1024]; >> bzero(temp_buffer, sizeof(temp_buffer)); >> switch(cmd) { >> case NEBCALLBACK_HOST_CHECK_DATA: >> { >> nebstruct_host_check_data * host_check_data = >> (nebstruct_host_check_data *) data; >> if(host_check_data->type != NEBTYPE_HOSTCHECK_PROCESSED) return 0; >> char *safeName = querify(host_check_data->host_name); >> snprintf(temp_buffer, sizeof(temp_buffer), "select >> host_checked(%s)",NULL_STRING(safeName)); >> if(safeName) free(safeName); >> } >> break; >> case NEBCALLBACK_SERVICE_CHECK_DATA: >> { >> nebstruct_service_check_data * service_check_data = >> (nebstruct_service_check_data *) data; >> if(service_check_data->type != NEBTYPE_SERVICECHECK_PROCESSED) >> return 0; >> char *safeName = querify(service_check_data->host_name); >> char *safeServiceDescription = >> querify(service_check_data->service_description); >> snprintf(temp_buffer, sizeof(temp_buffer), "select >> service_checked(%s,%s)", NULL_STRING(safeName), >> NULL_STRING(safeServiceDescription)); >> if(safeName) free(safeName); >> if(safeServiceDescription) free(safeServiceDescription); >> } >> break; >> default: >> snprintf(temp_buffer,sizeof(temp_buffer),"nagios-db: processCheck >> ignoring unknown NEB command %i",cmd); >> write_to_all_logs(temp_buffer,NSLOG_INFO_MESSAGE); >> return 0; >> break; >> } >> res = PQexec(pgconn,temp_buffer); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", >> temp_buffer, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> else >> { >> if(atoi(PQgetvalue(res,0,0)) < 0) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back >> %s", temp_buffer, PQgetvalue(res,0,0)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> } >> PQclear(res); >> return 0; >> } >> static int processStatus(int cmd, void * data) { >> PGresult *res; >> char temp_buffer[5120]; >> service *tmp_service; >> host *tmp_host; >> bzero(temp_buffer, sizeof(temp_buffer)); >> switch(cmd) { >> case NEBCALLBACK_HOST_STATUS_DATA: >> { >> nebstruct_host_status_data * host_status_data = >> (nebstruct_host_status_data *) data; >> tmp_host = (host *) host_status_data->object_ptr; >> char *safeName = querify(tmp_host->name); >> char *safeEventHandler = querify(tmp_host->event_handler); >> char *safePluginOutput = querify(tmp_host->plugin_output); >> char *safeHostCheckCommand = querify(tmp_host->host_check_command); >> char *safePerfData = querify(tmp_host->perf_data); >> snprintf(temp_buffer, sizeof(temp_buffer), "select >> update_host(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%lu,%s,%s,%s,%d,%d,%s,%d,%s, >> %f,%f,%lu,%lu,%d,%lu,%lu,%s,%s,%d)", >> NULL_STRING(safeName), >> BOOLIFY_STRING(tmp_host->checks_enabled), >> BOOLIFY_STRING(tmp_host->accept_passive_host_checks), >> BOOLIFY_STRING(tmp_host->event_handler_enabled), >> BOOLIFY_STRING(tmp_host->flap_detection_enabled), >> BOOLIFY_STRING(tmp_host->notifications_enabled), >> BOOLIFY_STRING(tmp_host->failure_prediction_enabled), >> BOOLIFY_STRING(tmp_host->process_performance_data), >> BOOLIFY_STRING(tmp_host->obsess_over_host), >> NULL_STRING(safeEventHandler), >> tmp_host->modified_attributes, >> BOOLIFY_STRING(tmp_host->has_been_checked), >> BOOLIFY_STRING(tmp_host->should_be_scheduled), >> BOOLIFY_STRING(tmp_host->is_flapping), >> tmp_host->current_state, >> tmp_host->last_hard_state, >> NULL_STRING(safePluginOutput), >> tmp_host->current_attempt, >> NULL_STRING(safeHostCheckCommand), >> tmp_host->execution_time, >> tmp_host->latency, >> tmp_host->last_check, >> tmp_host->next_check, >> tmp_host->max_attempts, >> tmp_host->last_host_notification, >> tmp_host->next_host_notification, >> BOOLIFY_STRING(tmp_host->no_more_notifications), >> NULL_STRING(safePerfData), >> tmp_host->check_type); >> if(safeName) free(safeName); >> if(safeEventHandler) free(safeEventHandler); >> if(safePluginOutput) free(safePluginOutput); >> if(safeHostCheckCommand) free(safeHostCheckCommand); >> if(safePerfData) free(safePerfData); >> } >> break; >> case NEBCALLBACK_SERVICE_STATUS_DATA: >> { >> nebstruct_service_status_data * service_status_data = >> (nebstruct_service_status_data *) data; >> tmp_service = (service *) service_status_data->object_ptr; >> char *safeName = querify(tmp_service->host_name); >> char *safeServiceDescription = querify(tmp_service->description); >> char *safeEventHandler = querify(tmp_service->event_handler); >> char *safePluginOutput = querify(tmp_service->plugin_output); >> char *safeServiceCheckCommand = >> querify(tmp_service->service_check_command); >> char *safePerfData = querify(tmp_service->perf_data); >> snprintf(temp_buffer, sizeof(temp_buffer), "select >> update_service(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%lu,%s,%s,%s,%d,%d,%s, >> %d,%s,%f,%f,%lu,%lu,%d,%lu,%lu,%s,%s,%d)", >> NULL_STRING(safeName), >> NULL_STRING(safeServiceDescription), >> BOOLIFY_STRING(tmp_service->checks_enabled), >> BOOLIFY_STRING(tmp_service- >> >accept_passive_service_checks), >> BOOLIFY_STRING(tmp_service->event_handler_enabled), >> BOOLIFY_STRING(tmp_service->flap_detection_enabled), >> BOOLIFY_STRING(tmp_service->notifications_enabled), >> BOOLIFY_STRING(tmp_service->failure_prediction_enabled), >> BOOLIFY_STRING(tmp_service->process_performance_data), >> BOOLIFY_STRING(tmp_service->obsess_over_service), >> NULL_STRING(safeEventHandler), >> tmp_service->modified_attributes, >> BOOLIFY_STRING(tmp_service->has_been_checked), >> BOOLIFY_STRING(tmp_service->should_be_scheduled), >> BOOLIFY_STRING(tmp_service->is_flapping), >> tmp_service->current_state, >> tmp_service->last_hard_state, >> NULL_STRING(safePluginOutput), >> tmp_service->current_attempt, >> NULL_STRING(safeServiceCheckCommand), >> tmp_service->execution_time, >> tmp_service->latency, >> tmp_service->last_check, >> tmp_service->next_check, >> tmp_service->max_attempts, >> tmp_service->last_notification, >> tmp_service->next_notification, >> BOOLIFY_STRING(tmp_service->no_more_notifications), >> NULL_STRING(safePerfData), >> tmp_service->check_type); >> if(safeName) free(safeName); >> if(safeServiceDescription) free(safeServiceDescription); >> if(safeEventHandler) free(safeEventHandler); >> if(safePluginOutput) free(safePluginOutput); >> if(safeServiceCheckCommand) free(safeServiceCheckCommand); >> if(safePerfData) free(safePerfData); >> } >> break; >> default: >> snprintf(temp_buffer,sizeof(temp_buffer),"nagios-db: processStatus >> ignoring unknown NEB command %i",cmd); >> write_to_all_logs(temp_buffer,NSLOG_INFO_MESSAGE); >> return 0; >> break; >> } >> res = PQexec(pgconn,temp_buffer); >> if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) >> == PGRES_TUPLES_OK)) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", >> temp_buffer, PQresultErrorMessage(res)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> else >> { >> if(atoi(PQgetvalue(res,0,0)) < 0) >> { >> char str[2048]; >> snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back >> %s", temp_buffer, PQgetvalue(res,0,0)); >> write_to_all_logs(str,NSLOG_INFO_MESSAGE); >> } >> } >> PQclear(res); >> return 0; >> } >> ---------------------------------------------------------------------- >> -- >> On Mar 10, 2005, at 8:57 PM, Robert Bilbrey wrote: >>> Hi Ben, upgraded Nagios back up to 2.0b2 and pulled the latest >>> nagios-db code from cvs. Still no joy (: >>> What would you suggest I do next ? >>> Thanks, Bob >>> >>> >>> postgresql version: >>> nagios=# select version(); >>> version >>> --------------------------------------------------------------------- >>> -- ----------------------------------- >>> PostgreSQL 7.4.6 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) >>> 3.2.3 20030502 (Red Hat Linux 3.2.3-42) >>> >>> my makefile: >>> gcc -Wall -g -O2 -o inserter.o inserter.c -shared >>> -I/usr/local/src/nagios-2.0b2/include -I/usr/local/pgsql/include >>> /usr/local/pgsql/lib/libpq.a >>> >>> nagios.log with latest nagios-db cvs pull: >>> >>> [1110516022] Nagios 2.0b2 starting... (PID=8772) >>> [1110516022] LOG VERSION: 2.0 >>> [1110516022] initializing nagios-db postgres inserter... >>> [1110516022] nagios-db: inserter locked into db >>> [1110516022] Event broker module '/usr/local/nagios/bin/inserter.o' >>> initialized successfully. >>> [1110516022] Warning: Host 'kcwebwt1' has no services associated >>> with it! >>> [1110516022] Warning: Contact 'brian' is not a member of any contact >>> groups! >>> [1110516022] Warning: Contact 'cheikh' is not a member of any >>> contact groups! >>> [1110516022] Warning: Contact 'dwain' is not a member of any contact >>> groups! >>> [1110516022] Warning: Contact 'eric' is not a member of any contact >>> groups! >>> [1110516022] Warning: Contact 'john' is not a member of any contact >>> groups! >>> [1110516022] Warning: Contact 'karen' is not a member of any contact >>> groups! >>> [1110516022] Warning: Contact 'liz' is not a member of any contact >>> groups! >>> [1110516022] Warning: Contact 'robert' is not a member of any >>> contact groups! >>> [1110516022] Warning: Contact 'russ' is not a member of any contact >>> groups! >>> [1110516022] Warning: Contact 'scott' is not a member of any contact >>> groups! >>> [1110516022] Warning: Contact 'van' is not a member of any contact >>> groups! >>> [1110516022] Warning: Contact group 'nagios-setup' is not used in >>> any hostgroup/service definitions or host/hostgroup/se >>> rvice escalations! >>> [1110516022] Finished daemonizing... (New PID=8774) >>> [1110516022] nagios-db: couldn't clear config info () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('OPX',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >>> UE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('clappwp1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >>> UE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('clbackw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >>> UE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('clsqlwp1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >>> UE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('clwebwp1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >>> UE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('intranet',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >>> UE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcacct',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE >>> ,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcads',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE, >>> TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcadw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE >>> ,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcmailfw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,T >>> RUE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcmailw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >>> UE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcparadox',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,T >>> RUE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcsecl1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRU >>> E,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcsqldb',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRU >>> E,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcsqlwd1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >>> UE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcsqlwp2',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >>> UE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcwebwd1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >>> UE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('kcwebwt1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >>> UE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('pdoxtimer',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,T >>> RUE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('sunflower-chi-gw',TRUE,TRUE,TRUE,TRUE,TRUE >>> ,TRUE,TRUE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('sunflower-nor-gw',TRUE,TRUE,TRUE,TRUE,TRUE >>> ,TRUE,TRUE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('sunflower-op-gw',TRUE,TRUE,TRUE,TRUE,TRUE, >>> TRUE,TRUE,TRUE,FALSE)' () >>> [1110516022] nagios-db: couldn't configure host using 'select >>> configure_host('sunflowerKC',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE >>> ,TRUE,TRUE,FALSE)' () >>> [1110516022] nagios-db: configured 23 hosts >>> [1110516022] nagios-db: couldn't configure hostgroup using 'select >>> new_hostgroup('sunshine-colo','Sunshine Colo')' () >>> >>> Ben wrote: >>> >>>> First (and most important to you) I don't see anything in the code >>>> that make it obvious why you would get the "couldn't clear config >>>> info" message unless the command failed, but then you should have >>>> had some reason, and I don't see that. So that's still a mystery. >>>> Therefore, I'm going to blame the victim and ask what version of >>>> the postgres libs you have installed, and ask that you make sure >>>> you're really linking to them. Second, I recommend you use 2.0b2. >>>> It fixed problems I was having and didn't hurt anything. Given >>>> that you have the same problems on both versions, you might as >>>> well have them on the better one. :) >>>> Third, I just checked in a file that should fix the unhelpful >>>> "nagios-db: couldn't configure host using 'nagios-db: couldn't >>>> configure host using 'nagios-db: couldn't configure host us' ()" >>>> crap. That won't help your big >>>> issue, but it might help others in the future.... >>>> On Thu, 10 Mar 2005, Robert Bilbrey wrote: >>>> >>>>> I had nagios 2.0b1 working with nagios-db on RHEL3. I decided to >>>>> upgrade to 2.0b2 and pulled the latest nagios-db code from cvs. >>>>> Everything compiled fine, dropped the db and recreated the db with >>>>> the new schema, but nagios would not start with the neb module. >>>>> So then I pulled the 0.91 archive, same problem. After deciding >>>>> to roll back to 2.0b1 and the nagios-db cvs snapshot that I had >>>>> working previously, I am still throwing the same errors. If I >>>>> run the "select empty_config()" from a psql session I am returned >>>>> an empty recordset, which is what I would expect. The following >>>>> is from the nagios log. Does anyone have any thoughts, I really >>>>> need to get this back online. >>>>> Thanks, Bob >>>>> >>>>> [1110500709] Nagios 2.0b1 starting... (PID=5391) >>>>> [1110500709] LOG VERSION: 2.0 >>>>> [1110500709] initializing nagios-db postgres inserter... >>>>> [1110500709] nagios-db: inserter locked into db >>>>> [1110500709] Event broker module >>>>> '/usr/local/nagios/bin/inserter.o' initialized successfully. >>>>> [1110500709] Warning: Host 'kcwebwt1' has no services associated >>>>> with it! >>>>> [1110500709] Warning: Contact 'brian' is not a member of any >>>>> contact groups! >>>>> [1110500709] Warning: Contact 'cheikh' is not a member of any >>>>> contact groups! >>>>> [1110500709] Warning: Contact 'dwain' is not a member of any >>>>> contact groups! >>>>> [1110500709] Warning: Contact 'eric' is not a member of any >>>>> contact groups! >>>>> [1110500709] Warning: Contact 'john' is not a member of any >>>>> contact groups! >>>>> [1110500709] Warning: Contact 'karen' is not a member of any >>>>> contact groups! >>>>> [1110500709] Warning: Contact 'liz' is not a member of any contact >>>>> groups! >>>>> [1110500709] Warning: Contact 'robert' is not a member of any >>>>> contact groups! >>>>> [1110500709] Warning: Contact 'russ' is not a member of any >>>>> contact groups! >>>>> [1110500709] Warning: Contact 'scott' is not a member of any >>>>> contact groups! >>>>> [1110500709] Warning: Contact 'van' is not a member of any contact >>>>> groups! >>>>> [1110500709] Warning: Contact group 'nagios-setup' is not used in >>>>> any hostgroup/service definitions or host/hostgroup/service escala >>>>> tions! >>>>> [1110500709] Finished daemonizing... (New PID=5393) >>>>> [1110500709] nagios-db: couldn't clear config info () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure ho' ( >>>>> ) >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> us' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> us' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> us' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> us' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> us' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> ' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host' >>>>> () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> ' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> usi' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> us' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> usi' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> u' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> u' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> us' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> us' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> us' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> us' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> usi' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> using 'nag' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> using 'nag' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> using 'na' () >>>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>>> couldn't configure host using 'nagios-db: couldn't configure host >>>>> using' () >>>>> [1110500709] nagios-db: configured 23 hosts >>>>> [1110500709] nagios-db: couldn't configure hostgroup using >>>>> 'nagios-db: couldn't configure hostgroup using 'nagios' () >>>>> [1110500709] Caught SIGSEGV, shutting down... >>>>> >>>>> >>>>> ------------------------------------------------------- >>>>> SF email is sponsored by - The IT Product Guide >>>>> Read honest & candid reviews on hundreds of IT Products from real >>>>> users. >>>>> Discover which products truly live up to the hype. Start reading >>>>> now. >>>>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >>>>> _______________________________________________ >>>>> Nagios-db-devel mailing list >>>>> Nag...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/nagios-db-devel >>>>> >>>> ------------------------------------------------------- >>>> SF email is sponsored by - The IT Product Guide >>>> Read honest & candid reviews on hundreds of IT Products from real >>>> users. >>>> Discover which products truly live up to the hype. Start reading >>>> now. >>>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >>>> _______________________________________________ >>>> Nagios-db-devel mailing list >>>> Nag...@li... >>>> https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |
From: Robert B. <rbi...@na...> - 2005-03-11 06:51:37
|
That was it, don't know how it ever worked in the first place. I should be able to take it from here. Thanks for the help. This is the relevant nagios.log entry: [1110523507] Nagios 2.0b2 starting... (PID=9223) [1110523507] LOG VERSION: 2.0 [1110523507] initializing nagios-db postgres inserter... [1110523507] nagios-db: inserter failed to establish postgres connection (fe_sendauth: no password supplied ) [1110523507] Event broker module '/usr/local/nagios/bin/inserter.o' initialized successfully. Ben wrote: > Ok, so it turns out I apparently can't read documentation. I bet the > problem is that you aren't successfully connecting to your database. > Have you checked your permissions? Or, better yet, your postgres logs? > > I'm not in a place where I can try this out, so give it a shot. If it > passes the compile test, then I'll check it in. If we're lucky, it might > even tell you what's wrong. :) > > > ------------------------------------------------------------------------ > > #ifndef NSCORE > #define NSCORE > #endif > > /* we need this for postgres support */ > #include "libpq-fe.h" > > /* include the needed event broker header files */ > #include "../include/nebmodules.h" > #include "../include/nebcallbacks.h" > #include "../include/nebstructs.h" > #include "../include/broker.h" > > /* include some Nagios stuff as well */ > #include "../include/config.h" > #include "../include/common.h" > #include "../include/nagios.h" > #include "../include/objects.h" > > #include <sys/types.h> > #include <string.h> > #include <stdlib.h> > > #define UNIX_PATH_MAX 108 > > /* specify event broker API version (required) */ > NEB_API_VERSION(CURRENT_NEB_API_VERSION); > > #define BUFFER_ALLOC_SIZE 1024 > #define NULL_STRING(x) (x?:"null") > #define BOOLIFY_STRING(x) (x?"TRUE":"FALSE") > > #define FIRST_COMMAND_NUM NEBCALLBACK_PROCESS_DATA > > char * querify(char * src); > > > extern hostgroup *hostgroup_list; > extern servicegroup *servicegroup_list; > extern host *host_list; > extern service *service_list; > > extern int enable_flap_detection; > extern int enable_notifications; > extern int enable_event_handlers; > extern int execute_service_checks; > extern int execute_host_checks; > extern int accept_passive_service_checks; > extern int accept_passive_host_checks; > > static int processStart(int, void *); > static int processStatus(int, void *); > static int processCheck(int, void *); > > > PGconn * pgconn = 0; > > /* this function gets called when the module is loaded by the event broker */ > int nebmodule_init(int flags, char *args, nebmodule *handle) > { > write_to_all_logs("initializing nagios-db postgres inserter...",NSLOG_INFO_MESSAGE); > > if(!(pgconn = PQconnectdb("host=meatshake port=5432 dbname=nag user=postgres"))) > { > /* couldn't connect; this will be useless. */ > write_to_all_logs("nagios-db: inserter failed to allocate postgres connection",NSLOG_INFO_MESSAGE); > } > else > { > if(CONNECTION_OK != PQstatus(pgconn)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: inserter failed to establish postgres connection (%s)",PQerrorMessage(pgconn)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > else > write_to_all_logs("nagios-db: inserter locked into db",NSLOG_INFO_MESSAGE); > } > > > neb_register_callback(NEBCALLBACK_TIMED_EVENT_DATA, 0, processStart); > > return 0; > } > > > /* this function gets called when the module is unoaded by the event broker */ > int nebmodule_deinit(int flags, int reason) > { > /* log a message to the Nagios log file */ > > write_to_all_logs("nagios-db: inserter unloading...",NSLOG_INFO_MESSAGE); > > PQfinish(pgconn); > > neb_deregister_callback(NEBCALLBACK_HOST_STATUS_DATA, processStatus); > neb_deregister_callback(NEBCALLBACK_SERVICE_STATUS_DATA, processStatus); > neb_deregister_callback(NEBCALLBACK_HOST_CHECK_DATA, processCheck); > neb_deregister_callback(NEBCALLBACK_SERVICE_CHECK_DATA, processCheck); > > pgconn = 0; > > return 0; > } > > /* helper function to make a string ready for inclusion into a sql query */ > char * > querify(char * src) > { > char * ret = 0; > if(src) > { > int size = 2*strlen(src) + 3; /* +3 because we want to surround strings with single quotes, and we still need a null */ > int written = 0; > if(!(ret = malloc(size))) > { > return 0; > } > ret[0] = '\''; > written = PQescapeString(ret+1, src, strlen(src)); > ret[written + 1] = '\''; > ret[written + 2] = 0; > } > > return ret; > } > > /* when Nagios starts up, we'll want to replicate configuration data into the database */ > static int processStart(int cmd, void * data) > { > host *hl = 0; > service *sl = 0; > hostgroup *hg = 0; > PGresult *res = 0; > int groupcount = 0; > char q[2048]; > > /* verify that we're dealing with the right kind of message. */ > if(cmd != NEBCALLBACK_TIMED_EVENT_DATA) return 0; > > /* verify that our config data has been initialized. */ > if(((nebstruct_timed_event_data*)data)->type != NEBTYPE_TIMEDEVENT_ADD) return 0; > > /* Clear out the previous config info.... */ > res = PQexec(pgconn,"select empty_config()"); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't clear config info (%s)", PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > PQclear(res); > > /* .... and insert new config info. Start with the hosts. */ > for(groupcount=0, hl = host_list; hl; hl = hl->next) > { > /* update this host */ > char *hostName = querify(hl->name); > > snprintf(q,sizeof(q),"select configure_host(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)", > NULL_STRING(hostName), > BOOLIFY_STRING(hl->checks_enabled), > BOOLIFY_STRING(hl->accept_passive_host_checks), > BOOLIFY_STRING(hl->event_handler_enabled), > BOOLIFY_STRING(hl->flap_detection_enabled), > BOOLIFY_STRING(hl->notifications_enabled), > BOOLIFY_STRING(hl->failure_prediction_enabled), > BOOLIFY_STRING(hl->process_performance_data), > BOOLIFY_STRING(hl->obsess_over_host), > BOOLIFY_STRING(hl->should_be_scheduled)); > if(hostName) free(hostName); > > res = PQexec(pgconn,q); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't configure host using '%s' (%s)", q, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > PQclear(res); > > groupcount++; > } > > snprintf(q,sizeof(q),"nagios-db: configured %d hosts", groupcount); > write_to_all_logs(q,NSLOG_INFO_MESSAGE); > > /* add hostgroup membership */ > for(groupcount=0, hg=hostgroup_list; hg ; hg = hg->next) > { > hostgroupmember *hgm = 0; > char *groupName, *groupAlias, *hostName; > unsigned long groupid = 0; > > /* insert this hostgroup */ > groupName = querify(hg->group_name); > groupAlias = querify(hg->alias); > snprintf(q,sizeof(q),"select new_hostgroup(%s,%s)", NULL_STRING(groupName), NULL_STRING(groupAlias)); > if(groupName) free(groupName); > if(groupAlias) free(groupAlias); > > res = PQexec(pgconn,q); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't configure hostgroup using '%s' (%s)", q, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > groupid = atol(PQgetvalue(res,0,0)); > PQclear(res); > > for(hgm = hg->members; hgm; hgm = hgm->next) > { > /* add this host to the hostgroup */ > hostName = querify(hgm->host_name); > snprintf(q,sizeof(q),"select append_to_hostgroup(%lu,%s)", groupid, NULL_STRING(hostName)); > if(hostName) free(hostName); > > res = PQexec(pgconn,q); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't configure hostgroup membership using '%s' (%s)", q, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > PQclear(res); > } > > groupcount++; > } > > snprintf(q,sizeof(q),"nagios-db: loaded %d hostgroups", groupcount); > write_to_all_logs(q,NSLOG_INFO_MESSAGE); > > /* mark all the configured services as such */ > for(groupcount=0, sl = service_list; sl; sl = sl->next) > { > /* update this service */ > char *hostName = querify(sl->host_name); > char *serviceDesc = querify(sl->description); > > snprintf(q,sizeof(q),"select configure_service(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)", > NULL_STRING(hostName), > NULL_STRING(serviceDesc), > BOOLIFY_STRING(sl->checks_enabled), > BOOLIFY_STRING(sl->accept_passive_service_checks), > BOOLIFY_STRING(sl->event_handler_enabled), > BOOLIFY_STRING(sl->flap_detection_enabled), > BOOLIFY_STRING(sl->notifications_enabled), > BOOLIFY_STRING(sl->failure_prediction_enabled), > BOOLIFY_STRING(sl->process_performance_data), > BOOLIFY_STRING(sl->obsess_over_service), > BOOLIFY_STRING(sl->should_be_scheduled)); > if(hostName) free(hostName); > if(serviceDesc) free(serviceDesc); > > res = PQexec(pgconn,q); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't configure service using '%s' (%s)", q, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > PQclear(res); > > groupcount++; > } > > snprintf(q,sizeof(q),"nagios-db: set configured flag on %d services", groupcount); > write_to_all_logs(q,NSLOG_INFO_MESSAGE); > > /* also insert various config parameters that we might want */ > snprintf(q,sizeof(q),"select replace_config_param('accept_passive_host_checks',%d)",accept_passive_host_checks); > res = PQexec(pgconn,q); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", q, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > else > { > if(atoi(PQgetvalue(res,0,0)) < 0) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back %s", q, PQgetvalue(res,0,0)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > } > PQclear(res); > > snprintf(q,sizeof(q),"select replace_config_param('execute_host_checks',%d)",execute_host_checks); > res = PQexec(pgconn,q); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", q, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > else > { > if(atoi(PQgetvalue(res,0,0)) < 0) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back %s", q, PQgetvalue(res,0,0)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > } > PQclear(res); > > snprintf(q,sizeof(q),"select replace_config_param('accept_passive_service_checks',%d)",accept_passive_service_checks); > res = PQexec(pgconn,q); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", q, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > else > { > if(atoi(PQgetvalue(res,0,0)) < 0) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back %s", q, PQgetvalue(res,0,0)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > } > PQclear(res); > > snprintf(q,sizeof(q),"select replace_config_param('execute_service_checks',%d)",execute_service_checks); > res = PQexec(pgconn,q); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", q, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > else > { > if(atoi(PQgetvalue(res,0,0)) < 0) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back %s", q, PQgetvalue(res,0,0)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > } > PQclear(res); > > snprintf(q,sizeof(q),"select replace_config_param('enable_flap_detection',%d)",enable_flap_detection); > res = PQexec(pgconn,q); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", q, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > else > { > if(atoi(PQgetvalue(res,0,0)) < 0) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back %s", q, PQgetvalue(res,0,0)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > } > PQclear(res); > > snprintf(q,sizeof(q),"select replace_config_param('enable_notifications',%d)",enable_notifications); > res = PQexec(pgconn,q); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", q, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > else > { > if(atoi(PQgetvalue(res,0,0)) < 0) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back %s", q, PQgetvalue(res,0,0)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > } > PQclear(res); > > snprintf(q,sizeof(q),"select replace_config_param('enable_event_handlers',%d)",enable_event_handlers); > res = PQexec(pgconn,q); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", q, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > else > { > if(atoi(PQgetvalue(res,0,0)) < 0) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back %s", q, PQgetvalue(res,0,0)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > } > PQclear(res); > > write_to_all_logs("nagios-db: configuration complete. Registering for status notifications...",NSLOG_INFO_MESSAGE); > > neb_deregister_callback(NEBCALLBACK_TIMED_EVENT_DATA, processStart); > neb_register_callback(NEBCALLBACK_HOST_STATUS_DATA, 0, processStatus); > neb_register_callback(NEBCALLBACK_SERVICE_STATUS_DATA, 0, processStatus); > neb_register_callback(NEBCALLBACK_HOST_CHECK_DATA, 0, processCheck); > neb_register_callback(NEBCALLBACK_SERVICE_CHECK_DATA, 0, processCheck); > > return 0; > } > > > > static int processCheck(int cmd, void * data) > { > PGresult *res; > char temp_buffer[1024]; > > bzero(temp_buffer, sizeof(temp_buffer)); > > switch(cmd) > { > case NEBCALLBACK_HOST_CHECK_DATA: > { > nebstruct_host_check_data * host_check_data = (nebstruct_host_check_data *) data; > > if(host_check_data->type != NEBTYPE_HOSTCHECK_PROCESSED) return 0; > > char *safeName = querify(host_check_data->host_name); > > snprintf(temp_buffer, sizeof(temp_buffer), "select host_checked(%s)",NULL_STRING(safeName)); > > if(safeName) free(safeName); > } > break; > > case NEBCALLBACK_SERVICE_CHECK_DATA: > { > nebstruct_service_check_data * service_check_data = (nebstruct_service_check_data *) data; > > if(service_check_data->type != NEBTYPE_SERVICECHECK_PROCESSED) return 0; > > char *safeName = querify(service_check_data->host_name); > char *safeServiceDescription = querify(service_check_data->service_description); > > snprintf(temp_buffer, sizeof(temp_buffer), "select service_checked(%s,%s)", NULL_STRING(safeName), NULL_STRING(safeServiceDescription)); > > if(safeName) free(safeName); > if(safeServiceDescription) free(safeServiceDescription); > } > break; > > default: > snprintf(temp_buffer,sizeof(temp_buffer),"nagios-db: processCheck ignoring unknown NEB command %i",cmd); > write_to_all_logs(temp_buffer,NSLOG_INFO_MESSAGE); > return 0; > break; > } > > res = PQexec(pgconn,temp_buffer); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", temp_buffer, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > else > { > if(atoi(PQgetvalue(res,0,0)) < 0) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back %s", temp_buffer, PQgetvalue(res,0,0)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > } > > PQclear(res); > > return 0; > } > > > > static int processStatus(int cmd, void * data) > { > PGresult *res; > char temp_buffer[5120]; > service *tmp_service; > host *tmp_host; > > bzero(temp_buffer, sizeof(temp_buffer)); > switch(cmd) > { > case NEBCALLBACK_HOST_STATUS_DATA: > { > nebstruct_host_status_data * host_status_data = (nebstruct_host_status_data *) data; > tmp_host = (host *) host_status_data->object_ptr; > char *safeName = querify(tmp_host->name); > char *safeEventHandler = querify(tmp_host->event_handler); > char *safePluginOutput = querify(tmp_host->plugin_output); > char *safeHostCheckCommand = querify(tmp_host->host_check_command); > char *safePerfData = querify(tmp_host->perf_data); > > > snprintf(temp_buffer, sizeof(temp_buffer), "select update_host(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%lu,%s,%s,%s,%d,%d,%s,%d,%s,%f,%f,%lu,%lu,%d,%lu,%lu,%s,%s,%d)", > NULL_STRING(safeName), > BOOLIFY_STRING(tmp_host->checks_enabled), > BOOLIFY_STRING(tmp_host->accept_passive_host_checks), > BOOLIFY_STRING(tmp_host->event_handler_enabled), > BOOLIFY_STRING(tmp_host->flap_detection_enabled), > BOOLIFY_STRING(tmp_host->notifications_enabled), > BOOLIFY_STRING(tmp_host->failure_prediction_enabled), > BOOLIFY_STRING(tmp_host->process_performance_data), > BOOLIFY_STRING(tmp_host->obsess_over_host), > NULL_STRING(safeEventHandler), > tmp_host->modified_attributes, > BOOLIFY_STRING(tmp_host->has_been_checked), > BOOLIFY_STRING(tmp_host->should_be_scheduled), > BOOLIFY_STRING(tmp_host->is_flapping), > tmp_host->current_state, > tmp_host->last_hard_state, > NULL_STRING(safePluginOutput), > tmp_host->current_attempt, > NULL_STRING(safeHostCheckCommand), > tmp_host->execution_time, > tmp_host->latency, > tmp_host->last_check, > tmp_host->next_check, > tmp_host->max_attempts, > tmp_host->last_host_notification, > tmp_host->next_host_notification, > BOOLIFY_STRING(tmp_host->no_more_notifications), > NULL_STRING(safePerfData), > tmp_host->check_type); > > if(safeName) free(safeName); > if(safeEventHandler) free(safeEventHandler); > if(safePluginOutput) free(safePluginOutput); > if(safeHostCheckCommand) free(safeHostCheckCommand); > if(safePerfData) free(safePerfData); > } > break; > > case NEBCALLBACK_SERVICE_STATUS_DATA: > { > nebstruct_service_status_data * service_status_data = (nebstruct_service_status_data *) data; > tmp_service = (service *) service_status_data->object_ptr; > > char *safeName = querify(tmp_service->host_name); > char *safeServiceDescription = querify(tmp_service->description); > char *safeEventHandler = querify(tmp_service->event_handler); > char *safePluginOutput = querify(tmp_service->plugin_output); > char *safeServiceCheckCommand = querify(tmp_service->service_check_command); > char *safePerfData = querify(tmp_service->perf_data); > > > snprintf(temp_buffer, sizeof(temp_buffer), "select update_service(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%lu,%s,%s,%s,%d,%d,%s,%d,%s,%f,%f,%lu,%lu,%d,%lu,%lu,%s,%s,%d)", > NULL_STRING(safeName), > NULL_STRING(safeServiceDescription), > BOOLIFY_STRING(tmp_service->checks_enabled), > BOOLIFY_STRING(tmp_service->accept_passive_service_checks), > BOOLIFY_STRING(tmp_service->event_handler_enabled), > BOOLIFY_STRING(tmp_service->flap_detection_enabled), > BOOLIFY_STRING(tmp_service->notifications_enabled), > BOOLIFY_STRING(tmp_service->failure_prediction_enabled), > BOOLIFY_STRING(tmp_service->process_performance_data), > BOOLIFY_STRING(tmp_service->obsess_over_service), > NULL_STRING(safeEventHandler), > tmp_service->modified_attributes, > BOOLIFY_STRING(tmp_service->has_been_checked), > BOOLIFY_STRING(tmp_service->should_be_scheduled), > BOOLIFY_STRING(tmp_service->is_flapping), > tmp_service->current_state, > tmp_service->last_hard_state, > NULL_STRING(safePluginOutput), > tmp_service->current_attempt, > NULL_STRING(safeServiceCheckCommand), > tmp_service->execution_time, > tmp_service->latency, > tmp_service->last_check, > tmp_service->next_check, > tmp_service->max_attempts, > tmp_service->last_notification, > tmp_service->next_notification, > BOOLIFY_STRING(tmp_service->no_more_notifications), > NULL_STRING(safePerfData), > tmp_service->check_type); > > if(safeName) free(safeName); > if(safeServiceDescription) free(safeServiceDescription); > if(safeEventHandler) free(safeEventHandler); > if(safePluginOutput) free(safePluginOutput); > if(safeServiceCheckCommand) free(safeServiceCheckCommand); > if(safePerfData) free(safePerfData); > } > break; > > default: > snprintf(temp_buffer,sizeof(temp_buffer),"nagios-db: processStatus ignoring unknown NEB command %i",cmd); > write_to_all_logs(temp_buffer,NSLOG_INFO_MESSAGE); > return 0; > break; > } > > res = PQexec(pgconn,temp_buffer); > if(!(PQresultStatus(res) == PGRES_COMMAND_OK || PQresultStatus(res) == PGRES_TUPLES_OK)) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: couldn't execute '%s' (%s)", temp_buffer, PQresultErrorMessage(res)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > else > { > if(atoi(PQgetvalue(res,0,0)) < 0) > { > char str[2048]; > snprintf(str,sizeof(str),"nagios-db: executed '%s' and got back %s", temp_buffer, PQgetvalue(res,0,0)); > write_to_all_logs(str,NSLOG_INFO_MESSAGE); > } > } > > PQclear(res); > > return 0; > } > > > > > ------------------------------------------------------------------------ > > > > On Mar 10, 2005, at 8:57 PM, Robert Bilbrey wrote: > >> Hi Ben, upgraded Nagios back up to 2.0b2 and pulled the latest >> nagios-db code from cvs. Still no joy (: >> What would you suggest I do next ? >> Thanks, Bob >> >> >> postgresql version: >> nagios=# select version(); >> version >> ----------------------------------------------------------------------- >> ----------------------------------- >> PostgreSQL 7.4.6 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) >> 3.2.3 20030502 (Red Hat Linux 3.2.3-42) >> >> my makefile: >> gcc -Wall -g -O2 -o inserter.o inserter.c -shared >> -I/usr/local/src/nagios-2.0b2/include -I/usr/local/pgsql/include >> /usr/local/pgsql/lib/libpq.a >> >> nagios.log with latest nagios-db cvs pull: >> >> [1110516022] Nagios 2.0b2 starting... (PID=8772) >> [1110516022] LOG VERSION: 2.0 >> [1110516022] initializing nagios-db postgres inserter... >> [1110516022] nagios-db: inserter locked into db >> [1110516022] Event broker module '/usr/local/nagios/bin/inserter.o' >> initialized successfully. >> [1110516022] Warning: Host 'kcwebwt1' has no services associated with >> it! >> [1110516022] Warning: Contact 'brian' is not a member of any contact >> groups! >> [1110516022] Warning: Contact 'cheikh' is not a member of any contact >> groups! >> [1110516022] Warning: Contact 'dwain' is not a member of any contact >> groups! >> [1110516022] Warning: Contact 'eric' is not a member of any contact >> groups! >> [1110516022] Warning: Contact 'john' is not a member of any contact >> groups! >> [1110516022] Warning: Contact 'karen' is not a member of any contact >> groups! >> [1110516022] Warning: Contact 'liz' is not a member of any contact >> groups! >> [1110516022] Warning: Contact 'robert' is not a member of any contact >> groups! >> [1110516022] Warning: Contact 'russ' is not a member of any contact >> groups! >> [1110516022] Warning: Contact 'scott' is not a member of any contact >> groups! >> [1110516022] Warning: Contact 'van' is not a member of any contact >> groups! >> [1110516022] Warning: Contact group 'nagios-setup' is not used in any >> hostgroup/service definitions or host/hostgroup/se >> rvice escalations! >> [1110516022] Finished daemonizing... (New PID=8774) >> [1110516022] nagios-db: couldn't clear config info () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('OPX',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >> UE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('clappwp1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >> UE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('clbackw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >> UE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('clsqlwp1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >> UE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('clwebwp1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >> UE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('intranet',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >> UE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcacct',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE >> ,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcads',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE, >> TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcadw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE >> ,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcmailfw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,T >> RUE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcmailw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >> UE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcparadox',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,T >> RUE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcsecl1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRU >> E,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcsqldb',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRU >> E,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcsqlwd1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >> UE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcsqlwp2',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >> UE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcwebwd1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >> UE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('kcwebwt1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR >> UE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('pdoxtimer',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,T >> RUE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('sunflower-chi-gw',TRUE,TRUE,TRUE,TRUE,TRUE >> ,TRUE,TRUE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('sunflower-nor-gw',TRUE,TRUE,TRUE,TRUE,TRUE >> ,TRUE,TRUE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('sunflower-op-gw',TRUE,TRUE,TRUE,TRUE,TRUE, >> TRUE,TRUE,TRUE,FALSE)' () >> [1110516022] nagios-db: couldn't configure host using 'select >> configure_host('sunflowerKC',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE >> ,TRUE,TRUE,FALSE)' () >> [1110516022] nagios-db: configured 23 hosts >> [1110516022] nagios-db: couldn't configure hostgroup using 'select >> new_hostgroup('sunshine-colo','Sunshine Colo')' () >> >> Ben wrote: >> >>> First (and most important to you) I don't see anything in the code >>> that make it obvious why you would get the "couldn't clear config >>> info" message unless the command failed, but then you should have >>> had some reason, and I don't see that. So that's still a mystery. >>> Therefore, I'm going to blame the victim and ask what version of the >>> postgres libs you have installed, and ask that you make sure you're >>> really linking to them. Second, I recommend you use 2.0b2. It fixed >>> problems I was having and didn't hurt anything. Given that you have >>> the same problems on both versions, you might as well have them on >>> the better one. :) >>> Third, I just checked in a file that should fix the unhelpful >>> "nagios-db: couldn't configure host using 'nagios-db: couldn't >>> configure host using 'nagios-db: couldn't configure host us' ()" >>> crap. That won't help your big >>> issue, but it might help others in the future.... >>> On Thu, 10 Mar 2005, Robert Bilbrey wrote: >>> >>>> I had nagios 2.0b1 working with nagios-db on RHEL3. I decided to >>>> upgrade to 2.0b2 and pulled the latest nagios-db code from cvs. >>>> Everything compiled fine, dropped the db and recreated the db with >>>> the new schema, but nagios would not start with the neb module. So >>>> then I pulled the 0.91 archive, same problem. After deciding to >>>> roll back to 2.0b1 and the nagios-db cvs snapshot that I had >>>> working previously, I am still throwing the same errors. If I run >>>> the "select empty_config()" from a psql session I am returned an >>>> empty recordset, which is what I would expect. The following is >>>> from the nagios log. Does anyone have any thoughts, I really need >>>> to get this back online. >>>> Thanks, Bob >>>> >>>> [1110500709] Nagios 2.0b1 starting... (PID=5391) >>>> [1110500709] LOG VERSION: 2.0 >>>> [1110500709] initializing nagios-db postgres inserter... >>>> [1110500709] nagios-db: inserter locked into db >>>> [1110500709] Event broker module '/usr/local/nagios/bin/inserter.o' >>>> initialized successfully. >>>> [1110500709] Warning: Host 'kcwebwt1' has no services associated >>>> with it! >>>> [1110500709] Warning: Contact 'brian' is not a member of any >>>> contact groups! >>>> [1110500709] Warning: Contact 'cheikh' is not a member of any >>>> contact groups! >>>> [1110500709] Warning: Contact 'dwain' is not a member of any >>>> contact groups! >>>> [1110500709] Warning: Contact 'eric' is not a member of any contact >>>> groups! >>>> [1110500709] Warning: Contact 'john' is not a member of any contact >>>> groups! >>>> [1110500709] Warning: Contact 'karen' is not a member of any >>>> contact groups! >>>> [1110500709] Warning: Contact 'liz' is not a member of any contact >>>> groups! >>>> [1110500709] Warning: Contact 'robert' is not a member of any >>>> contact groups! >>>> [1110500709] Warning: Contact 'russ' is not a member of any contact >>>> groups! >>>> [1110500709] Warning: Contact 'scott' is not a member of any >>>> contact groups! >>>> [1110500709] Warning: Contact 'van' is not a member of any contact >>>> groups! >>>> [1110500709] Warning: Contact group 'nagios-setup' is not used in >>>> any hostgroup/service definitions or host/hostgroup/service escala >>>> tions! >>>> [1110500709] Finished daemonizing... (New PID=5393) >>>> [1110500709] nagios-db: couldn't clear config info () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure ho' ( >>>> ) >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> us' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> us' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> us' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> us' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> us' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> ' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host' >>>> () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> ' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> usi' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> us' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> usi' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> u' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> u' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> us' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> us' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> us' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> us' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> usi' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> using 'nag' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> using 'nag' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> using 'na' () >>>> [1110500709] nagios-db: couldn't configure host using 'nagios-db: >>>> couldn't configure host using 'nagios-db: couldn't configure host >>>> using' () >>>> [1110500709] nagios-db: configured 23 hosts >>>> [1110500709] nagios-db: couldn't configure hostgroup using >>>> 'nagios-db: couldn't configure hostgroup using 'nagios' () >>>> [1110500709] Caught SIGSEGV, shutting down... >>>> >>>> >>>> ------------------------------------------------------- >>>> SF email is sponsored by - The IT Product Guide >>>> Read honest & candid reviews on hundreds of IT Products from real >>>> users. >>>> Discover which products truly live up to the hype. Start reading now. >>>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >>>> _______________________________________________ >>>> Nagios-db-devel mailing list >>>> Nag...@li... >>>> https://lists.sourceforge.net/lists/listinfo/nagios-db-devel >>>> >>> ------------------------------------------------------- >>> SF email is sponsored by - The IT Product Guide >>> Read honest & candid reviews on hundreds of IT Products from real >>> users. >>> Discover which products truly live up to the hype. Start reading now. >>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >>> _______________________________________________ >>> Nagios-db-devel mailing list >>> Nag...@li... >>> https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |
From: Ben <be...@si...> - 2005-03-11 06:33:16
|
Ok, so it turns out I apparently can't read documentation. I bet the problem is that you aren't successfully connecting to your database. Have you checked your permissions? Or, better yet, your postgres logs? I'm not in a place where I can try this out, so give it a shot. If it passes the compile test, then I'll check it in. If we're lucky, it might even tell you what's wrong. :) |
From: Robert B. <rbi...@na...> - 2005-03-11 04:58:07
|
Hi Ben, upgraded Nagios back up to 2.0b2 and pulled the latest nagios-db code from cvs. Still no joy (: What would you suggest I do next ? Thanks, Bob postgresql version: nagios=# select version(); version ---------------------------------------------------------------------------------------------------------- PostgreSQL 7.4.6 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) my makefile: gcc -Wall -g -O2 -o inserter.o inserter.c -shared -I/usr/local/src/nagios-2.0b2/include -I/usr/local/pgsql/include /usr/local/pgsql/lib/libpq.a nagios.log with latest nagios-db cvs pull: [1110516022] Nagios 2.0b2 starting... (PID=8772) [1110516022] LOG VERSION: 2.0 [1110516022] initializing nagios-db postgres inserter... [1110516022] nagios-db: inserter locked into db [1110516022] Event broker module '/usr/local/nagios/bin/inserter.o' initialized successfully. [1110516022] Warning: Host 'kcwebwt1' has no services associated with it! [1110516022] Warning: Contact 'brian' is not a member of any contact groups! [1110516022] Warning: Contact 'cheikh' is not a member of any contact groups! [1110516022] Warning: Contact 'dwain' is not a member of any contact groups! [1110516022] Warning: Contact 'eric' is not a member of any contact groups! [1110516022] Warning: Contact 'john' is not a member of any contact groups! [1110516022] Warning: Contact 'karen' is not a member of any contact groups! [1110516022] Warning: Contact 'liz' is not a member of any contact groups! [1110516022] Warning: Contact 'robert' is not a member of any contact groups! [1110516022] Warning: Contact 'russ' is not a member of any contact groups! [1110516022] Warning: Contact 'scott' is not a member of any contact groups! [1110516022] Warning: Contact 'van' is not a member of any contact groups! [1110516022] Warning: Contact group 'nagios-setup' is not used in any hostgroup/service definitions or host/hostgroup/se rvice escalations! [1110516022] Finished daemonizing... (New PID=8774) [1110516022] nagios-db: couldn't clear config info () [1110516022] nagios-db: couldn't configure host using 'select configure_host('OPX',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR UE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('clappwp1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR UE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('clbackw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR UE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('clsqlwp1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR UE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('clwebwp1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR UE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('intranet',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR UE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcacct',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE ,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcads',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE, TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcadw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE ,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcmailfw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,T RUE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcmailw1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR UE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcparadox',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,T RUE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcsecl1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRU E,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcsqldb',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRU E,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcsqlwd1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR UE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcsqlwp2',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR UE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcwebwd1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR UE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('kcwebwt1',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TR UE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('pdoxtimer',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,T RUE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('sunflower-chi-gw',TRUE,TRUE,TRUE,TRUE,TRUE ,TRUE,TRUE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('sunflower-nor-gw',TRUE,TRUE,TRUE,TRUE,TRUE ,TRUE,TRUE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('sunflower-op-gw',TRUE,TRUE,TRUE,TRUE,TRUE, TRUE,TRUE,TRUE,FALSE)' () [1110516022] nagios-db: couldn't configure host using 'select configure_host('sunflowerKC',TRUE,TRUE,TRUE,TRUE,TRUE,TRUE ,TRUE,TRUE,FALSE)' () [1110516022] nagios-db: configured 23 hosts [1110516022] nagios-db: couldn't configure hostgroup using 'select new_hostgroup('sunshine-colo','Sunshine Colo')' () Ben wrote: > First (and most important to you) I don't see anything in the code that > make it obvious why you would get the "couldn't clear config info" message > unless the command failed, but then you should have had some reason, and I > don't see that. So that's still a mystery. Therefore, I'm going to blame > the victim and ask what version of the postgres libs you have installed, > and ask that you make sure you're really linking to them. > > Second, I recommend you use 2.0b2. It fixed problems I was having and > didn't hurt anything. Given that you have the same problems on both > versions, you might as well have them on the better one. :) > > Third, I just checked in a file that should fix the unhelpful "nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host using > 'nagios-db: couldn't configure host us' ()" crap. That won't help your big > issue, but it might help others in the future.... > > > On Thu, 10 Mar 2005, Robert Bilbrey wrote: > > >>I had nagios 2.0b1 working with nagios-db on RHEL3. I decided to upgrade >>to 2.0b2 and pulled the latest nagios-db code from cvs. Everything >>compiled fine, dropped the db and recreated the db with the new schema, >>but nagios would not start with the neb module. So then I pulled the >>0.91 archive, same problem. After deciding to roll back to 2.0b1 and the >>nagios-db cvs snapshot that I had working previously, I am still >>throwing the same errors. If I run the "select empty_config()" from a >>psql session I am returned an empty recordset, which is what I would >>expect. The following is from the nagios log. Does anyone have any >>thoughts, I really need to get this back online. >>Thanks, Bob >> >>[1110500709] Nagios 2.0b1 starting... (PID=5391) >>[1110500709] LOG VERSION: 2.0 >>[1110500709] initializing nagios-db postgres inserter... >>[1110500709] nagios-db: inserter locked into db >>[1110500709] Event broker module '/usr/local/nagios/bin/inserter.o' >>initialized successfully. >>[1110500709] Warning: Host 'kcwebwt1' has no services associated with it! >>[1110500709] Warning: Contact 'brian' is not a member of any contact groups! >>[1110500709] Warning: Contact 'cheikh' is not a member of any contact >>groups! >>[1110500709] Warning: Contact 'dwain' is not a member of any contact groups! >>[1110500709] Warning: Contact 'eric' is not a member of any contact groups! >>[1110500709] Warning: Contact 'john' is not a member of any contact groups! >>[1110500709] Warning: Contact 'karen' is not a member of any contact groups! >>[1110500709] Warning: Contact 'liz' is not a member of any contact groups! >>[1110500709] Warning: Contact 'robert' is not a member of any contact >>groups! >>[1110500709] Warning: Contact 'russ' is not a member of any contact groups! >>[1110500709] Warning: Contact 'scott' is not a member of any contact groups! >>[1110500709] Warning: Contact 'van' is not a member of any contact groups! >>[1110500709] Warning: Contact group 'nagios-setup' is not used in any >>hostgroup/service definitions or host/hostgroup/service escala >>tions! >>[1110500709] Finished daemonizing... (New PID=5393) >>[1110500709] nagios-db: couldn't clear config info () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure ho' ( >>) >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>us' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>us' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>us' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>us' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>us' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host' >> () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>usi' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>us' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>usi' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>u' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>u' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>us' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>us' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>us' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>us' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>usi' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>using 'nag' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>using 'nag' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>using 'na' () >>[1110500709] nagios-db: couldn't configure host using 'nagios-db: >>couldn't configure host using 'nagios-db: couldn't configure host >>using' () >>[1110500709] nagios-db: configured 23 hosts >>[1110500709] nagios-db: couldn't configure hostgroup using 'nagios-db: >>couldn't configure hostgroup using 'nagios' () >>[1110500709] Caught SIGSEGV, shutting down... >> >> >>------------------------------------------------------- >>SF email is sponsored by - The IT Product Guide >>Read honest & candid reviews on hundreds of IT Products from real users. >>Discover which products truly live up to the hype. Start reading now. >>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >>_______________________________________________ >>Nagios-db-devel mailing list >>Nag...@li... >>https://lists.sourceforge.net/lists/listinfo/nagios-db-devel >> > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > |
From: Ben <be...@si...> - 2005-03-11 01:15:42
|
First (and most important to you) I don't see anything in the code that make it obvious why you would get the "couldn't clear config info" message unless the command failed, but then you should have had some reason, and I don't see that. So that's still a mystery. Therefore, I'm going to blame the victim and ask what version of the postgres libs you have installed, and ask that you make sure you're really linking to them. Second, I recommend you use 2.0b2. It fixed problems I was having and didn't hurt anything. Given that you have the same problems on both versions, you might as well have them on the better one. :) Third, I just checked in a file that should fix the unhelpful "nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' ()" crap. That won't help your big issue, but it might help others in the future.... On Thu, 10 Mar 2005, Robert Bilbrey wrote: > I had nagios 2.0b1 working with nagios-db on RHEL3. I decided to upgrade > to 2.0b2 and pulled the latest nagios-db code from cvs. Everything > compiled fine, dropped the db and recreated the db with the new schema, > but nagios would not start with the neb module. So then I pulled the > 0.91 archive, same problem. After deciding to roll back to 2.0b1 and the > nagios-db cvs snapshot that I had working previously, I am still > throwing the same errors. If I run the "select empty_config()" from a > psql session I am returned an empty recordset, which is what I would > expect. The following is from the nagios log. Does anyone have any > thoughts, I really need to get this back online. > Thanks, Bob > > [1110500709] Nagios 2.0b1 starting... (PID=5391) > [1110500709] LOG VERSION: 2.0 > [1110500709] initializing nagios-db postgres inserter... > [1110500709] nagios-db: inserter locked into db > [1110500709] Event broker module '/usr/local/nagios/bin/inserter.o' > initialized successfully. > [1110500709] Warning: Host 'kcwebwt1' has no services associated with it! > [1110500709] Warning: Contact 'brian' is not a member of any contact groups! > [1110500709] Warning: Contact 'cheikh' is not a member of any contact > groups! > [1110500709] Warning: Contact 'dwain' is not a member of any contact groups! > [1110500709] Warning: Contact 'eric' is not a member of any contact groups! > [1110500709] Warning: Contact 'john' is not a member of any contact groups! > [1110500709] Warning: Contact 'karen' is not a member of any contact groups! > [1110500709] Warning: Contact 'liz' is not a member of any contact groups! > [1110500709] Warning: Contact 'robert' is not a member of any contact > groups! > [1110500709] Warning: Contact 'russ' is not a member of any contact groups! > [1110500709] Warning: Contact 'scott' is not a member of any contact groups! > [1110500709] Warning: Contact 'van' is not a member of any contact groups! > [1110500709] Warning: Contact group 'nagios-setup' is not used in any > hostgroup/service definitions or host/hostgroup/service escala > tions! > [1110500709] Finished daemonizing... (New PID=5393) > [1110500709] nagios-db: couldn't clear config info () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure ho' ( > ) > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > us' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > us' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > us' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > us' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > us' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > ' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host' > () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > ' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > usi' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > us' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > usi' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > u' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > u' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > us' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > us' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > us' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > us' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > usi' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > using 'nag' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > using 'nag' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > using 'na' () > [1110500709] nagios-db: couldn't configure host using 'nagios-db: > couldn't configure host using 'nagios-db: couldn't configure host > using' () > [1110500709] nagios-db: configured 23 hosts > [1110500709] nagios-db: couldn't configure hostgroup using 'nagios-db: > couldn't configure hostgroup using 'nagios' () > [1110500709] Caught SIGSEGV, shutting down... > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > |
From: Robert B. <rbi...@na...> - 2005-03-11 01:12:33
|
I had nagios 2.0b1 working with nagios-db on RHEL3. I decided to upgrade to 2.0b2 and pulled the latest nagios-db code from cvs. Everything compiled fine, dropped the db and recreated the db with the new schema, but nagios would not start with the neb module. So then I pulled the 0.91 archive, same problem. After deciding to roll back to 2.0b1 and the nagios-db cvs snapshot that I had working previously, I am still throwing the same errors. If I run the "select empty_config()" from a psql session I am returned an empty recordset, which is what I would expect. The following is from the nagios log. Does anyone have any thoughts, I really need to get this back online. Thanks, Bob [1110500709] Nagios 2.0b1 starting... (PID=5391) [1110500709] LOG VERSION: 2.0 [1110500709] initializing nagios-db postgres inserter... [1110500709] nagios-db: inserter locked into db [1110500709] Event broker module '/usr/local/nagios/bin/inserter.o' initialized successfully. [1110500709] Warning: Host 'kcwebwt1' has no services associated with it! [1110500709] Warning: Contact 'brian' is not a member of any contact groups! [1110500709] Warning: Contact 'cheikh' is not a member of any contact groups! [1110500709] Warning: Contact 'dwain' is not a member of any contact groups! [1110500709] Warning: Contact 'eric' is not a member of any contact groups! [1110500709] Warning: Contact 'john' is not a member of any contact groups! [1110500709] Warning: Contact 'karen' is not a member of any contact groups! [1110500709] Warning: Contact 'liz' is not a member of any contact groups! [1110500709] Warning: Contact 'robert' is not a member of any contact groups! [1110500709] Warning: Contact 'russ' is not a member of any contact groups! [1110500709] Warning: Contact 'scott' is not a member of any contact groups! [1110500709] Warning: Contact 'van' is not a member of any contact groups! [1110500709] Warning: Contact group 'nagios-setup' is not used in any hostgroup/service definitions or host/hostgroup/service escala tions! [1110500709] Finished daemonizing... (New PID=5393) [1110500709] nagios-db: couldn't clear config info () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure ho' ( ) [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host ' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host ' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host usi' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host usi' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host u' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host u' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host usi' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nag' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nag' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'na' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using' () [1110500709] nagios-db: configured 23 hosts [1110500709] nagios-db: couldn't configure hostgroup using 'nagios-db: couldn't configure hostgroup using 'nagios' () [1110500709] Caught SIGSEGV, shutting down... |
From: Robert B. <rbi...@cy...> - 2005-03-11 00:45:40
|
I had nagios 2.0b1 working with nagios-db on RHEL3. I decided to upgrade to 2.0b2 and pulled the latest nagios-db code from cvs. Everything compiled fine, dropped the db and recreated the db with the new schema, but nagios would not start with the neb module. So then I pulled the 0.91 archive, same problem. After deciding to roll back to 2.0b1 and the nagios-db cvs snapshot that I had working previously, I am still throwing the same errors. If I run the "select empty_config()" from a psql session I am returned an empty recordset, which is what I would expect. The following is from the nagios log. Does anyone have any thoughts, I really need to get this back online. Thanks, Bob [1110500709] Nagios 2.0b1 starting... (PID=5391) [1110500709] LOG VERSION: 2.0 [1110500709] initializing nagios-db postgres inserter... [1110500709] nagios-db: inserter locked into db [1110500709] Event broker module '/usr/local/nagios/bin/inserter.o' initialized successfully. [1110500709] Warning: Host 'kcwebwt1' has no services associated with it! [1110500709] Warning: Contact 'brian' is not a member of any contact groups! [1110500709] Warning: Contact 'cheikh' is not a member of any contact groups! [1110500709] Warning: Contact 'dwain' is not a member of any contact groups! [1110500709] Warning: Contact 'eric' is not a member of any contact groups! [1110500709] Warning: Contact 'john' is not a member of any contact groups! [1110500709] Warning: Contact 'karen' is not a member of any contact groups! [1110500709] Warning: Contact 'liz' is not a member of any contact groups! [1110500709] Warning: Contact 'robert' is not a member of any contact groups! [1110500709] Warning: Contact 'russ' is not a member of any contact groups! [1110500709] Warning: Contact 'scott' is not a member of any contact groups! [1110500709] Warning: Contact 'van' is not a member of any contact groups! [1110500709] Warning: Contact group 'nagios-setup' is not used in any hostgroup/service definitions or host/hostgroup/service escala tions! [1110500709] Finished daemonizing... (New PID=5393) [1110500709] nagios-db: couldn't clear config info () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure ho' ( ) [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host ' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host ' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host usi' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host usi' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host u' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host u' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host us' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host usi' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nag' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nag' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'na' () [1110500709] nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using 'nagios-db: couldn't configure host using' () [1110500709] nagios-db: configured 23 hosts [1110500709] nagios-db: couldn't configure hostgroup using 'nagios-db: couldn't configure hostgroup using 'nagios' () [1110500709] Caught SIGSEGV, shutting down... |
From: Joubin M. <jm...@sh...> - 2005-03-08 19:39:46
|
> Okay looks like commenting out the loading of the helloworld > module in > the main nagios config fixes the problem for me. > > Give that a whirl. > > - Matt > Awesome... that did the trick! Thanks. |
From: Ben <be...@si...> - 2005-03-08 04:28:17
|
Perhaps nagios doesn't gracefully handle multiple NEB modules if they register for the same callbacks? On Mar 7, 2005, at 5:13 PM, Matthew Kent wrote: > Okay looks like commenting out the loading of the helloworld module in > the main nagios config fixes the problem for me. Guess something in > that > module is getting in the way. I'll take a look at why sometime down the > road. > > Give that a whirl. > > - Matt > > On Fri, 2005-03-04 at 14:24, Matthew Kent wrote: >> On Fri, 2005-04-03 at 10:55 -0800, Joubin Moshrefzadeh wrote: >>> oops, so I mistakenly posted this to nagios-users... >>> In response to Matt, yes, the config passes the preflight and in >>> fact the Nagios UI shows everything's working and... but for some >>> reason the mysql module can't initialize... would posting my configs >>> help? >>> >> >> Interesting.. wonder why it's not seeing the nagios data like that. >> Did >> the module compile cleanly? And your using the 2.0 beta 2 from >> nagios.org or latest cvs release? >> >> And yeah if you could forward your configs to me off list I can take a >> stab at figuring it out. I'll try to make time on Sunday but I've just >> been getting bogged down with so much other stuff lately. >> >> - Matt >> >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real >> users. >> Discover which products truly live up to the hype. Start reading now. >> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >> _______________________________________________ >> Nagios-db-devel mailing list >> Nag...@li... >> https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |
From: Matthew K. <mk...@ma...> - 2005-03-08 03:13:27
|
Okay looks like commenting out the loading of the helloworld module in the main nagios config fixes the problem for me. Guess something in that module is getting in the way. I'll take a look at why sometime down the road. Give that a whirl. - Matt On Fri, 2005-03-04 at 14:24, Matthew Kent wrote: > On Fri, 2005-04-03 at 10:55 -0800, Joubin Moshrefzadeh wrote: > > oops, so I mistakenly posted this to nagios-users... > > In response to Matt, yes, the config passes the preflight and in fact the Nagios UI shows everything's working and... but for some reason the mysql module can't initialize... would posting my configs help? > > > > Interesting.. wonder why it's not seeing the nagios data like that. Did > the module compile cleanly? And your using the 2.0 beta 2 from > nagios.org or latest cvs release? > > And yeah if you could forward your configs to me off list I can take a > stab at figuring it out. I'll try to make time on Sunday but I've just > been getting bogged down with so much other stuff lately. > > - Matt > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |
From: Matthew K. <mk...@ma...> - 2005-03-04 19:24:29
|
On Fri, 2005-04-03 at 10:55 -0800, Joubin Moshrefzadeh wrote: > oops, so I mistakenly posted this to nagios-users... > In response to Matt, yes, the config passes the preflight and in fact the Nagios UI shows everything's working and... but for some reason the mysql module can't initialize... would posting my configs help? > Interesting.. wonder why it's not seeing the nagios data like that. Did the module compile cleanly? And your using the 2.0 beta 2 from nagios.org or latest cvs release? And yeah if you could forward your configs to me off list I can take a stab at figuring it out. I'll try to make time on Sunday but I've just been getting bogged down with so much other stuff lately. - Matt |
From: Joubin M. <jm...@sh...> - 2005-03-04 18:56:05
|
oops, so I mistakenly posted this to nagios-users... In response to Matt, yes, the config passes the preflight and in fact the Nagios UI shows everything's working and... but for some reason the mysql module can't initialize... would posting my configs help? On Tue, 2005-01-03 at 08:27 -0800, Joubin Moshrefzadeh wrote: > I'm having some challenges getting nagios-db working properly. > > I've installed Nagios 2.0b2, and nagios-db-0.91 on a Debian box, plus mysql-4.1.9 through apt, and using the minimal config shipped with version 2.0. > > For some reason I keep getting the following message in the nagios log when I start the process: > > [1109693638] Nagios 2.0b2 starting... (PID=1957) > [1109693638] LOG VERSION: 2.0 > [1109693638] initializing nagios-db mysql inserter... > [1109693638] nagios-db: inserter locked into db > [1109693638] Event broker module '/usr/local/nagios/modules/inserter_mysql.o' initialized successfully. > [1109693638] nagios-db: configured 0 hosts > [1109693638] nagios-db: configured 0 services > [1109693638] nagios-db: loaded 0 hostgroups > [1109693638] nagios-db: configuration complete. Registering for status notifications... > [1109693638] Finished daemonizing... (New PID=1959) > [1109693639] Can't find record in 'host_history' 1032 INSERT INTO host_history (hostid,started,lasted,soft_state,hard_state,current_attempt,plugin_output) VALUES (@hostid,@time,null,0,0,1,'PING OK - Packet loss = 0%, RTA = 0.38 ms') ON DUPLICATE KEY UPDATE current_attempt=VALUES(current_attempt),plugin_output=VALUES(plugin_output) > [1109693648] nagios-db: inserter unloading... > Well this is the wrong list for this, please continue this discussion on nag...@li... As for the problem, I'm not sure why it's not seeing your host/service data in the initialization phase. Does your config pass the pre-flight check (nagios -v nagios.cfg) ? - matt |
From: Matthew K. <mk...@ma...> - 2005-03-01 18:26:47
|
On Tue, 2005-01-03 at 08:27 -0800, Joubin Moshrefzadeh wrote: > I'm having some challenges getting nagios-db working properly. > > I've installed Nagios 2.0b2, and nagios-db-0.91 on a Debian box, plus mysql-4.1.9 through apt, and using the minimal config shipped with version 2.0. > > For some reason I keep getting the following message in the nagios log when I start the process: > > [1109693638] Nagios 2.0b2 starting... (PID=1957) > [1109693638] LOG VERSION: 2.0 > [1109693638] initializing nagios-db mysql inserter... > [1109693638] nagios-db: inserter locked into db > [1109693638] Event broker module '/usr/local/nagios/modules/inserter_mysql.o' initialized successfully. > [1109693638] nagios-db: configured 0 hosts > [1109693638] nagios-db: configured 0 services > [1109693638] nagios-db: loaded 0 hostgroups > [1109693638] nagios-db: configuration complete. Registering for status notifications... > [1109693638] Finished daemonizing... (New PID=1959) > [1109693639] Can't find record in 'host_history' 1032 INSERT INTO host_history (hostid,started,lasted,soft_state,hard_state,current_attempt,plugin_output) VALUES (@hostid,@time,null,0,0,1,'PING OK - Packet loss = 0%, RTA = 0.38 ms') ON DUPLICATE KEY UPDATE current_attempt=VALUES(current_attempt),plugin_output=VALUES(plugin_output) > [1109693648] nagios-db: inserter unloading... > Well this is the wrong list for this, please continue this discussion on nag...@li... As for the problem, I'm not sure why it's not seeing your host/service data in the initialization phase. Does your config pass the pre-flight check (nagios -v nagios.cfg) ? - matt |
From: Matthew K. <mk...@ma...> - 2005-02-25 15:28:13
|
This isn't the list for this question, please keep keep it to nag...@li... The problem is that Solaris doesn't have asprintf from what I understand (my initial quick hack of a module and testing have been limited to Linux only). I'll work on something temporary this weekend but do plan on cleaning it up a lot in the future. - Matt On Thu, 2005-24-02 at 09:25 -0700, Winkles, William (Bill) wrote: > Can anyone shed some light on getting the NEB module working? > > > > When I run make, I keep getting: > > > > gcc -g -O2 -Wall -o inserter.o inserter.c -shared > -I/export/home/billy/nagios-2. > > 0b2/include -I/usr/local/mysql/include -lmysqlclient -fPIC > > inserter.c: In function `loadconfig': > > inserter.c:182: warning: implicit declaration of function `asprintf' > > Text relocation remains referenced > > against symbol offset in file > > <unknown> > 0x1f8 /usr/local/lib/gcc/sparc-sun-sol > > aris2.9/3.4.1/../../../libmysqlclient.a(libmysql.o) > > <unknown> > 0x1fc /usr/local/lib/gcc/sparc-sun-sol > > aris2.9/3.4.1/../../../libmysqlclient.a(libmysql.o) > > <unknown> > 0x200 /usr/local/lib/gcc/sparc-sun-sol > > aris2.9/3.4.1/../../../libmysqlclient.a(libmysql.o) > > > > And it just keeps scrolling………… > > > > I’m trying to compile this on Solaris 9 > > > > Any ideas? > > > > > > Thanks. > > > > Bill > > -- Matthew Kent <mk...@ma...> http://magoazul.com |
From: Ben <be...@si...> - 2005-02-23 20:37:37
|
Not really, but then, I didn't do the mysql NEB. Perhaps Matthew Kent can chime in about his baby..... On Wed, 23 Feb 2005, Winkles, William (Bill) wrote: > Ben, > > I grabbed makefile and inserter.c from neb/mysql in the Nagios-DB CVS > repository. I edited the makefile to point to my nagios-source/include > directory and I pointed it to my mysql include directory. When I run make, > I keep getting: > > gcc -g -O2 -Wall -o inserter.o inserter.c -shared > -I/export/home/billy/nagios-2. > 0b2/include -I/usr/local/mysql/include -lmysqlclient -fPIC > inserter.c: In function `loadconfig': > inserter.c:182: warning: implicit declaration of function `asprintf' > Text relocation remains referenced > against symbol offset in file > <unknown> 0x1f8 > /usr/local/lib/gcc/sparc-sun-sol > aris2.9/3.4.1/../../../libmysqlclient.a(libmysql.o) > <unknown> 0x1fc > /usr/local/lib/gcc/sparc-sun-sol > aris2.9/3.4.1/../../../libmysqlclient.a(libmysql.o) > <unknown> 0x200 > /usr/local/lib/gcc/sparc-sun-sol > aris2.9/3.4.1/../../../libmysqlclient.a(libmysql.o) > > And it just keeps scrolling. > > Any ideas? > > > Thanks again. > > Bill > > > -----Original Message----- > From: Ben [mailto:be...@si...] > Sent: Wednesday, February 23, 2005 12:35 PM > To: Winkles, William (Bill) > Subject: RE: [Nagios-devel] Reporting Trends on a Host Group > > Oh. heh. I didn't really go into too much detail there, did I? Go to > neb/mysql/, see if the makefile needs to be modified for your system, and > run make. It should compile the neb into an inserter.o file, which you > then place somewhere (I keep it with the nagios executable), and then you > configure nagios to load that file as a neb. Make sense? > > On Wed, 23 Feb 2005, Winkles, William (Bill) wrote: > > > > > Ben, > > > > That is the problem. Where can I find some details about compiling neb? > > > > Thanks. > > > > Bill > > > > > > -----Original Message----- > > From: Ben [mailto:be...@si...] > > Sent: Wednesday, February 23, 2005 11:39 AM > > To: Winkles, William (Bill) > > Subject: RE: [Nagios-devel] Reporting Trends on a Host Group > > > > Did you configure the neb in nagios.cfg? For that matter, did you compile > > the neb? > > > > Note that the neb currently takes no arguments, so you'll have to hardcode > > > the database connection parameters into the neb. Look at > > nebmodule_init().... it should be pretty straightforward. > > > > On Wed, 23 Feb 2005, Winkles, William (Bill) wrote: > > > > > Ben, > > > > > > I am hoping you may be able to give me some direction here. > > > > > > I have compiled Nagios 2.0b2 with: > > > *** Configuration summary for nagios 2.0b2 02-09-2005 ***: > > > > > > General Options: > > > ------------------------- > > > Nagios executable: nagios > > > Nagios user/group: nagios,nagios > > > Command user/group: nagios,nagcmd > > > Embedded Perl: yes, with caching > > > Event Broker: yes > > > Install ${prefix}: /usr/local/nagios > > > Lock file: ${prefix}/var/nagios.lock > > > Init directory: /etc/init.d > > > Host OS: solaris2.9 > > > > > > Web Interface Options: > > > ------------------------ > > > HTML URL: http://localhost/nagios/ > > > CGI URL: http://localhost/nagios/cgi-bin/ > > > Traceroute (used by WAP): /usr/sbin/traceroute > > > > > > > > > I created a mysql 4.1 DB called nagios and created all the > > > Tables using the CSV schema.sql 1.3. > > > > > > I also installed php-4.3.10. > > > > > > Everything is up and running fine, but I am not sure how to make the NEB > > > start feeding my DB. It seems like I should be putting some PHP files > or > > a > > > directory on my web server, but I'm not exactly sure what to do from > here. > > > I see in the CSV repository that there is a Neb and UI directory, but I > > > don't know what I need to complete this. > > > > > > Any help is greatly appreciated. > > > > > > Thanks. > > > > > > Bill > > > > > > > > > > > > > > > -----Original Message----- > > > From: Ben [mailto:be...@si...] > > > Sent: Tuesday, February 22, 2005 2:24 PM > > > To: Winkles, William (Bill) > > > Cc: nag...@li... > > > Subject: RE: [Nagios-devel] Reporting Trends on a Host Group > > > > > > Sorry, no, it's Nagios 2 only. It does support mysql, though. > > > > > > On Tue, 22 Feb 2005, Winkles, William (Bill) wrote: > > > > > > > Ben, > > > > > > > > Thanks for the good info. I will start playing with this package > > tonight. > > > > > > > > I currently have Nagios 1.2 compiled with MySQL. I'm assuming that > this > > > > will work with 1.2, do you know? > > > > > > > > Thanks again. > > > > > > > > Bill > > > > > > > > -----Original Message----- > > > > From: Ben [mailto:be...@si...] > > > > Sent: Tuesday, February 22, 2005 2:01 PM > > > > To: Winkles, William (Bill) > > > > Cc: nag...@li... > > > > Subject: Re: [Nagios-devel] Reporting Trends on a Host Group > > > > > > > > I do this, but I'm running Nagios 2 with the Nagios-DB stuff. Because > > all > > > > the availability data is kept in SQL, it makes harvesting data for > such > > > > reports pretty easy. > > > > > > > > http://sourceforge.net/projects/nagios-db/ > > > > > > > > Nagios-DB was designed to replace the CGI interface, but it doesn't > > modify > > > > > > > them at all, so you could keep using them if you want, and just pull > > data > > > > out of the database when you want to run special reports. > > > > > > > > On Tue, 22 Feb 2005, Winkles, William (Bill) wrote: > > > > > > > > > All, > > > > > > > > > > > > > > > > > > > > I am interested in using the Nagios Reporting Trends on a host > group. > > I > > > > > understand that it would take some time to generate the graphs for > all > > > of > > > > > the hosts in the host group, but it seems better than manually doing > > it > > > 1 > > > > > host at a time. > > > > > > > > > > > > > > > > > > > > Has anyone done this in the past? It doesn't necessarily have to be > > > > > reported in the web interface. I could create the reports with an > > > > outputted > > > > > txt or csv file. > > > > > > > > > > > > > > > > > > > > Any help or suggestions are appreciated. > > > > > > > > > > > > > > > > > > > > Thanks. > > > > > > > > > > > > > > > > > > > > Bill > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
From: Ben <be...@si...> - 2005-02-23 16:36:00
|
Hm, yeah, I figured I probably should have added an upgrade script, but being the lazy person I am..... I'll see what I can do today. The short answer is that, yes, an upgrade should be possible, but my brain has been many other places since I released 0.91 and there may be something I'm forgetting. On Feb 23, 2005, at 5:56 AM, Mauri Sahlberg wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > (As this list seemed to have as many as 7 subscribers before me, I > thought it might be polite to warn about my existence. Please consider > yourselves warned. ;-) > > Just updated from 2.0b1 to 2.0b2 and found out that it immediately > crashed with old neb-version. So, downloaded 0.91 version and was a > little bit disappointed of lack of upgrade instructions and scripts. > Are any planned? Is upgrading even possible? > > I got the 0.91 version working with new database and would like to > merge old data with new data but I have no idea what kind of task it > would be. Any adwise on the matter? > > We use availlability data collected by nagios and request-tracker > collected request-data to create a monthly "service level report" for > our customers. And the end of the February draws close, I have to make > a decision if the next report will be on the end of the March or on > the end of this month. > > Regards, > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.6 (GNU/Linux) > Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org > > iD8DBQFCHIuNdraPhRSjnAoRAvADAJ0R3feg7unnUfhP1nTuNYf1W3c65wCeIcyq > tRkxafIK9hFsaKKZdZ2SOMk= > =Wuol > -----END PGP SIGNATURE----- > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |
From: Mauri S. <Mau...@pr...> - 2005-02-23 13:56:32
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, (As this list seemed to have as many as 7 subscribers before me, I thought it might be polite to warn about my existence. Please consider yourselves warned. ;-) Just updated from 2.0b1 to 2.0b2 and found out that it immediately crashed with old neb-version. So, downloaded 0.91 version and was a little bit disappointed of lack of upgrade instructions and scripts. Are any planned? Is upgrading even possible? I got the 0.91 version working with new database and would like to merge old data with new data but I have no idea what kind of task it would be. Any adwise on the matter? We use availlability data collected by nagios and request-tracker collected request-data to create a monthly "service level report" for our customers. And the end of the February draws close, I have to make a decision if the next report will be on the end of the March or on the end of this month. Regards, -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCHIuNdraPhRSjnAoRAvADAJ0R3feg7unnUfhP1nTuNYf1W3c65wCeIcyq tRkxafIK9hFsaKKZdZ2SOMk= =Wuol -----END PGP SIGNATURE----- |
From: Matthew K. <mk...@ma...> - 2005-02-17 22:45:29
|
Very incomplete! I've been doing a lot of work on getting the interface right and expect to send up a big whack of changes soon. http://magoazul.com/tmp/nagdb1.jpg http://magoazul.com/tmp/nagdb2.jpg Gimp blurred the crap out of them, but you get the idea. What I've done is add another grouping level above hostgroups, one purely for organizing the display, keeping the size of the generated html down and generating reports/overviews for a group of hostgroups. The end result hopefully being something like a typical file manager display whereas you click on a hostgroup/group of hostgroups in the left nav and are presented with a list of hosts or hostgroups on the right side of the screen. From there you could either zoom in for a closer look at a particular server/group, or click one of the other links to 'generate availability report', 'tac overview for these hostgroups' etc. I'm sure it'll take some tweaking to come up with something decent. So after I get a bit more done on the navigation I'll look at incorporating some of the work you've done into the interface to make it actually do something :) After that it might be worth putting together a small website in the sourceforge space with some screen shots to see if we can drum up some support from php developers interested in making this a more polished project (not to mention correcting any brutal errors I've made in writing php). - Matt On Thu, 2005-17-02 at 13:12 -0800, Ben wrote: > [client 10.146.3.60] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/ui/templates/default.tpl on line 82 > [client 10.146.3.60] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/ui/templates/default.tpl on line 105 > [client 10.146.3.60] PHP Notice: Undefined variable: h_pending in /var/www/html/ui/templates/default.tpl on line 152 > [client 10.146.3.60] PHP Notice: Undefined variable: s_pending in /var/www/html/ui/templates/default.tpl on line 182 > [client 10.146.3.60] PHP Notice: Undefined variable: timestamp in /var/www/html/ui/templates/default.tpl on line 187 > > > Line 82 of default.tpl tries to loop through $navbar_hosts, so.... > > > [root@redhat ui]# grep navbar_hosts * > [root@redhat ui]# grep navbar_hosts */* > templates/default.tpl: foreach ($navbar_hosts as $out) { > [root@redhat ui]# > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |
From: Ben <be...@si...> - 2005-02-17 21:12:35
|
[client 10.146.3.60] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/ui/templates/default.tpl on line 82 [client 10.146.3.60] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/ui/templates/default.tpl on line 105 [client 10.146.3.60] PHP Notice: Undefined variable: h_pending in /var/www/html/ui/templates/default.tpl on line 152 [client 10.146.3.60] PHP Notice: Undefined variable: s_pending in /var/www/html/ui/templates/default.tpl on line 182 [client 10.146.3.60] PHP Notice: Undefined variable: timestamp in /var/www/html/ui/templates/default.tpl on line 187 Line 82 of default.tpl tries to loop through $navbar_hosts, so.... [root@redhat ui]# grep navbar_hosts * [root@redhat ui]# grep navbar_hosts */* templates/default.tpl: foreach ($navbar_hosts as $out) { [root@redhat ui]# |
From: Matthew K. <mk...@ma...> - 2005-02-01 16:33:35
|
On Mon, 2005-31-01 at 22:51 -0800, Ben wrote: > On Mon, 31 Jan 2005, Matthew Kent wrote: > > > For the changelog > > - mysql support back up to par with postgres > > - mysql neb up to par with postgres > > - work on new gui begun > > Nice. Will the new gui be ready for inclusion, or should we just keep it > out of the file release entirely? I'd keep it out completely, or at least the index.php's I added to avoid confusion between index.html. A good working version of the new interface is still a while off, but the wait will be worth it if I can pull of some ideas I have :) I'll show you what I'm trying to do when I get more of the layout completed. And thanks for the other changes. - Matt |
From: Ben <be...@si...> - 2005-02-01 06:51:21
|
On Mon, 31 Jan 2005, Matthew Kent wrote: > For the changelog > - mysql support back up to par with postgres > - mysql neb up to par with postgres > - work on new gui begun Nice. Will the new gui be ready for inclusion, or should we just keep it out of the file release entirely? > Couple admin related things > - Could the checkins emails be changed to send unified diffs instead of > the standard diff output? Er, yeah..... I was just blindly following the sourceforge guide on how to do diffs on checkin. I'll see about making them unified. > - Could the project be reclassified in sourceforge as having mysql > support? Done. I also specified PHP Pear support. |
From: Matthew K. <mk...@ma...> - 2005-02-01 06:20:06
|
On Mon, 2005-01-31 at 12:57, Ben wrote: > ...this time for real. So if you want a feature to be in there, make it > work by thursday and I'll try to build a changelog for friday. > For the changelog - mysql support back up to par with postgres - mysql neb up to par with postgres - work on new gui begun Couple admin related things - Could the checkins emails be changed to send unified diffs instead of the standard diff output? - Could the project be reclassified in sourceforge as having mysql support? -- Matthew Kent <mk...@ma...> http://magoazul.com |
From: Ben <be...@si...> - 2005-01-31 17:57:20
|
...this time for real. So if you want a feature to be in there, make it work by thursday and I'll try to build a changelog for friday. |
From: Ben <be...@si...> - 2005-01-28 16:44:24
|
The list has had much delay for the last few days. On Thu, 27 Jan 2005, Matthew Kent wrote: > Didn't get a copy of the last couple messages I sent... > -- > Matthew Kent \ SA \ bravenet.com > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > |
From: Ben <be...@si...> - 2005-01-27 21:56:42
|
Actually, I lied. I read "current_notification_numer" as "current_attempt", and thought that for some reason I wasn't updating that. Well, I am, and like you say, I'm not touching current_notification_number. I think the reason I'm not is because I didn't find it important. It's in the schema because at some point every possible metric was in the schema, and I whittled them down to what I thought mattered. This wasn't one of them, but apparently I forgot to delete it. I guess the question to ask is: how is this useful data to see? If we cared about notifications at all, why not register for notification events and simply record those? On Wed, 26 Jan 2005, Matthew Kent wrote: > Noticed it's defined in the postgres schema but not updated by the > stored proc, not sure if that's on purpose. > > Work continues.. :) > -- > Matthew Kent <mk...@ma...> > http://magoazul.com > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > |