Help With NPC !!

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Help With NPC !!

Post by shahsaifi »

Actually, I did same as the url which you shared. And data is populating in cacti db. that mean ndoutils is working. Isn't it?
Greetings,
Shah
fg1010
Posts: 18
Joined: Mon Mar 21, 2011 11:41 am

Re: Help With NPC !!

Post by fg1010 »

It deppends what tables are populated:

why don't try one sql query to the tables with the npc_ prefix ???

And about doing with CentOS u deserve a congratulations, its most difficult than my implementation in ubuntu but im having a lot of fun trying to do in the same way that in my cacti in ubuntu !!

good work
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Help With NPC !!

Post by shahsaifi »

Thanks friend,

Output of below query is attached:

Code: Select all

mysql -u cacti -p cacti -e  "select * from npc_hostchecks ;" > /tmp/npc_hostchecks.txt
Please take look.
Attachments
npc_hostchecks.tgz
(516.35 KiB) Downloaded 83 times
Greetings,
Shah
fg1010
Posts: 18
Joined: Mon Mar 21, 2011 11:41 am

Re: Help With NPC !!

Post by fg1010 »

Hmmmmm so it's become populate...... the ndoutils is working.

Before you follow my recommendations i would like to know if you can execute something form the nagios page, so try to disable one check or restart the service using the web page, if this gives error then try the option 1.

So as far i know there can only be two issues:

1.- The nagios.cmd needs a special permissions that can be found using goole.com and typing "Error: Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' "

2.- Try to put all the plugins directory of cacti with chmod 777

3.- Verify that the plugin version was the 2.0.4 or 2.4 and that the plugin doesn't be compiled in another OS.

Good luck !!
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Help With NPC !!

Post by shahsaifi »

Dear Friend,

There you go:

NPC version :

Code: Select all

npc-2.0.4
Apache and cacti both are the members of nagcmd group :

Code: Select all

# getent group nagcmd
nagcmd:x:501:nagios,apache,cacti

These are the permissions of nagios.cmd:

Code: Select all

prw-rw---- 1 nagios nagcmd 0 Jun 10 03:48 nagios.cmd
Permissions for Cacti Plugins:

Code: Select all

drwxrwxrwx  2 apache nagcmd    4096 Mar 29  2009 aggregate
drwxrwxrwx  2 apache nagcmd    4096 Jul 20  2010 dsstats
-rwxrwxrwx  1 apache nagcmd      44 May  8 23:40 index.php
drwxrwxrwx  4 apache nagcmd    4096 Oct 20  2010 monitor
drwxrwxrwx 10 apache nagcmd    4096 Jun  8 06:19 npc
drwxrwxrwx  2 apache nagcmd    4096 Jun  3 05:47 rrdclean
drwxrwxrwx  3 apache nagcmd    4096 May  3 10:20 settings
drwxrwxrwx  5 apache nagcmd    4096 Oct 20  2010 thold
drwxrwxrwx  9 apache nagcmd    4096 Oct 25  2010 weathermap
Actually, npc is not downloadable from http://www.constructaegis.com/downloads ... 0.4.tar.gz so I tried from source as

Code: Select all

svn co http://svn2.assembla.com/svn/npc/trunk npc
Could it be the reason of issue? Or Shall we try this http://www.scsorlando.com/files/npc2.0.4.tar :(
Greetings,
Shah
fg1010
Posts: 18
Joined: Mon Mar 21, 2011 11:41 am

Re: Help With NPC !!

Post by fg1010 »

If u installed that version doesn{t work at all, when i installed the version from http://www.scsorlando.com/files/npc2.0.4.tar

The display was raw, and i can't understand why, but doesnt work in ubuntu, actually it's the first image of the Topic....

Any way, try with this link:

http://www.mediafire.com/?iefyesb24ppsbwl

I-ve uploaded the version that works for me, and in the topic "Nagios plugin for Cacti 2.0.4", where u take the old link in the page 26-28 u n eed to apply thsese updates to your database cacti.

Good Luck
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Help With NPC !!

Post by shahsaifi »

I tried this npc tar you mentioned above on a vm_image of centos with same stuff as I got on my production server. It works great without any issue. Now I am thinking to replace npc at production server with your one and let you know the results :) thanks a lot friend for help but I am still looking to know the reason of Nagios Status: Off on other one.

Cheers! 8)
Greetings,
Shah
fg1010
Posts: 18
Joined: Mon Mar 21, 2011 11:41 am

Re: Help With NPC !!

Post by fg1010 »

I'm really happy that you can use the plugin !!

But well there is not much information about the errors and i noticed that the support for npc is almost dead. I dislike that but in my experience only trying we can produce the necessary knowledge !!

Good luck buddy. I wait notices !
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Help With NPC !!

Post by shahsaifi »

Hi Friend,

I have applied npc tar on my prod server but no luck with it. Earlier it was able to fetch data now it is not showing anything. :(

Please refer attached screenshot. And I thought it might be due to complicated password in mysql for cacti user so changed this to simple as well. I guess something wrong with DB or I have to reconfigure everything :(
Attachments
npc_new.png
npc_new.png (112.65 KiB) Viewed 2243 times
Greetings,
Shah
fg1010
Posts: 18
Joined: Mon Mar 21, 2011 11:41 am

Re: Help With NPC !!

Post by fg1010 »

I got the same problem ago, but try these steps:

1.- Change again the permission of the npc folder to 777.

2.- Try running these SQL statements:

ALTER TABLE `npc_hostchecks` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;
ALTER TABLE `npc_hoststatus` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;
ALTER TABLE `npc_servicechecks` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;
ALTER TABLE `npc_servicestatus` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;
ALTER TABLE `npc_statehistory` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;
ALTER TABLE `npc_eventhandlers` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;
ALTER TABLE `npc_systemcommands` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;
ALTER TABLE `npc_notifications` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;

(If you uninstall the last npc and installed the new one, you need to run this fix for the npc tables, then you can restart apache).

3.- Restart nagios and ndoutils

And just for procedure, can you post the settings tab from the npc that cacti has ????

Just a little bit and we will finished !! Good Luck and good work !!
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Help With NPC !!

Post by shahsaifi »

Applied the above steps and now we are back to same issue as we were earlier :P

After altering tables, it shows data but Nagios status is back to :off . NPC Settings are attached.
Attachments
npc_settings_tab.png
npc_settings_tab.png (137.88 KiB) Viewed 2239 times
Greetings,
Shah
fg1010
Posts: 18
Joined: Mon Mar 21, 2011 11:41 am

Re: Help With NPC !!

Post by fg1010 »

:wink: lol.... so we need a better option, i must say....

hmmm try uninstalling the npc plug-in and reinstall it.

then deactivate some firewall that was installed on the server or permit the 5668 tcp in and out.

the only reason that maybe the plugin doesn't work well maybe the ndoutils compilation, but im not sure about it. So for now
just unistall and reinstall the plugin, maybe today or tomorrow i can finish the vm with the extended libraries

Stay tuned !
shahsaifi
Posts: 34
Joined: Tue May 10, 2011 1:09 am
Location: New Delhi, India
Contact:

Re: Help With NPC !!

Post by shahsaifi »

Hi friend,

Just re-installed the plugin and did same alteration in db. It seems to be some issue again with DB. Actually, I should tell it before, I had a server on Ubuntu which was running cacti, npc, nagios, ndoutils. Now what i did, i took the backup of DB and re-installed server with CentOS then restored cactidb to new installation on CentOS since than this issue came in picture.
Greetings,
Shah
fg1010
Posts: 18
Joined: Mon Mar 21, 2011 11:41 am

Re: Help With NPC !!

Post by fg1010 »

Hmmm so the data for the npc_ tables maybe come from your backup ???

if the cacti in you ubuntu server was 0.8.7.g with pia 2.8 then doing the restore cant make a problem, but if was a old version then u have a problem.....

So the problem is how we can verifgy that ndoutils works if the npc tables were populated, maybe you need to purge that tables doing a DELETE FROM NPC_*****, and then give a time to see if the ndoutils saves data to the db.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests