Nagios Plugin for Cacti (NPC) 2.0.4

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
sukanta
Cacti User
Posts: 139
Joined: Tue Jan 26, 2010 6:12 am

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by sukanta »

same problem for me also..No host although there is host in MYSQL table npc_hosts.

For me issue was that pdo_mysql was not enable in php. After recompile PHP with --enable-pdo=mysqlnd --with-pdo-mysql=mysqlnd problem resolved!

Check for apache error log which will help you....
doumissme
Posts: 1
Joined: Sun Nov 13, 2011 4:09 am

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by doumissme »

i used:
npc-2.0.4
cacti-0.8.7g
cacti-plugin-0.8.7g-PA-v2.9
nagios-3.3.1
nagios-plugins-1.4.15_1,1
ndoutils-1.4b8_4
apache-2.2.21
php5-5.3.8
php5-extensions-1.5
php5-filter-5.3.8
php5-ftp-5.3.8
php5-gd-5.3.8
php5-iconv-5.3.8
php5-json-5.3.8
php5-mysql-5.3.8
php5-pdo-5.3.8
php5-pgsql-5.3.8
php5-session-5.3.8
php5-shmop-5.3.8
php5-snmp-5.3.8
php5-sockets-5.3.8
php5-xml-5.3.8
php5-zlib-5.3.8

mysql> select count(*) from npc_hosts;
+----------+
| count(*) |
+----------+
| 8 |
+----------+
1 row in set (0.00 sec)


but when i used the command:
#php cli.php --list-hosts
PHP Fatal error: Uncaught exception 'Doctrine_Connection_Exception' with message 'Couldn't locate driver named mysql' in /usr/local/www/apache22/data/cacti/plugins/npc/lib/Doctrine/Connection.php:483
Stack trace:
#0 /usr/local/www/apache22/data/cacti/plugins/npc/lib/Doctrine/Connection/Mysql.php(101): Doctrine_Connection->connect()
#1 /usr/local/www/apache22/data/cacti/plugins/npc/lib/Doctrine/Connection.php(1009): Doctrine_Connection_Mysql->connect()
#2 /usr/local/www/apache22/data/cacti/plugins/npc/lib/Doctrine/Query/Abstract.php(986): Doctrine_Connection->execute('SELECT n.displa...', Array)
#3 /usr/local/www/apache22/data/cacti/plugins/npc/lib/Doctrine/Query/Abstract.php(1030): Doctrine_Query_Abstract->_execute(Array)
#4 /usr/local/www/apache22/data/cacti/plugins/npc/controllers/hosts.php(231): Doctrine_Query_Abstract->execute(Array, 3)
#5 /usr/local/www/apache22/data/cacti/plugins/npc/cli.php(184): NpcHostsController->listHostsCli()
#6 /usr/local/www/apache22/data/cacti/plugins/npc/cli.php(102): listHosts()
#7 {main}
t in /usr/local/www/apache22/data/cacti/plugins/npc/lib/Doctrine/Connection.php on line 483

what's this?
Doctrine_Connection->execute('SELECT n.displa...', Array)
what can i do?
cicoliu
Posts: 4
Joined: Wed Oct 26, 2011 11:27 pm

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by cicoliu »

Where can I download NPC?I can't find it.
fuzion
Posts: 1
Joined: Sat Nov 26, 2011 4:29 am

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by fuzion »

chrism01
Posts: 13
Joined: Thu Dec 01, 2011 11:47 pm

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by chrism01 »

Hi guys,

installed the following

Code: Select all

RHEL5.0

cacti-0.8.7h 
cacti-plugin-0.8.7h-PA-v3.0.tar.gz

nagios-3.3.1 
nagios-plugins-1.4.15

ndoutils-1.4b7 

Cacti Version 	0.8.7h
Cacti OS 	unix

SNMP Version 	NET-SNMP version: 5.3.1

RRDTool Version 	RRDTool 1.4.x
PHP Version 	5.1.6
PHP OS 	Linux
PHP uname 	Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686
PHP SNMP 	Installed
max_execution_time 	30
memory_limit 	32M

Loaded Modules 	core prefork http_core mod_so mod_auth_basic mod_auth_digest mod_authn_file mod_authn_alias mod_authn_anon mod_authn_dbm mod_authn_default mod_authz_host mod_authz_user mod_authz_owner mod_authz_groupfile mod_authz_dbm mod_authz_default util_ldap mod_authnz_ldap mod_include mod_log_config mod_logio mod_env mod_ext_filter mod_mime_magic mod_expires mod_deflate mod_headers mod_usertrack mod_setenvif mod_mime mod_dav mod_status mod_autoindex mod_info mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_actions mod_speling mod_userdir mod_alias mod_rewrite mod_proxy mod_proxy_balancer mod_proxy_ftp mod_proxy_http mod_proxy_connect mod_cache mod_suexec mod_disk_cache mod_file_cache mod_mem_cache mod_cgi mod_php5 mod_proxy_ajp mod_ssl
Apache Version Apache/2.2.3 (Red Hat)

Everything seems to work, except no entries on NPC screen/tab under Nagios. The dashboard layout/menus are there, but no data.

Keep getting these 2 msgs in https error_log

[Fri Dec 02 14:12:47 2011] [error] [client x.x.x.x] PHP Notice: Undefined index: action in /var/www/html/cacti/plugins/npc/top_graph_header.php on line 95, referer: http://1.2.3.4/cacti/graph_view.php?act ... first=true

PHP Fatal error: Uncaught exception 'Doctrine_Connection_Exception' with message 'Couldn't locate driver named mysql' in /var/www/html/cacti/plugins/npc/lib/Doctrine/Connection.php .....
Edit
OK, solved 2nd one by correctly activating pdo_mysql in /etc/php.d/pdo_mysql.ini for anyone else :D
End Edit

Anyone got the answer(s) to qn 1?

Feel free to ask for more info if reqd

Cheers
Chris
Cheers
Chris
chrism01
Posts: 13
Joined: Thu Dec 01, 2011 11:47 pm

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by chrism01 »

... replying to myself to put a new qn...

1. prev settings still apply plus edit as mentioned.

2. remaining error msg has changed slightly to

Code: Select all

[Fri Dec 02 15:35:15 2011] [error] [client x.x.x.x] PHP Notice:  Undefined index:  action in /var/www/html/cacti/plugins/npc/top_graph_header.php on line 95, referer: http://z.z.z.z/cacti/utilities.php?action=view_tech
Relevant section (line 95) of top_graph_header.php

Code: Select all

                                                <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["graph_settings"] == "on")) { print '<a href="'. $config['url_path'] . 'graph_settings.php"><img src="'. $config['url_path'] . 'images/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings" align="absmiddle"></a>';}?>&nbsp;&nbsp;<?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=tree"><img src="<?php echo $config['url_path']; ?>images/tab_mode_tree<?php if ($_REQUEST["action"] == "tree") { print "_down"; }?>.gif" border="0" title="Tree View" alt="Tree View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_list"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=list"><img src="<?php echo $config['url_path']; ?>images/tab_mode_list<?php if ($_REQUEST["action"] == "list") { print "_down"; }?>.gif" border="0" title="List View" alt="List View" align="absmiddle"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_preview"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=preview"><img src="<?php echo $config['url_path']; ?>images/tab_mode_preview<?php if ($_REQUEST["action"] == "preview") { print "_down"; }?>.gif" border="0" title="Preview View" alt="Preview View" align="absmiddle"></a><?php }?>&nbsp;<br>
I'm no PHP programmer, but it looks like utilities.php is calling top_graph_header.php with an action 'action=view_tech' that it doesn't have a code section for ...
Am I right, is this a versioning issue between cacti & npc ???

Cheers
Chris
Cheers
Chris
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by TheWitness »

NPC Needs and update. I have attempted to contact Billy, but have yet to receive a response. He works for Coviscint according to his contact details. He may have been restricted from communicating with this community. I'm not too sure yet.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
chrism01
Posts: 13
Joined: Thu Dec 01, 2011 11:47 pm

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by chrism01 »

It would be great if you can contact him.
Integrating Cacti & Nagios into 1 interface makes perfect sense and I'm sure a lot of people would use it.
See the size of this mega-thread and the other threads.
However, it's a non-trivial tool and really needs some expert support either from himself or maybe as an officially supported plugin by Cacti (or maybe both ?).

Fingers crossed :)

Cheers
Chris
Cheers
Chris
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by TheWitness »

We've hooked up. The balls in The Cacti Groups court at the moment.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
chrism01
Posts: 13
Joined: Thu Dec 01, 2011 11:47 pm

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by chrism01 »

Excellent :D
Cheers
Chris
chrism01
Posts: 13
Joined: Thu Dec 01, 2011 11:47 pm

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by chrism01 »

Ok, I've blown my install away and done it over in order to document a (hopefully) clean / orderly install.
Took me a while but its all (mostly) working now.
I may publish my HOWTO eventually. :)

Anyway, I now get exactly 3 msgs

Code: Select all

[Wed Dec 14 10:05:33 2011] [error] [client x.x.x.x] PHP Notice:  Undefined index:  action in /var/www/html/cacti/plugins/npc/top_graph_header.php on line 95, referer: http://z.z.z.z/cacti/index.php
[Wed Dec 14 10:05:33 2011] [error] [client x.x.x.x] PHP Notice:  Undefined index:  action in /var/www/html/cacti/plugins/npc/top_graph_header.php on line 95, referer: http://z.z.z.z/cacti/index.php
[Wed Dec 14 10:05:33 2011] [error] [client x.x.x.x] PHP Notice:  Undefined index:  action in /var/www/html/cacti/plugins/npc/top_graph_header.php on line 95, referer: http://z.z.z.z/cacti/index.php
whenever I click into the npc tab.
This is 100% reproducible, so I'm thinking it should help Cacti Groups/Divagater to fix it.

SW versions:
RHEL 5.0
Apache/2.2.3
cacti-0.8.7h
cacti-plugin-0.8.7h-PA-v3.0
cairo 1.6.4
nodutils 1.4b7
npc-2.0.4
php-json-4.3.2_1.2.1-1
pixman 0.10.0
rrdtool 1.4.5
nagios 3.3.1
nagios-plugins 1.4.15
mysql 5.0.22

Feel free to ask for more info

Cheers
Chris

PS: I've seen the same qn re those 3 msgs posted elsewhere on the net, but no (good) answers; at least I know it's not just me ...
Cheers
Chris
yellowpaper
Posts: 9
Joined: Wed Dec 14, 2011 6:38 am

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by yellowpaper »

Why do I get forwarded to amazon when I a m trying to download the plugin? weird =/
None of the links on that site returns a valid download.

http://trac.assembla.com/npc/wiki/NPCDownload
chrism01
Posts: 13
Joined: Thu Dec 01, 2011 11:47 pm

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by chrism01 »

@yellowpaper; yeah, homesite has had issues for a while; see fuzion's link http://www.mediafire.com/?iefyesb24ppsbwl

Cheers
Chris
Cheers
Chris
Tristaneo2008
Posts: 1
Joined: Fri Dec 16, 2011 10:00 am

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by Tristaneo2008 »

Hi,

The plugin is working but not the N2C part. I can see my hostgroups, I see the progress bar BUT nothing is imported.

Hoping a solution

Tristaneo
Catalinux
Posts: 1
Joined: Thu Nov 22, 2012 3:24 am

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by Catalinux »

Tristaneo2008 wrote:Hi,
The plugin is working but not the N2C part. I can see my hostgroups, I see the progress bar BUT nothing is imported.
Hoping a solution
Tristaneo
Hi all,
Is there anybody who managed to make NPC 2.0.4 work?
After many hours of google-ing and forums reading, etc I was able to arrive maybe in the same point with "Tristaneo2008" but
- my apache is staying between 50 - 200% CPU,
- still getting a lot of "Non-static method NpcServicesController::getServiceStatesByHost() should not be called statically"
- a lot of "PHP Notice: Undefined offset: 0 in .../cacti/plugins/npc/controllers/nagios.php on line 105," and line 111
- a lot of " Undefined index: action in ...cacti/plugins/npc/top_graph_header.php on line 95, referer:"...

So, should I bother make it work (and how?) or is it a dead cause? :(

Thanks for any help.
(mean while I'll continue ridding those previous pages, maybe I'll find something helpful)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest