NPC not showing Nagios Status on UI

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
jdovidio
Posts: 14
Joined: Wed Jul 29, 2009 11:53 am
Location: Argentina

NPC not showing Nagios Status on UI

Post by jdovidio »

Hello:

I've been working with NPC for quiet some time now (thanks for this great tool) mostly with just minor (fixeable) problems. Always running cacti + nagios + mysql on the same server.

A few days ago, I started working on a separate DB instance so basically:

Server A: Cacti + Nagios + NDO
Server B: MySQL (percona) DB

Everything seems to be working as before except just for one thing, since I started using a remote DB, I can't see the Nagios Status on the NPC Dashboard (the screenshot will explain what I mean).

I have no idea how NPC does to get this data. Does it get it from the DB? at first I though it was my install that was wrong, but I just finished a completely new install in a completely different environment and had the same behavior.
I haven't done too much debugging just yet, but while I debug the problem I was wondering if someone can give me any tip.

My Config:
cacti 0.8.7e
PA: 2.5
NPC: 2.0.4
$config['url_path']=/cacti/


Javier.
Attachments
npc_screen.png
npc_screen.png (52.94 KiB) Viewed 1443 times
[url=http://docs.cacti.net/manual:087:4_help.2_debugging#debugging]Debugging Cacti[/url]
User avatar
jdovidio
Posts: 14
Joined: Wed Jul 29, 2009 11:53 am
Location: Argentina

Post by jdovidio »

Ok, so far I got to the URL that gets the status:

npc.php?module=nagios&action=getProgramStatus
and I got the following:

On the working instance:

Code: Select all

{"totalCount":1,"data":[{"programstatus_id":"109927","instance_id":"1","status_update_time":"2009-08-13 04:06:08","program_start_time":"2009-08-13 00:58:12","program_end_time":"0000-00-00 00:00:00","is_currently_running":"1","process_id":"1945","daemon_mode":"1","last_command_check":"2009-08-13 04:06:08","last_log_rotation":"1970-01-01 01:00:00","notifications_enabled":"1","active_service_checks_enabled":"1","passive_service_checks_enabled":"1","active_host_checks_enabled":"1","passive_host_checks_enabled":"1","event_handlers_enabled":"1","flap_detection_enabled":"1","failure_prediction_enabled":"1","process_performance_data":"1","obsess_over_hosts":"0","obsess_over_services":"0","modified_host_attributes":"0","modified_service_attributes":"0","global_host_event_handler":"","global_service_event_handler":"","server_time":"2009-08-13 04:12:36","program_version":"3.0.6"}]}
On the dodgy instance:

Code: Select all

{"totalCount":2,"data":[{"programstatus_id":"1","instance_id":"0","status_update_time":"2009-08-13 06:08:18","program_start_time":"2009-08-13 05:31:06","program_end_time":"0000-00-00 00:00:00","is_currently_running":"1","process_id":"13016","daemon_mode":"1","last_command_check":"2009-08-13 06:08:18","last_log_rotation":"1970-01-01 01:00:00","notifications_enabled":"1","active_service_checks_enabled":"1","passive_service_checks_enabled":"1","active_host_checks_enabled":"1","passive_host_checks_enabled":"1","event_handlers_enabled":"1","flap_detection_enabled":"1","failure_prediction_enabled":"1","process_performance_data":"1","obsess_over_hosts":"0","obsess_over_services":"0","modified_host_attributes":"0","modified_service_attributes":"0","global_host_event_handler":"","global_service_event_handler":"","server_time":"2009-08-13 07:11:48","program_version":null},{"programstatus_id":"2","instance_id":"1","status_update_time":"2009-08-13 07:11:48","program_start_time":"2009-08-13 06:09:06","program_end_time":"0000-00-00 00:00:00","is_currently_running":"1","process_id":"13259","daemon_mode":"1","last_command_check":"2009-08-13 07:11:48","last_log_rotation":"1970-01-01 01:00:00","notifications_enabled":"1","active_service_checks_enabled":"1","passive_service_checks_enabled":"1","active_host_checks_enabled":"1","passive_host_checks_enabled":"1","event_handlers_enabled":"1","flap_detection_enabled":"1","failure_prediction_enabled":"1","process_performance_data":"1","obsess_over_hosts":"0","obsess_over_services":"0","modified_host_attributes":"0","modified_service_attributes":"0","global_host_event_handler":"","global_service_event_handler":""}]}
You will notice that the totalCount is different. Looking at the npc/controllers/nagios.php I notice that it gets the process information from the database (npc_programstatus table) so I went there and saw two rows. I just deleted the older one leaving just one with the information of the last nagios restart and everything start working (I can now see the process information on the UI)

Now, I'm guessing this is something related to NDOUtil instead of NPC so sorry for the noice. :-)

While I find out what's wrong with NDO I will just add a quick (and nasty) workaround to delete all rows but the last created from that table. :-)


Regards.
Javier.
[url=http://docs.cacti.net/manual:087:4_help.2_debugging#debugging]Debugging Cacti[/url]
Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests