Nagios Plugin for Cacti (NPC) 2.0.4

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
Bryant
Posts: 4
Joined: Wed May 30, 2007 12:02 pm

Post by Bryant »

No problem, and thank you again for the excellent plugin.
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Performance tuning/tweak

Post by DarkMan »

NPC is working great here (well almost, still haven't corrected my graphic glitch). I currently have 30 monitored host with 327 services check. They all work but the status refresh is rather slow and consume a lot of CPU time. Most of it is spent within Apache.

MySQL seems rather fast and I've tweaked it to ran fast with Cacti so I don't think to main issue is there.

Anyone else see that kind of behavior? Suggestion?
pretender01
Posts: 3
Joined: Thu Jun 18, 2009 11:19 am

Post by pretender01 »

Hi,
I have installed NPC whith Cacti, it works good but i woul like generate graph by using the DataInputModem as my nagios script use perfdata !

Do you know how i can do this graph ?

thanks you in advance

best regards
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

There was a post explaining how to do this but I can't find it anymore.

In short, from NPC, click on the Data Input button (from the service you want to graph) and create the data input. Then go back to your Cacti console, you should see the new method in the Data Input Methods section. You can then create a new Data Template and a Graph Template using your new NPC Data input. Did a few graph, works rather well.

Wow I'm blind : http://forums.cacti.net/post-167082.html#167082
Last edited by DarkMan on Thu Jul 23, 2009 11:41 am, edited 1 time in total.
ltarkkal
Posts: 1
Joined: Wed Jul 22, 2009 3:57 pm

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by ltarkkal »

divagater wrote:Download NPC 2.0.4

NOTE: If you are upgrading there is a sql file in the root of plugins/npc called upgrade_schema.sql. Run this against your cacti database. It adds a handful of indexes to the npc tables. Skip this if doing a clean install.
I tried out NPC 2.04 with Cacti 0.87 and got it to work. I used ndoutils-1.4b8 which caused a bit of a headache. A new feature of b8 (see db/mysql-upgrade-1.4b8.sql) is that it expects the "long_output" field to be in every table.

NPC in setup.php ofcourse drops these tables and recreates them, and the long_output is missing, causing ndo2db INSERTs to fail. Re-running a patched version of db/mysql-upgrade-1.4b8.sql after the "setup.php" had been executed by cacti+npc works around the problem.
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by divagater »

ltarkkal wrote:I tried out NPC 2.04 with Cacti 0.87 and got it to work. I used ndoutils-1.4b8 which caused a bit of a headache. A new feature of b8 (see db/mysql-upgrade-1.4b8.sql) is that it expects the "long_output" field to be in every table.

NPC in setup.php ofcourse drops these tables and recreates them, and the long_output is missing, causing ndo2db INSERTs to fail. Re-running a patched version of db/mysql-upgrade-1.4b8.sql after the "setup.php" had been executed by cacti+npc works around the problem.
Thanks for the note. NDOUtils 1.4b7 is listed as a requirement because I expected things would change when a new ndoutils came out which has not happened in a very long time.

I will add support for b8 in the next release do in 2 - 3 weeks. Was hoping for end of this month but I am moving.

Cheers,
Billy
[url=http://forums.cacti.net/viewtopic.php?t=26540][b]NPC 2.0.4[/b][/url]
[url=http://trac2.assembla.com/npc][size=75]Trac[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=defect][size=75]Bugs[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=enhancement][size=75]Requests[/size][/url]
JoePrecious
Posts: 1
Joined: Sat Jul 25, 2009 7:08 am

Post by JoePrecious »

Hi

I've just started playing with NPC and really like the interface. I had a few installation issue, but have the plugin up and running now.

However, I'm having trouble getting graphs (although this could obviously be a Cacti issue). I defined the input methods, and can then see them listed in Cacti. I've gone through the steps to create a graph, but its missing.

It appears that there are no RRD files being created for the new input method, and I'm not sure why. I can see the RRD files for the default graphs that are installed for Cacti, but not mine.

Is there a specific step I've missed to get this working? I think the permissions on my rra folder are fine.

Thanks

Joe

Quick update: I've played with my permissions and crontab as I realised the sample RRDs weren't updating. These are now being updated by the poller every five minutes. Its also now created an RRD for my NPC data source, but this doesn't seem to be updating and I still don't get a graph.

If I debug the graph in Cacti, the RRDTool Says: bit is blank, whereas for the others it says OK so something odd going on...
Chrysalis
Cacti User
Posts: 70
Joined: Fri Sep 19, 2008 10:14 am
Location: UK

Post by Chrysalis »

native nagios can have user specific permissions, am I right this plugin you either get to see all of nagios services or nothing? or is it possible to only show certian services and hosts.
spudding98
Posts: 2
Joined: Thu Aug 06, 2009 12:29 pm

Having problems with NPC not updating data in cacti

Post by spudding98 »

I have installed the following
Fedora 8
nagios 3.1.2 nagios plugins 1.4.13
ndoutils 1.4b8
i have the follwoing php modules install
php-cli-5.2.4-3
php-mysql-5.2.4-3
php-5.2.4-3
php-ldap-5.2.4-3
php-snmp-5.2.4-3
php-common-5.2.4-3
php-pdo-5.2.4-3

Mysql


mysql-devel-5.0.45-4.fc8
mysql-query-browser-5.0r12-3.fc8
mysql-server-5.0.45-4.fc8
php-mysql-5.2.4-3
mysql-5.0.45-4.fc8
mysql-gui-common-5.0r12-3.fc8
mysql-libs-5.0.45-4.fc8

ndo2db.cfg
ndo2db_user=nagios
ndo2db_group=nagios
socket_type=tcp
socket_name=/usr/local/nagios/var/ndo.sock
tcp_port=5668
db_servertype=mysql
db_host=localhost
db_port=3306
db_name=cacti
db_prefix=npc_
db_user=********** not added
db_pass=********** not added
max_timedevents_age=1440
max_systemcommands_age=10080
max_servicechecks_age=10080
max_hostchecks_age=10080
max_eventhandlers_age=44640
debug_level=2
debug_verbosity=2
debug_file=/usr/local/nagios/var/ndo2db.debug
max_debug_file_size=1000000

ndomod.cfg

instance_name=default
output_type=tcpsocket
output=127.0.0.1
tcp_port=5668
output_buffer_items=5000
buffer_file=/usr/local/nagios/var/ndomod.tmp
file_rotation_interval=14400
file_rotation_timeout=60
reconnect_interval=15
reconnect_warning_interval=15
data_processing_options=-1
config_output_options=2


I have turn on debuy mode on the broker module
e_id='1', status_update_time=FROM_UNIXTIME(1249580315), program_start_time=FROM_UNIXTIME(1249578821), is_currently_running='1', process_id='2251', daemon_mode='1', last_command_check=FROM_UNIXTIME(1249580315), last_log_rotation=FROM_UNIXTIME(0), 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='0', obsess_over_hosts='0', obsess_over_services='0', modified_host_attributes='0', modified_service_attributes='0', global_host_event_handler='', global_service_event_handler='' ON DUPLICATE KEY UPDATE instance_id='1', status_update_time=FROM_UNIXTIME(1249580315), program_start_time=FROM_UNIXTIME(1249578821), is_currently_running='1', process_id='2251', daemon_mode='1', last_command_check=FROM_UNIXTIME(1249580315), last_log_rotation=FROM_UNIXTIME(0), 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='0', obsess_over_hosts='0', obsess_over_services='0', modified_host_attributes='0', modified_service_attributes='0', global_host_event_handler='', global_service_event_handler=''

As you can see that is working

nagios log file
[1249579573] ndomod: Successfully connected to data sink. 4157 items lost, 5000 queued items to flush.
[1249579574] ndomod: Successfully flushed 5000 queued items to data sink.

I have tables populated in mysql

but when i go in the npc in cacti it say that it os started and i get information in the event log but not host information.
Please help as i am pulling my hair out.. I have the lastest npc module loaded as well
amacks
Posts: 12
Joined: Thu May 22, 2008 10:23 pm

Where to configure NDO DB?

Post by amacks »

I apologize if this is obvious, but I've got NPC installed and running, and I have NDO pushing data into my MySQL DB, but I can't figure out how to tell NPC where to find the NDO data. What am i missing??
thanks
A
dadru
Posts: 3
Joined: Tue Aug 11, 2009 12:42 am

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by dadru »

help

tail /usr/local/apache2/logs/error_log

Uncaught exception 'Doctrine_Connection_Exception' with message 'Couldn't locate driver named mysql' in /usr/local/apache2/htdocs/cacti/plugins/npc/lib/Doctrine/Connection.php:483\nStack trace:\n#0 /usr/local/apache2/htdocs/cacti/plugins/npc/lib/Doctrine/Connection/Mysql.php(101): Doctrine_Connection->connect()\n#1 /usr/local/apache2/htdocs/cacti/plugins/npc/lib/Doctrine/Connection.php(1009): Doctrine_Connection_Mysql->connect()\n#2 /usr/local/apache2/htdocs/cacti/plugins/npc/lib/Doctrine/Query/Abstract.php(986): Doctrine_Connection->execute('SELECT n.hostst...', Array)\n#3 /usr/local/apache2/htdocs/cacti/plugins/npc/lib/Doctrine/Query/Abstract.php(1030): Doctrine_Query_Abstract->_execute(Array)\n#4 /usr/local/apache2/htdocs/cacti/plugins/npc/controllers/hosts.php(140): Doctrine_Query_Abstract->execute(Array, 3)\n#5 /usr/local/apache2/htdocs/cacti/plugins/npc/npc.php(76): NpcHostsController->summary(Array)\n#6 {main}\n thrown in /usr/local/apache2/htdocs/cacti/plugins/npc/lib/Doctrine/Connection.php on line 483, referer: http://192.168.1.11/cacti/plugins/npc/n ... drawLayout
hahnn
Posts: 34
Joined: Tue Feb 03, 2009 5:46 am
Location: Luxembourg
Contact:

Post by hahnn »

Hi,

This is a really great plugin.

I also have the graph problem. I mean, no graph appears because it is looking for a php file in /var/www/html which is definitively not there but in another path. I will try to fix this directly with apache by doing some kind of rerouting.

But I also have an annoying bug.
When I display all services, I have a list with tons pf pages (I monitor something like 4555 services).

It seems that, when we move across the pages of the window, and I double click on a line which is for example serverC for host and Load average for Service, I have another tab which opens but showing a totally different server with a totally different service.

As it seems to me like a bug, can we expect a fix soon ?

Really good plugin any way ;-)

Best regards.
o51974
Posts: 2
Joined: Fri Aug 14, 2009 6:08 pm

NPC shows no hosts,services...etc

Post by o51974 »

Hi all,

I have spent the last 10 days on the project to integrate both Nagios & Cacti together using NPC. Individually, nagios & cacti worked perfect. However, I am not getting hosts/ services under my NPC tab.

I have gone through a lot of document/ forum discussions already. Any help would be appreciated...PLEASE.

Here are the additional info:
1. ran php -m => pdo_mysql is present
2. nagios status => on under the npc tab.
3. npc_ tables are populated with nagios host/service ...etc data
4. under console>devices>nagios host mapping shows up and populated.
5. all stuff below are installed on a single system as listed below

System Info:
centos 5.3
php version=5.3
mysql-server=5.1.37
nagios version=3.1.2
cacti version=0.8.7d
cacti-Plugin Architecture=2.4
npc version=2.0.4
webserver = apache (2.2.3)
rrdtool = 1.2.27

Thank you VERY MUCH.
Attachments
emptynpc.JPG
emptynpc.JPG (120.5 KiB) Viewed 7722 times
nagios.log-at_startup.JPG
nagios.log-at_startup.JPG (26.82 KiB) Viewed 7722 times
deluxemongo
Posts: 3
Joined: Mon Aug 17, 2009 5:05 am

Post by deluxemongo »

i have got the same problem!! i do not get any information in my npc tab.

additional information:
my npc_tables are populated
i installed all needed packages -> rrd-tool, mysql server, nagios 3.12, cacti 0.8.7.e, pa 2.4, npc 2.0.4, php, all *-devel, pdo, json, etc

my os is sles11

eventlog nagios:

[08-16-2009 08:31:44] Finished daemonizing... (New PID=32624)
[08-16-2009 08:31:44] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[08-16-2009 08:31:44] ndomod: Successfully connected to data sink. 0 queued items to flush.
[08-16-2009 08:31:44] ndomod: NDOMOD 1.4b8 (07-16-2009) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[08-16-2009 08:31:44] LOG VERSION: 2.0
[08-16-2009 08:31:44] Local time is Sun Aug 16 08:31:44 CEST 2009
[08-16-2009 08:31:44] Nagios 3.1.2 starting... (PID=32621)

do you need more information or is there solution for this problem?
hahnn
Posts: 34
Joined: Tue Feb 03, 2009 5:46 am
Location: Luxembourg
Contact:

Post by hahnn »

Hello,

Also, it would be good to have the list of all monitored services when we click on a host. We have various information like host status, time of the next scheduled check and so on, but there is no tab for example showing actual monitored services for a selected host. Would be good to have a tab named Monitored Services after tab Host State Information.

And I also think there is another small bug. I explain.
Just after starting NPC (by clicking on his tab in cacti), and when requesting the hosts or hosts problems or whatever, the tab Hosts appears and it tries to load the list of the hosts. After some time, nothing appears in the list. It is blank. And it says at the bottom right of the window No data to display.
The list of hosts appears several minutes later, after I tried several times to close the hosts tab, and to reopen it again.

We have something like 500 hosts.

Do you have an explanation for this, and a fix ?

Best regards
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest