Nagios Plugin for Cacti (NPC) 2.0.4

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
padawan
Posts: 25
Joined: Fri Nov 30, 2007 4:54 am

Post by padawan »

hey divagater,

i got the same problem as sonartribe, my nagios is running well and npc too but there is no data on npc screen and it seems that npc_tables still empty ..

did u both find an issue to this ?
i tried to edit ndomod.cfg and set config_output_options=3 but it still not work
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

padawan wrote:hey divagater,

i got the same problem as sonartribe, my nagios is running well and npc too but there is no data on npc screen and it seems that npc_tables still empty ..

did u both find an issue to this ?
i tried to edit ndomod.cfg and set config_output_options=3 but it still not work
If you don't have any data in npc_<tables> then your problem wont be the same. sonartribe had data but had to modify query to display it. The 3rd alpha release that I posted last night (see first post) has the fix for the query.

Your issue will be between nagios and ndo2db. Makesure ndo2db daemon is running. Restart nagios and tail your syslog for errors.

~Billy
padawan
Posts: 25
Joined: Fri Nov 30, 2007 4:54 am

Post by padawan »

well i copy ndo2db and ndomod files in nagios/bin/ and edit each cfg files
but i dont know what do u mean by checking if ndo2db is running because when I try to find if there is a daemon of ndo2db i found nothing
maybe I did a wrong install ?
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

padawan wrote:well i copy ndo2db and ndomod files in nagios/bin/ and edit each cfg files
but i dont know what do u mean by checking if ndo2db is running because when I try to find if there is a daemon of ndo2db i found nothing
maybe I did a wrong install ?
ndo2db is made up of 2 parts. A daemon called ndo2db and a module called ndomod.o. You would have created these following the directions included with ndoutils.

The daemon part (ndo2db) runs a separate process. I start mine with the following command:

Code: Select all

/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
re-read the README file included with ndoutils for the installation instructions. Also go through my quick start guide again. Make sure you understand all the parts. If ther is a specific step you don't understand ask here.

~Billy
rajvrach
Posts: 2
Joined: Thu Mar 27, 2008 3:30 pm

[SOLVED] NPC no data in tables for latest version

Post by rajvrach »

Hi..i sent 3 days trying to reinstall npc/nagios and cacti all of then many times from scratch to make NPC work..everythinng was working but no data was pulled in NPC cacti interface.
problem was that many of the SQL QUERIES
/var/www/html/cacti/plugins/npc/queries/*.sql
files had "nagios_" as prefix instead of "npc_", i replaced all "nagios_" with "npc_" in many files and vholla..everything works.

* to the auther..please udpat the files..looks like some mixup there.
i am using npc-2.0.0a.151.tar.gz

Thanks
Raj S Vrach
i2k2 Networks
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Re: [SOLVED] NPC no data in tables for latest version

Post by divagater »

rajvrach wrote:Hi..i sent 3 days trying to reinstall npc/nagios and cacti all of then many times from scratch to make NPC work..everythinng was working but no data was pulled in NPC cacti interface.
problem was that many of the SQL QUERIES
/var/www/html/cacti/plugins/npc/queries/*.sql
files had "nagios_" as prefix instead of "npc_", i replaced all "nagios_" with "npc_" in many files and vholla..everything works.
Hi Raj. Those *.sql files under the queries directory on not used, They are simply there for anyone wanting to run queries manually. Most of the queries NPC uses were based off of those but have been re-written for Doctrine the ORM layer.

So if everything is working for you now then by coincidence you changed something else that was causing you trouble :) What I should do is move that queries directory under docs/ to limit confusion.

Cheers,
Billy
sonartribe
Posts: 25
Joined: Mon May 08, 2006 10:31 am

new version doesn't work

Post by sonartribe »

Divagater,

I can't get the new version working. The tab doesn't show up, and there's nothing under the cacti settings. Possibly because I'm still using plugin architecture 1.4.11. I'm probably not the only one out there.

Will plugin architecture v2 be a prerequisite for this plugin?

Regards

Ian
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

I believe the PA 2.x is backwards compatible so 1.4 plugins will run inside the 2.x architecture just not vice versa. PA 2.x was a requirement from the get go because I wanted to utilize all the cool features it offers.

I think I can support 1.4 by duplicating all the init/setup code in setup.php :( But I would be curious to know if users are not upgrading to 2.x for a reason. Like is it breaking some plugins/functionality? Also, trying to support 1.x and 2.x could get tricky if certain hooks aren't available in both places although right now that would not be a problem as I don't use many hooks.

Cheers,
Billy
sonartribe
Posts: 25
Joined: Mon May 08, 2006 10:31 am

Post by sonartribe »

Divagater,

I've just upgraded to PA2.1 and all my plugins to their latest versions without a hitch, but still can't get build 151 to work.

I get no npc tab, no option under user management, and when I go to "plugin management", it doesn't show any of my plugins, installed or uninstalled. Last scanned shows as "never".

Hmmmm. Am I missing something obvious?

Ian :-?
sonartribe
Posts: 25
Joined: Mon May 08, 2006 10:31 am

Bingo

Post by sonartribe »

Billy,
Looks like I had the same problem you had previously. I had backup copies of old versions of plugins in /plugins causing errors like these in /var/log/messages

"httpd2-prefork: PHP Fatal error: Cannot redeclare npc_version() (previously declared in /store/cacti/plugins/npc/setup.php:35) in /store/cacti/plugins/npc.new/setup.php on line 40"

So I've moved old copies out and it now works a treat!

Ian :D
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Re: Bingo

Post by divagater »

sonartribe wrote:Billy,
Looks like I had the same problem you had previously. I had backup copies of old versions of plugins in /plugins causing errors like these in /var/log/messages

"httpd2-prefork: PHP Fatal error: Cannot redeclare npc_version() (previously declared in /store/cacti/plugins/npc/setup.php:35) in /store/cacti/plugins/npc.new/setup.php on line 40"

So I've moved old copies out and it now works a treat!
You stumbled on that post I put up in the PA forum :) That problem was killing me for a while. For anyone else reading this, the 2.x PA does a directory scan to find plugins. You can not have copies of the same plugin under the plugins directory. i.e. something like this which would work under 1.x will not work under 2.x

Code: Select all

plugins/
  npc/
  npc-2.0.0-136
The 2 copies of the plugin with be read by the PA and will throw PHP fatal error as functions with the same name are declared.

Glad you got everything working Ian...

Cheers,
Billy
padawan
Posts: 25
Joined: Fri Nov 30, 2007 4:54 am

Post by padawan »

when i check ndo2db.cfg i have this msg error
/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
Support for the specified database server is either not yet supported, or was not found on your system.
I do exactly the same install i read in ndoutils README and your quickstart page =/
i use ndomod and ndo2db for nagios 3


[edit] ok I reconfigure ndoutils with --enable-mysql and --disable-pgsql --with-mysql-lib= my lib

and it said:

*** MySQL library could not be located... **************************

You chose to compile NDBXT with MySQL support, but I was unable to
locate the MySQL library on your system. If the library is
installed, use the --with-mysql-lib argument to specify the
location of the MySQL library.

NOTE: After you install the necessary libraries on your system:
1. Make sure /etc/ld.so.conf has an entry for the directory in
which the MySQL libraries are installed.
2. Run 'ldconfig' to update the run-time linker options.
3. Run 'make devclean' in the NDBXT distribution to clean out
any old references to your previous compile.
4. Rerun the configure script.

TIP: Try the following....

./configure --with-mysql-lib=/usr/lib/mysql

********************************************************************


checking mysql/mysql.h usability... no
checking mysql/mysql.h presence... no
checking for mysql/mysql.h... no


*** MySQL include file could not be located... **********************

You chose to compile NDBXT with MySQL support, but I was unable to
locate <mysql/mysql.h> on your system. If the include file is
installed, use the --with-mysql-inc argument to specify the location
of the MySQL include file.

********************************************************************
so I now know why it didn't work ... o_O"

[edit2] Ok it seems that I didnt install the mysql-devel packages ... =/

[edit3] after installing mysql-devel it seems to work, i got 1 entry in npc_host (my localhost) but npc does not see my juniper hostgroup =/

===> ok just need to restart nagios...

[edit4]

i got entries ont hostgroups tables ect ect but nothing on services and hosts tables
any Ideas?
Attachments
npc.JPG
npc.JPG (170.51 KiB) Viewed 9132 times
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

padawan, just to be clear, do you have any data in npc_services when looking directly in the database?

I am trying to understand if the data is not getting to the DB or the UI. Ideally what you should do to troubleshoot is stop ndo2db and nagios. Next, start ndo2db and then start nagios while tailing your syslog. Watch for errors. If the logs look good do a quick check to make sure ndo2db and nagios are actually still running.

Look in the npc_services table. Any data there? if yes but not on UI tail your apache error logs and look for any fatal errors.

~Billy
padawan
Posts: 25
Joined: Fri Nov 30, 2007 4:54 am

Post by padawan »

I got 14 rows in npc_services table and no fatal error =/
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

padawan wrote:I got 14 rows in npc_services table and no fatal error =/
So what exactly is the problem? Sounds like you got everything working to me :) I see from the screenshot that your service status summary is not populated but hostgroup service status is. Is that still the case? Click the 'Services' menu item in the left tree menu. Does the services grid populate with your services?

Also, are you using the latest NPC build (build 151) ?

~Billy
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests