Nagios Plugin for Cacti (NPC) Released

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

Post by egarnel »

very cool!

It would be great if we could simply import hosts from Cacti to Nagios.
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey
Marcelo Barragan
Posts: 1
Joined: Fri Dec 30, 2005 7:49 am

NPC compile error

Post by Marcelo Barragan »

Good Morning people!

Im trying to install it on a Debian Woody box with Cacti-0.8.6g with cacti-plugin-arch, nagios-2.0rc1 and npc-0.1.1a.
I follow the Readme of NPC, setting the line 143 of /cacti/plugins/npc/neb/inserter.c.
I had copied the files /cacti/plugins/npc/neb/inserter.c and /cacti/plugins/npc/neb/makefile to my nagios-2.0rc1/modules source dir. But when I tried to compile inserter.c with make, make all or gcc -g -O2 -Wall -o inserter.o inserter.c -shared -I../include -I/usr/include/mysql -lmysqlclient -fPIC -L/usr/lib/mysql I get the same error message:


gcc -g -O2 -Wall -o inserter.o inserter.c -shared -I../include -I/usr/include/mysql -lmysqlclient -fPIC
In file included from /usr/include/dlfcn.h:28,
from ../include/config.h:285,
from ../include/nebcallbacks.h:28,
from inserter.c:48:
/usr/include/bits/dlfcn.h:26: warning: `RTLD_NOW' redefined
../include/config.h:95: warning: this is the location of the previous definition
/usr/include/bits/dlfcn.h:33: warning: `RTLD_GLOBAL' redefined
../include/config.h:91: warning: this is the location of the previous definition
inserter.c: In function `nebmodule_init':
inserter.c:143: `CLIENT_MULTI_STATEMENTS' undeclared (first use in this function)
inserter.c:143: (Each undeclared identifier is reported only once
inserter.c:143: for each function it appears in.)
inserter.c: In function `processCheck':
inserter.c:451: parse error before `char'
inserter.c:455: `safeName' undeclared (first use in this function)
inserter.c:469: parse error before `char'
inserter.c:475: `safeServiceDescription' undeclared (first use in this function)
inserter.c: In function `processStatus':
inserter.c:517: parse error before `char'
inserter.c:546: `safeName' undeclared (first use in this function)
inserter.c:555: `safeEventHandler' undeclared (first use in this function)
inserter.c:585: `safeHostCheckCommand' undeclared (first use in this function)
inserter.c:595: `safePerfData' undeclared (first use in this function)
inserter.c:687: `safePluginOutput' undeclared (first use in this function)
inserter.c:713: parse error before `char'
inserter.c:743: `safeServiceDescription' undeclared (first use in this function)
inserter.c:784: `safeServiceCheckCommand' undeclared (first use in this function)

Anyone know of a quick fix for either one of these issues?

Thanks for advice!
Marcelo Barragan
tarpat1
Posts: 17
Joined: Sun Jan 01, 2006 11:39 pm

Post by tarpat1 »

Great add-on.

I was able to compile and install this but at the device screen all I get at the drop down menu is None. Is there anything special that I need to do to fix this? I am on MySQL 4.1.11, Cacti 0.8.6g and Nagios 2.0.1rc1. Thanks!!
tarpat1
Posts: 17
Joined: Sun Jan 01, 2006 11:39 pm

Post by tarpat1 »

:oops: :oops:

Oops, that was my mistake, I had the directory for the inserter module incorrect. Works great thanks for a great add-on!!!!!!!!!!
fozzy
Cacti User
Posts: 54
Joined: Mon Jan 09, 2006 11:33 am
Location: SE of LIML
Contact:

Post by fozzy »

----[ Installation

Cacti:

- Unzip NPC into the plugins directory under your Cacti installation.
* /cacti/plugins/npc
- Edit /cacti/includes/config.php and add: $plugins[] = 'npc';
I don't see a plugin directory in the cacti main directory... using 0.8.6h

Should i create the directory?

Thank you, Luca

EDIT: found the answer by myself... need to patch cacti...
farhan
Posts: 47
Joined: Sat Nov 12, 2005 6:55 am

Post by farhan »

Tomkal,

You need to installp plugin architecture for this. Just have a look on

http://cactiusers.org

Thanks,

Farhan
knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

Post by knobdy »

farhan wrote:Hi ,

That was my fault. Now it is working fine. But I could not find hostGroups.php and serviceGroups.php in npc directory. When I click HostGroups and ServiceGroups under NPC, it could not find these php files.

Thanks,
I'm missing both of these files as well - are they going to be in a future release?

{DELETED - seems it pays to make SURE nagios has started}
knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

Post by knobdy »

Hey, just out of curiosity, how hard would it be to create a web frontend for editing the nagios config files (for adding hosts and such)?
jgisler
Cacti User
Posts: 63
Joined: Wed Sep 28, 2005 1:12 pm

Post by jgisler »

awesome plugin, thank you!

I do get 2 errors.

The additional views tabs for Hostgroups & Servicegroups error as there is no Hostgroups.php nor Servicegroups.php
ceyounger
Posts: 44
Joined: Fri Feb 10, 2006 2:59 pm
Location: Orange County, CA
Contact:

Post by ceyounger »

I cannot seem to get inserter.o to load. I get this in my nagios.log:

[1139611327] Error: Could not load module '/usr/local/nagios/modules/inserter.o' -> /usr/local/nagios/modules/inserter.o: cannot open shared object file: No such file or directory

Any suggestions?

*** UPDATE ***

I'm just retarded, I fat-fingered the location of the module. All good now.
netana
Posts: 20
Joined: Wed Feb 16, 2005 6:36 am

No

Post by netana »

First thanks for this great add-on.

I was able to compile and install the add-on. my problem is that at the device screen I get only NONE as drop down menu.

Has anyone an idea what could be the problem?

I am using MySQL 4.1.11, Cacti 0.8.6h and Nagios 2.0.1rc1.

Many thanks
netana
netana
Posts: 20
Joined: Wed Feb 16, 2005 6:36 am

Log

Post by netana »

In the var/log/messages I found the following lines:

Nagios 2.0rc1 starting... (PID=19553)
LOG Version: 2.0
Error: Could not load module '/usr/local/nagios/modules/inserter.o' -> /usr/local/nagios/modules/inserter.o: undefined symbol: SSL_CTX_free
Lockfile '/usr/local/nagios/var/nagios.lock' is held by PID 18486. Bailing out...

Thanks for your help

Netana
Netana
t3ch
Posts: 3
Joined: Tue Feb 28, 2006 7:03 am
Location: Germany

Post by t3ch »

Hy all,
I have installed the plugin and it works. The documentation is a little short but I managed it.
Can someone give step by step instructions how to feed the nagios performance data into a cacti graph?
Is that possible with the plugin?
Caliban
Posts: 31
Joined: Wed Sep 08, 2004 2:07 am
Location: Maine

Post by Caliban »

Not possible but you can link graphs to NPC so they're embedded.

While under console click Devices pick a device thats also in Nagios you'll see a new option called Nagios Host Mapping.. select the right Nagios Host and save it. When in NPC viewing the host there will be a Graph View option under the Host name that will take youto the hosts for that graph.

While under the services for a host at the bottom of the page you'll see Graph Mapping.. select the Cacti graph that goes with that service and when you view that service the graph will be at the bottom. Also while viewing a list of services there will be an extra graph icon that when click will display the graph under the service.. its pretty cool..

Now if they can only get the hostgroups/Servicegroups and config working. Oh and the acknowledge in the list of commands would be ncie.
Teecee
Posts: 34
Joined: Tue Feb 28, 2006 1:25 pm

Post by Teecee »

I have the final Nagios 2.0 release. It comes with the event broker on by default but I reinstalled it with the option on just to be sure. I have Cacti 8.6H installed with the plugins patch. I am getting the following errors when I try to add the NPC plugin.


I am pretty sure I followed the instructions. I upgraded my mysql to 4.1 and get the dev libs. Any help?


:/usr/local/nagios/module$ sudo make
Password:
gcc -g -O2 -Wall -o inserter.o inserter.c -shared -I../include -I/usr/include/mysql -lmysqlclient -fPIC
inserter.c:47:35: error: ../include/nebmodules.h: No such file or directory
inserter.c:48:37: error: ../include/nebcallbacks.h: No such file or directory
inserter.c:49:35: error: ../include/nebstructs.h: No such file or directory
inserter.c:50:31: error: ../include/broker.h: No such file or directory
inserter.c:53:31: error: ../include/config.h: No such file or directory
inserter.c:54:31: error: ../include/common.h: No such file or directory
inserter.c:55:31: error: ../include/nagios.h: No such file or directory
inserter.c:56:32: error: ../include/objects.h: No such file or directory
inserter.c:64: warning: type defaults to ‘int’ in declaration of ‘NEB_API_VERSION’
inserter.c:64: warning: parameter names (without types) in function declaration
inserter.c:64: warning: data definition has no type or storage class
inserter.c:78: error: syntax error before ‘*’ token
inserter.c:78: warning: type defaults to ‘int’ in declaration of ‘hostgroup_list’
inserter.c:78: warning: data definition has no type or storage class
inserter.c:79: error: syntax error before ‘*’ token
inserter.c:79: warning: type defaults to ‘int’ in declaration of ‘servicegroup_list’
inserter.c:79: warning: data definition has no type or storage class
inserter.c:80: error: syntax error before ‘*’ token
inserter.c:80: warning: type defaults to ‘int’ in declaration of ‘host_list’
inserter.c:80: warning: data definition has no type or storage class
inserter.c:81: error: syntax error before ‘*’ token
inserter.c:81: warning: type defaults to ‘int’ in declaration of ‘service_list’
inserter.c:81: warning: data definition has no type or storage class
inserter.c:121: error: ‘FALSE’ undeclared here (not in a function)
inserter.c:124: error: syntax error before ‘nebmodule’
inserter.c: In function ‘nebmodule_init’:
inserter.c:130: error: ‘handle’ undeclared (first use in this function)
inserter.c:130: error: (Each undeclared identifier is reported only once
inserter.c:130: error: for each function it appears in.)
inserter.c:132: warning: implicit declaration of function ‘write_to_logs_and_console’
inserter.c:132: error: ‘NSLOG_INFO_MESSAGE’ undeclared (first use in this function)
inserter.c:132: error: ‘TRUE’ undeclared (first use in this function)
inserter.c:137: warning: implicit declaration of function ‘schedule_new_event’
inserter.c:137: error: ‘EVENT_USER_FUNCTION’ undeclared (first use in this function)
inserter.c:144: warning: implicit declaration of function ‘sprintf’
inserter.c:144: warning: incompatible implicit declaration of built-in function ‘sprintf’
inserter.c:151: warning: implicit declaration of function ‘neb_register_callback’
inserter.c:151: error: ‘NEBCALLBACK_TIMED_EVENT_DATA’ undeclared (first use in this function)
inserter.c: In function ‘nebmodule_deinit’:
inserter.c:162: warning: implicit declaration of function ‘deschedule_event’
inserter.c:162: error: ‘EVENT_USER_FUNCTION’ undeclared (first use in this function)
inserter.c:162: error: ‘TRUE’ undeclared (first use in this function)
inserter.c:164: error: ‘NSLOG_INFO_MESSAGE’ undeclared (first use in this function)
inserter.c:168: warning: implicit declaration of function ‘neb_deregister_callback’
inserter.c:168: error: ‘NEBCALLBACK_HOST_STATUS_DATA’ undeclared (first use in this function)
inserter.c:169: error: ‘NEBCALLBACK_SERVICE_STATUS_DATA’ undeclared (first use in this function)
inserter.c:170: error: ‘NEBCALLBACK_HOST_CHECK_DATA’ undeclared (first use in this function)
inserter.c:171: error: ‘NEBCALLBACK_SERVICE_CHECK_DATA’ undeclared (first use in this function)
inserter.c: In function ‘loadconfig’:
inserter.c:179: error: ‘host’ undeclared (first use in this function)
inserter.c:179: error: ‘hl’ undeclared (first use in this function)
inserter.c:180: error: ‘service’ undeclared (first use in this function)
inserter.c:180: error: ‘sl’ undeclared (first use in this function)
inserter.c:181: error: ‘hostgroup’ undeclared (first use in this function)
inserter.c:181: error: ‘hg’ undeclared (first use in this function)
inserter.c:182: error: ‘servicegroup’ undeclared (first use in this function)
inserter.c:182: error: ‘sg’ undeclared (first use in this function)
inserter.c:188: error: ‘NEBCALLBACK_TIMED_EVENT_DATA’ undeclared (first use in this function)
inserter.c:191: error: ‘nebstruct_timed_event_data’ undeclared (first use in this function)
inserter.c:191: error: syntax error before ‘)’ token
inserter.c:191: error: ‘NEBTYPE_TIMEDEVENT_ADD’ undeclared (first use in this function)
inserter.c:196: warning: implicit declaration of function ‘asprintf’
inserter.c:253: warning: value computed is not used
inserter.c:256: error: ‘nebstruct_host_status_data’ undeclared (first use in this function)
inserter.c:256: error: syntax error before ‘ds’
inserter.c:257: error: ‘ds’ undeclared (first use in this function)
inserter.c:261: error: ‘NEBCALLBACK_HOST_STATUS_DATA’ undeclared (first use in this function)
inserter.c:266: warning: incompatible implicit declaration of built-in function ‘sprintf’
inserter.c:267: error: ‘NSLOG_INFO_MESSAGE’ undeclared (first use in this function)
inserter.c:267: error: ‘TRUE’ undeclared (first use in this function)
inserter.c:269: warning: value computed is not used
inserter.c:272: error: ‘nebstruct_service_status_data’ undeclared (first use in this function)
inserter.c:272: error: syntax error before ‘ds’
inserter.c:275: error: ‘NEBCALLBACK_SERVICE_STATUS_DATA’ undeclared (first use in this function)
inserter.c:290: warning: value computed is not used
inserter.c:292: error: ‘hostgroupmember’ undeclared (first use in this function)
inserter.c:292: error: ‘hgm’ undeclared (first use in this function)
inserter.c:345: warning: value computed is not used
inserter.c:347: error: ‘servicegroupmember’ undeclared (first use in this function)
inserter.c:347: error: ‘sgm’ undeclared (first use in this function)
inserter.c:429: error: ‘NEBCALLBACK_HOST_CHECK_DATA’ undeclared (first use in this function)
inserter.c:430: error: ‘NEBCALLBACK_SERVICE_CHECK_DATA’ undeclared (first use in this function)
inserter.c: In function ‘processCheck’:
inserter.c:445: error: ‘NEBCALLBACK_HOST_CHECK_DATA’ undeclared (first use in this function)
inserter.c:447: error: ‘nebstruct_host_check_data’ undeclared (first use in this function)
inserter.c:447: error: ‘host_check_data’ undeclared (first use in this function)
inserter.c:447: error: syntax error before ‘)’ token
inserter.c:449: error: ‘NEBTYPE_HOSTCHECK_PROCESSED’ undeclared (first use in this function)
inserter.c:464: error: ‘NEBCALLBACK_SERVICE_CHECK_DATA’ undeclared (first use in this function)
inserter.c:466: error: ‘nebstruct_service_check_data’ undeclared (first use in this function)
inserter.c:466: error: ‘service_check_data’ undeclared (first use in this function)
inserter.c:466: error: syntax error before ‘)’ token
inserter.c:468: error: ‘NEBTYPE_SERVICECHECK_PROCESSED’ undeclared (first use in this function)
inserter.c:487: warning: incompatible implicit declaration of built-in function ‘sprintf’
inserter.c:488: error: ‘NSLOG_INFO_MESSAGE’ undeclared (first use in this function)
inserter.c:488: error: ‘TRUE’ undeclared (first use in this function)
inserter.c: In function ‘processStatus’:
inserter.c:500: error: ‘service’ undeclared (first use in this function)
inserter.c:500: error: ‘tmp_service’ undeclared (first use in this function)
inserter.c:501: error: ‘host’ undeclared (first use in this function)
inserter.c:501: error: ‘tmp_host’ undeclared (first use in this function)
inserter.c:507: error: ‘TRUE’ undeclared (first use in this function)
inserter.c:514: error: ‘NEBCALLBACK_HOST_STATUS_DATA’ undeclared (first use in this function)
inserter.c:516: error: ‘nebstruct_host_status_data’ undeclared (first use in this function)
inserter.c:516: error: ‘host_status_data’ undeclared (first use in this function)
inserter.c:516: error: syntax error before ‘)’ token
inserter.c:517: error: syntax error before ‘)’ token
inserter.c:709: error: ‘NEBCALLBACK_SERVICE_STATUS_DATA’ undeclared (first use in this function)
inserter.c:711: error: ‘nebstruct_service_status_data’ undeclared (first use in this function)
inserter.c:711: error: ‘service_status_data’ undeclared (first use in this function)
inserter.c:711: error: syntax error before ‘)’ token
inserter.c:712: error: syntax error before ‘)’ token
inserter.c:887: warning: incompatible implicit declaration of built-in function ‘sprintf’
inserter.c:888: error: ‘NSLOG_INFO_MESSAGE’ undeclared (first use in this function)
inserter.c: In function ‘append’:
inserter.c:945: error: ‘NSLOG_INFO_MESSAGE’ undeclared (first use in this function)
inserter.c:945: error: ‘TRUE’ undeclared (first use in this function)
inserter.c: In function ‘err_out’:
inserter.c:978: error: ‘NSLOG_INFO_MESSAGE’ undeclared (first use in this function)
inserter.c:978: error: ‘TRUE’ undeclared (first use in this function)
inserter.c: In function ‘sql_dump’:
inserter.c:1007: error: ‘TRUE’ undeclared (first use in this function)
inserter.c:1067: warning: implicit declaration of function ‘printf’
inserter.c:1067: warning: incompatible implicit declaration of built-in function ‘printf’
make: *** [all] Error 1
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests