Nagios Plugin for Cacti (NPC) 2.0.4

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
sterpstra
Posts: 45
Joined: Tue May 27, 2008 11:48 pm
Location: So Cal
Contact:

Post by sterpstra »

mati wrote:Yes, I'm. After making the changes you posted and the PDO change it's all working now.
Still no joy on this end. I made the changes you suggested but on top (no pun intended) of having a CPU spike when accessing NPC, I still only get the dashboard partially populated... VERY strange....

-st
mati
Posts: 7
Joined: Tue Jun 10, 2008 5:06 pm

Post by mati »

I'm using the svn version and I only made those 2 changes. I have config_output_options=2 in ndomod.cfg and retain_state_information=1 in nagios.cfg other than that everything else is set to default and the recomended settings in the NPC quickstart guide.
sterpstra
Posts: 45
Joined: Tue May 27, 2008 11:48 pm
Location: So Cal
Contact:

Post by sterpstra »

Hi Divigater

Any update on this issue? I still can't get past the front page when I make any changes to the various config files.

-st
sterpstra
Posts: 45
Joined: Tue May 27, 2008 11:48 pm
Location: So Cal
Contact:

FINALLY

Post by sterpstra »

I finally found the source of the problem..... The Cacti config.php file is calling require('/etc/cacti/debian.php'); which had all of the database variables required by NPC with the exception of hostname and port, which where blanked out. After I changed those, NPC came up fine.

However, now I'm back to the original problem I had when I first was able to force a connection. I get the Dashboard page and the current status of Nagios is shown. However, no hostgroups or servicegroups are shown and when you go to those tabs (Hosts and Services), there is nothing there. Just doesn't make sense that it can pull some information from that db but not other info. Everything is back to the original code, so that shouldn't be the issue....

Ideas anyone?
sterpstra
Posts: 45
Joined: Tue May 27, 2008 11:48 pm
Location: So Cal
Contact:

New debian.php code

Post by sterpstra »

And here's my new /etc/cacti/debian.php code:

$database_username='cacti';
$database_password='password';
$basepath=' ';
$database_default='cacti';
$database_hostname='localhost';
$database_port='3306';
$dbtype='mysql';
xefil
Cacti User
Posts: 233
Joined: Tue Jun 20, 2006 2:48 am
Location: Italy
Contact:

Post by xefil »

Does it work on Nagios 2.9?
lewise.liu
Posts: 4
Joined: Sat Mar 29, 2008 1:36 am

NPC2.0 and ndoutils ERROR, Still unable to connect to data s

Post by lewise.liu »

hi guys
Recently I have been busy in deploying the cacti+nagios monitor system.But at npc 2.0 model,I meet a odd error:
[1215233124] ndomod: Still unable to connect to data sink. 2297621 items lost, 5000 queued items to flush.(in nagios.log).
Cacti can works well ,and nagios can works normally also.But the NPC web is blank and has none data on the hosts and services.
At the same time ,I find the table Nagios_hosts and Nagios_services have rows. which is so odd.
The upper error happen after I deployed the ndomon and ndo2db to nagios.
My deploying version be as below:
Cacti 0.8.7b
Cacti Plugin Architecture v2.0
NPC 2.0
ndoutils-1.4b7
php 5.2
mysql 5.0
nagios-3.0
Perhaps somethings is wrong with the ndoutils.But I have reinstalled and deployed the ndoutils for 3 times. The problem exists also.
The problem has suffer me for one weeks.
Any suggest and help is appreciated.
cixelsyd
Posts: 1
Joined: Wed Jul 16, 2008 9:55 am

error in my apache logs

Post by cixelsyd »

Hello all.

I am running nagios 3.0.1 with cacti and NPC. I get these NPC errors inside my httpd logs constantly:

[Wed Jul 16 09:07:15 2008] [error] [client ::1] PHP Warning: Variable passed to each() is not an array or object in /var/www/html/lib/functions.php on line 147
[Wed Jul 16 09:07:16 2008] [error] [client ::1] PHP Warning: reset() [<a href='function.reset'>function.reset</a>]: Passed variable is not an array or object in /var/www/html/lib/functions.php on line 146
[Wed Jul 16 09:07:16 2008] [error] [client ::1] PHP Warning: Variable passed to each() is not an array or object in /var/www/html/lib/functions.php on line 147
[Wed Jul 16 09:07:16 2008] [error] [client ::1] PHP Warning: reset() [<a href='function.reset'>function.reset</a>]: Passed variable is not an array or object in /var/www/html/lib/functions.php on line 146


It seems like most things work; however, inside NPC when I click services or hosts I get a blank screen ... almost like the query is timing out before it can return values.

Any ideas?
Cixel
nduda78
Cacti User
Posts: 111
Joined: Tue Mar 01, 2005 11:26 am

Post by nduda78 »

Any reason why this plugin breaks the refresh of everything else in cacti (normal graph pages, weathermap...etc)

The source code says this on any page now:

meta http-equiv=refresh content='2592000'

Disabling NPC fixes everything.
petero
Posts: 13
Joined: Sun Jul 17, 2005 3:45 pm
Location: Poland

no NPC tab showed up (plugin arch 2.2 b)

Post by petero »

Hi
I cant seem to get NPC tab get to show up, i can't no errors.
And there is no "realm" stuff in setup.php (with new version its 9000+x)
so there is no conflict with realm thing.
Any one got it to show up ?

TW:
Full url work:) like /cacti/pluginc/npc/npc.php

Peter
[quote][b]Cacti Version[/b] - 0.8.7b
[b]Plugin Architecture[/b] - 2.2 Beta
[b]Poller Type[/b] - Cactid v
[b]Server Info[/b] - Linux 2.6.20
[b]Web Server[/b] - Apache
[b]PHP[/b] - 5.2.6
[b]PHP Extensions[/b] - xmlwriter, libxml, dom, xmlreader, xml, tokenizer, session, pcre, SimpleXML, SPL, PDO, sockets, snmp, SQLite, standard, Reflection, posix, pdo_sqlite, mysql, mbstring, json, iconv, hash, gd, filter, date, ctype, zlib, apache2handler
[b]MySQL[/b] - 5.0.41-debug
[b]Plugins[/b][list]Large Site Performane
Network Discovery (discovery - v0.8.4)
Global Plugin Settings (settings - v0.5)
Nagios plugin for Cacti (npc - v2.0.0b)[/list][/quote]
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

nduda78, you are right that the huge meta refresh is making it into other pages. To me that looks like a plugin architecture issue. Each plugin developer can set the refresh for their plugin with the following code in setup.php:

Code: Select all

/**
 * Set the page refresh very high
 */
function npc_top_graph_refresh() {
    return('2592000');
}
Because NPC is a client side application it does not need to ever refresh so I set the value very high. What is interesting is that when you navigate away from NPC to another tab that value seems to be carried over. The quick fix if you want refresh working is to comment out that method or set the value low. But you will not like it when NPC refreshes and all your tabs close.

I will see if I can find out why the value does not reset when navigating away from npc.

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

Post by TheWitness »

I suggest you create your own top_graph_header.php, instead call it top_npc_header.php and remove the refresh bit.

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?
daldworth
Posts: 2
Joined: Sun Aug 10, 2008 11:39 pm

Couldn't locate driver named mysql

Post by daldworth »

I Keep getting these messages:

Code: Select all

[Sun Aug 10 22:17:23 2008] [error] [client 63.211.......] PHP Fatal error:  Uncaught exception 'Doctrine_Connection_Exception' with message 'Couldn't locate driver named mysql' in /usr/local/share/cacti/plugins/npc/lib/Doctrine/Connection.php:394\nStack trace:\n#0 ...
Yet I know for certain mysql is loaded into php. Cacti is using it at least. And:

Code: Select all

# php -m
[PHP Modules]
date
json
libxml
mysql
pcre
PDO
Reflection
session
SimpleXML
snmp
sockets
SPL
standard
xml
Otherwise all else is good. NDO2DB data is loading from a remote central nagios server. NCSA is populating correctly. The NPC installl went all as planned except for this...

I'm on a FreeBSD 6.2 machine if that makes a diff.

Thanks in advance for any help.
daldworth
Posts: 2
Joined: Sun Aug 10, 2008 11:39 pm

Post by daldworth »

Figured it out. Needed pdo_mysql port installed... doh!
sfxdana
Posts: 2
Joined: Wed Aug 20, 2008 11:34 am

Feature Request??

Post by sfxdana »

Excelent Plugin!! Keep up the good work!!!

Just started using Nagios for a few weeks now to monitor our customers, not using the NPC plugin jet. But will be in another few weeks or so.

Just one question/request is it possible to sort the service groups and host groups on there critical/warnings etc.

Just like the Olympic Medal country list. Sort on Criticals first then sort on warnings then ok messages. That way only the problems are displayed (top ten bassicly) and you don't have to go through all the pages to find the criticals/warnings etc.

Just have to look at the status page and know where the problems are. And act on them accordingly. Refresh time could also be set to less then 60 seconds so you see problems quickly.

Sfxdana
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests