Nagios Plugin for Cacti (NPC) Released

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

sorry for the double post
the forum have probleme with the code

:oops: :oops:

Code: Select all

inserter.c:50:31: ../include/broker.h : Aucun fichier ou répertoire de ce type
inserter.c:53:31: ../include/config.h : Aucun fichier ou répertoire de ce type
inserter.c:54:31: ../include/common.h : Aucun fichier ou répertoire de ce type
inserter.c:55:31: ../include/nagios.h : Aucun fichier ou répertoire de ce type
inserter.c:56:32: ../include/objects.h : Aucun fichier ou répertoire de ce type
inserter.c:64: attention : dans la déclaration de « NEB_API_VERSION », utilis                                                                              ation de « int » par défaut pour le type
inserter.c:64: attention : noms de paramètres (sans type) dans la déclaration                                                                               de fonction
inserter.c:64: attention : la définition de données n'a pas de type ni de clas                                                                              se de stockage
inserter.c:78: erreur: erreur de syntaxe avant un élément lexical « * »
inserter.c:78: attention : dans la déclaration de « hostgroup_list », utilisa                                                                              tion de « int » par défaut pour le type
inserter.c:78: attention : la définition de données n'a pas de type ni de clas                                                                              se de stockage
inserter.c:79: erreur: erreur de syntaxe avant un élément lexical « * »
inserter.c:79: attention : dans la déclaration de « servicegroup_list », util                                                                              isation de « int » par défaut pour le type
inserter.c:79: attention : la définition de données n'a pas de type ni de clas                                                                              se de stockage
inserter.c:80: erreur: erreur de syntaxe avant un élément lexical « * »
inserter.c:80: attention : dans la déclaration de « host_list », utilisation                                                                               de « int » par défaut pour le type
inserter.c:80: attention : la définition de données n'a pas de type ni de clas                                                                              se de stockage
inserter.c:81: erreur: erreur de syntaxe avant un élément lexical « * »
inserter.c:81: attention : dans la déclaration de « service_list », utilisati                                                                              on de « int » par défaut pour le type
inserter.c:81: attention : la définition de données n'a pas de type ni de clas                                                                              se de stockage
inserter.c:96: erreur: erreur de syntaxe avant « mysql »
inserter.c:96: attention : dans la déclaration de « mysql », utilisation de
Last edited by Mika2006 on Sat May 26, 2007 3:59 pm, edited 1 time in total.
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

SomeOne can help me
i make this and don't work the make:
# cd /var/www/html/cacti/plugins
#wget http://xxxxxxxxxx.com/cacti/plugin/Nagi ... .1a.tar.gz
# tar xzvf npc-0.1.1a.tar.gz
# chown 1000:users -R npc
# nano /var/www/html/cacti/include/config.php
looking for
$plugins = array();
and add
$plugins[] = 'npc';
Change this files
# nano /var/www/html/cacti/plugins/npc/neb/inserter.c
at ligne 143 add user pass connection database

and move this files
# mv /var/www/html/cacti/plugins/npc/neb/inserter.c /etc/nagios/
# mv /var/www/html/cacti/plugins/npc/neb/makefile /etc/nagios/
Install composant
#up2date -i gcc
move this files
# mkdir /etc/nagios/module
# cp /var/www/html/cacti/plugins/npc/neb/inserter.c /etc/nagios/module
# cp /var/www/html//cacti/plugins/npc/neb/makefile /etc/nagios/module
on lance le make:
# cd /etc/nagios/module
# make
but i have this probleme:
i have attache in texte files
someone can explain me how to fix it please?
Attachments
problem.txt
(18.76 KiB) Downloaded 671 times
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
eberkut
Posts: 19
Joined: Wed Jul 19, 2006 4:15 am

Post by eberkut »

Is there any news concerning the status of the NPC plugin ? Anyone ?

Last time I checked, it was still alpha but there was some testing being done.
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

no news :'(
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
liamr
Posts: 8
Joined: Thu Oct 25, 2007 9:29 am

problems building inserter.c

Post by liamr »

I'm trying to build the event broker, and am getting the following errors..

gcc -g -O2 -Wall -o inserter.o inserter.c -shared `pkg-config glib-2.0 --cflags` -I../include -I/usr/include/mysql `pkg-config glib-2.0 --libs` -lmysqlclient -fPIC
inserter.c: In function `nebmodule_init':
inserter.c:137: error: too few arguments to function `schedule_new_event'
inserter.c: In function `nebmodule_deinit':
inserter.c:162: warning: implicit declaration of function `deschedule_event'
inserter.c: In function `loadconfig':
inserter.c:292: error: `hostgroupmember' undeclared (first use in this function)
inserter.c:292: error: (Each undeclared identifier is reported only once
inserter.c:292: error: for each function it appears in.)
inserter.c:292: error: `hgm' undeclared (first use in this function)
inserter.c:347: error: `servicegroupmember' undeclared (first use in this function)
inserter.c:347: error: `sgm' undeclared (first use in this function)
make: *** [all] Error 1

nagios 3.0b6, cacti 0.8.7, mysql 4.1.15, gcc 3.4.5, glib 2.12.12
any suggestions?
liamr
Posts: 8
Joined: Thu Oct 25, 2007 9:29 am

inserter probs cont

Post by liamr »

Ok, it looks like the issue is that inserter is a nagios 2.x module, and I'm trying to run nagios 3.x. Has anyone ported the npc event broker forward to nagios 3.x?
sonartribe
Posts: 25
Joined: Mon May 08, 2006 10:31 am

NPC and 8.7.0

Post by sonartribe »

Has anyone managed to get it working with 0.8.7. I had it working fine under 0.8.6j, but under 0.8.7 the screen draws, but the only values filled in are the Host Status Summary (which I'm not convinced is showing the right values) and the Monitoring performance stats. The service status summary, Hostgroup: host status and hostgroup: service status tables are empty.

I know that nagios is still updating the tables, so I suspect it might be something to do with the change in the includes file structure.

Any ideas anyone?

Regards

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

fixed it

Post by sonartribe »

Okay,

I've managed to fix it, but at this point I don't know if it's broken anything else.

The offending line is in /lib/database.php in the db_fetch_assoc function. It looks like it's meant to clean up sql strings, but someone breaks the very long sql query in npc's statusDetail.php.

//$sql = str_replace(" ", " ", str_replace("\n", "", str_replace("\r", "", str_replace("\t", " ", $sql))));

I've commented it out, and it's fixed it.

Does anyone know whether this will have any more consequences?

Ian
slech
Cacti User
Posts: 90
Joined: Tue Nov 06, 2007 7:51 am

Post by slech »

where you can download this plugin ?
slech
Cacti User
Posts: 90
Joined: Tue Nov 06, 2007 7:51 am

Post by slech »

liamr
Posts: 8
Joined: Thu Oct 25, 2007 9:29 am

Post by liamr »

Has anyone gotten inserter.c working correctly with Nagios 3.0.x? I've got it built, but I'm just not convinced it's working.

I've attached the diff.

Also... Has someone implimented the hostgroup and servicegroup views? The 0.1.1a release tarball doesn't have them.
Attachments
neb.patch
inserter.c patch for nagios 3.0b6
(1.97 KiB) Downloaded 341 times
tarpat1
Posts: 17
Joined: Sun Jan 01, 2006 11:39 pm

Re: fixed it

Post by tarpat1 »

Have you noticed any effects of this fix? I would like to have this plugin working again.

sonartribe wrote:Okay,

I've managed to fix it, but at this point I don't know if it's broken anything else.

The offending line is in /lib/database.php in the db_fetch_assoc function. It looks like it's meant to clean up sql strings, but someone breaks the very long sql query in npc's statusDetail.php.

//$sql = str_replace(" ", " ", str_replace("\n", "", str_replace("\r", "", str_replace("\t", " ", $sql))));

I've commented it out, and it's fixed it.

Does anyone know whether this will have any more consequences?

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

How to use ?

Post by padawan »

Hi

I'm a new cacti user and I would like to know if someone could make a tutorial or explain how to install and use NPC plz ?

Thx a lot

Edit 1 : Ok I check the README :p
padawan
Posts: 25
Joined: Fri Nov 30, 2007 4:54 am

Post by padawan »

i can't compile inserter.o

can someone help plz ?
User avatar
zgamer
Cacti User
Posts: 86
Joined: Sat Sep 23, 2006 7:50 pm
Location: WI, USA

Post by zgamer »

padawan wrote:i can't compile inserter.o

can someone help plz ?
The plugin is designed are a rather old version (at this point) of nagios 2.0b4, the latest version of 2.x series will not work out of the box.....not certain about modifying the inserter.c file to bypass.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests