Nagios Plugin for Cacti (NPC) 2.0.4

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
oOSebOo
Posts: 1
Joined: Wed Dec 02, 2009 11:34 am

Post by oOSebOo »

Hi all,

i have a problème with NPC v2.0.4.
I can't resize "host problem", etc... on dash board.

When i clic on Portlet configuration, i have an empty screen opened with only "save" and "cancel" button.

I have seen 2 times in about 1 days a box with height modification.

I tested on linux / windows and Firefox, IE, Chrome.

Have you got any issu with that ?

Thanks,
stevetuk31
Posts: 10
Joined: Mon Jul 16, 2007 10:57 am

Post by stevetuk31 »

Hi oOSebOo,

Not that it helps, but i have the same issue. Would be great if someone could point me and oOSebOo in the right direction.

Thanks
aaronnicoli
Posts: 33
Joined: Tue May 05, 2009 7:28 pm

NDO2DB init script

Post by aaronnicoli »

This is actually for NDO2DB...

The release has contained in the documentation now for a very long time that a init script will be developed and added to the package, however this has not happened...

Anyway, I have created a script which is pretty much as generic as possible, it shouldn't be hard for people to work out and use...

EDIT: Now attached....
EDIT: Now updated to v1.2
EDIT: Now updated to v1.3
EDIT: Sorry attached 1.2 again fixed now ...

Chnagelog:
# - v1.0 : Initial production release, added support for multiple NDO2DB daemons running simultaneously
# - v1.1 : Added support for Nagios daemon checking, will error if nagios already running when starting.
# - v1.2 : Further error checking added and support to ask for user input on Nagios daemon state. Can now
# automatically restart the nagios daemon in sync with NDO2DB.
# - v1.3 : Bugfixes with the Nagios restart module, will now continue to question the user for a nagios
# restart, and not fail on y or n. Won't die to a failure of restart now.


Enjoy and give me any recommendations if needed.
Attachments
ndo2db.txt
ndo2db - Init script - v1.3

Remove the .txt extension BTW ;)
(4.71 KiB) Downloaded 3189 times
ndo2db.txt
ndo2db - Init script - v1.0

Remove the .txt extension BTW ;)
(3.21 KiB) Downloaded 3044 times
ndo2db.txt
ndo2db - Init script - v1.2

Remove the .txt extension BTW ;)
(4.48 KiB) Downloaded 3025 times
Last edited by aaronnicoli on Thu Dec 10, 2009 7:00 pm, edited 2 times in total.
gheppner
Posts: 20
Joined: Thu Dec 04, 2008 5:10 pm

unknown column long_output

Post by gheppner »

(accidentally posted this as it's own topic in plugin_general).

I'm running npc 2.0.4, and I run my cacti and nagios servers on separate systems. I have a couple of issues. First, within the NPC tab on my cacti server I see nothing under the dropdowns for hostgroups or templates within the N2C area, even though the npc_ tables are being populated.

Another, possibly related issue, is my nagios server logs rapidly filled with errors like this:

(note i've cleaned this up to remove site specific info.)

Dec 6 22:28:02 systemX ndo2db: mysql_error: 'Unknown column 'long_output' in 'field list''
Dec 6 22:28:02 systemX ndo2db: Error: mysql_query() failed for 'INSERT INTO npc_servicechecks SET instance_id='1', service_object_id='790', check_type='
0', current_check_attempt='1', max_check_attempts='4', state='0', state_type='1', start_time=FROM_UNIXTIME(1260156482), start_time_usec='388319', end_time=FR
OM_UNIXTIME(0), end_time_usec='0', timeout='60', early_timeout='0', execution_time='0.000000', latency='15.388000', return_code='0', output='DNS OK: 0\.072 s
econds response time\.somecheck returns somestuff', long_output='', perfdata='time=0\.072212s;;;0\.000000
', command_object_id='895', command_args='somargs', command_line='/usr/local
nagios/libexec/check_dns -H somehost -s moreargs -a moreargs -w 1 -c 2' ON DUPLICATE KEY UPDAT
E instance_id='1', service_object_id='790', check_type='0', current_check_attempt='1', m

So I'm wondering what's up - did the npc tables not get created correctly by the plugin?
aaronnicoli
Posts: 33
Joined: Tue May 05, 2009 7:28 pm

Post by aaronnicoli »

So it wasn't just me that had these problems, it appears the latest version of the ndo db is bugged....

Run these queries, should fix your problems:


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`;
gheppner
Posts: 20
Joined: Thu Dec 04, 2008 5:10 pm

Post by gheppner »

Sure enough, that did the trick. Thanks.

Now i'm getting close to actually having this work. However, now when i try to map / display graphs nothing displays. From the httpd error logs on my cacti server it appears that npc is looking in the wrong place for the image files. In short, its trying to pull them from my www root, but not adding the /cacti as specified in my config.php for the cacit install. I gather this was bug that was supposed to be fixed in the latest release but its still not working near as I can tell. Anyone suggest a work around? I'm not sure where to fix this myself in the npc configuration files.

aaronnicoli wrote:So it wasn't just me that had these problems, it appears the latest version of the ndo db is bugged....

Run these queries, should fix your problems:


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`;
hisgett
Posts: 3
Joined: Mon Jan 19, 2009 10:18 pm

Post by hisgett »

I am experiencing that same effect. Graphs are wanting to be pulled from http://server rather thatn http://server/cacti

The path in the global.cfg is specified as /cacti/
sini
Cacti User
Posts: 91
Joined: Mon Nov 24, 2003 10:22 am
Location: Hungary

Post by sini »

hisgett wrote:I am experiencing that same effect. Graphs are wanting to be pulled from http://server rather thatn http://server/cacti

The path in the global.cfg is specified as /cacti/
See earlier post by divagater (Fri Jun 26, 2009 12:39 am)
Page 20 in this topic.
Sini
hisgett
Posts: 3
Joined: Mon Jan 19, 2009 10:18 pm

Post by hisgett »

sini wrote:
hisgett wrote:I am experiencing that same effect. Graphs are wanting to be pulled from http://server rather thatn http://server/cacti

The path in the global.cfg is specified as /cacti/
See earlier post by divagater (Fri Jun 26, 2009 12:39 am)
Page 20 in this topic.
Very good...I cannot believe I missed that one. Thanks! It is working now.
conandor
Posts: 1
Joined: Tue Dec 08, 2009 10:24 pm

Post by conandor »

aaronnicoli wrote:So it wasn't just me that had these problems, it appears the latest version of the ndo db is bugged....

Run these queries, should fix your problems:


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`;
The solution u provided solve the problem I had!
Thank you aaronnicoli.

Gonna try out your NDO2DB startup script :)
aaronnicoli
Posts: 33
Joined: Tue May 05, 2009 7:28 pm

Post by aaronnicoli »

Not a problem, makes me happy to see that I am helping people.

If you have any ideas for the startup script please let me know.

Thanks,


PS. Just released v1.3 BTW :D
EDIT: Originally uploaded 1.2 again, but I have now updated the attachment to v1.3
purecm70
Posts: 2
Joined: Mon Jan 11, 2010 10:23 am

Post by purecm70 »

Is there still npc-support ? Some people (including me) have problems with this plugin. But their topics are not answered.

http://forums.cacti.net/about35708.html
jenchingyang
Posts: 18
Joined: Wed Jul 20, 2005 8:44 am

PNP4Nagios $HOSTNAME$ PNP error

Post by jenchingyang »

Hi, I integrated PNP4Nagios into Nagios. View it from Nagios Console is no problem. but when I used Notes_URL in Additional Information (NPC plugin) appear error. It seem NPC unable to translate parameter $HOSTNAME$. Any idea can solve it?

another question. integrated action_url is possible or not? like below picture (apopup.jpg)
bedo
Posts: 1
Joined: Wed Dec 09, 2009 11:42 am

Re: Nagios Plugin for Cacti (NPC) 2.0.4

Post by bedo »

hello all,
i have a question.
my npc database (name:nagios) can get data via ndo2db but the npc view is nothing!
how can i do next?

npc-2.0.4
ndoutils-1.4b9
php-5.2.6
mysql-5.0.22
httpd-2.2.9
nagios-3.2.0
nagios-plugins-1.4.14

tks!!
jenchingyang
Posts: 18
Joined: Wed Jul 20, 2005 8:44 am

Post by jenchingyang »

Maybe you can try to downgrade ndoutils to version "ndoutils-1.4b7"
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests