|
|
| Author |
Message |
jgoldschrafe
Joined: 21 Aug 2008 Posts: 1 Location: Cold Spring Harbor, NY
|
Posted: Thu Aug 21, 2008 4:22 pm Post subject: |
|
|
This plugin seems really cool. Has anyone gotten it to scale? I'm running it in an environment with around 2400 service checks on 450 hosts and paging through results is absolutely unbearable. Half the time, it never even finishes when I try to switch pages, because it hits the specified PHP max execution time of 30 seconds.
I'm not sure if the queries are terribly unoptimized or if I'm doing something wrong with my PHP configuration. The server's no dog, it's a quad Xeon with 4 GB of RAM and a rather fast RAID 0+1 DB volume.
Edit: Neat, it looks like something is actually making PHP segfault:
| Code: | [Thu Aug 21 17:25:01 2008] [error] [client 143.48.3.13] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /usr/share/cacti/plugins/npc/lib/Doctrine/Table.php on line 1645, referer: http://monitor1/cacti/plugins/npc/npc.php?module=layoutDev&action=drawLayout
[Thu Aug 21 17:25:02 2008] [notice] child pid 19025 exit signal Segmentation fault (11) |
I've turned on MySQL slow query logging and I want to see what it turns up.
Edit 2: I keep getting this:
| Code: | | SELECT n.hostgroup_id AS n__hostgroup_id, n.instance_id AS n__instance_id, n.config_type AS n__config_type, n.hostgroup_object_id AS n__hostgroup_object_id, n.alias AS n__alias, n3.hoststatus_id AS n3__hoststatus_id, n3.host_object_id AS n3__host_object_id, n3.current_state AS n3__current_state, n3.output AS n3__output, n7.instance_id AS n7__instance_id, n7.instance_name AS n7__instance_name, n5.name1 AS n5__0, n6.name1 AS n6__1 FROM npc_hostgroups n INNER JOIN npc_hostgroup_members n2 ON n.hostgroup_id = n2.hostgroup_id INNER JOIN npc_hostgroup_members n4 ON n.hostgroup_id = n4.hostgroup_id INNER JOIN npc_hoststatus n3 ON n2.host_object_id = n3.host_object_id INNER JOIN npc_objects n5 ON n.hostgroup_object_id = n5.object_id INNER JOIN npc_objects n6 ON n3.host_object_id = n6.object_id INNER JOIN npc_instances n7 ON n.instance_id = n7.instance_id ORDER BY n5__0 ASC, n6__1 ASC; |
Does anyone know where this query is being executed from? It's returning an absolutely obscene number of rows, in the order of hundreds of thousands. Debugging and profiling PHP is absolutely not my forte.
|
|
| Back to top |
|
 |
sfxdana
Joined: 20 Aug 2008 Posts: 2
|
Posted: Thu Aug 28, 2008 6:23 am Post subject: Problems with NPC |
|
|
We currently have about 844+ hosts and 6500+ services running in Nagios3.
But we have the following problems with the NPC plugin (166):
1. We get PHP Fatal errors until setting php.ini mem option to 256MB.
2. After that we get PHP Fatal errors about execution time exceeding 30 secs.
Changing that to 60 seconds gets us back to nr. 1
3. With more than a 100+ performance counters, it's a pain to add the data input into cacti.
N2C doesn't look like it's does this. Would be nice to have an option to add data input via a list as with N2C.
We are using a distributed enviroment so using cacti to get that data is not possible.
Sfxdana
|
|
| Back to top |
|
 |
proc
Joined: 27 Aug 2008 Posts: 3
|
Posted: Fri Aug 29, 2008 3:56 pm Post subject: Minor sort patch |
|
|
I am not sure if this has been posted before, but I wasn't able to find any references to it so I thought I would submit it.
I noticed on the page when setting up hosts that the "Nagios Host Mapping" pull down was seemingly randomly sorted. I had a heck of a time finding one of our 400+ hosts in there. This small patch simply adds the "ORDER BY name" line to the sql query which returns the results sorted.
| Code: | --- setup.php.orig 2008-08-28 11:52:19.000000000 -0400
+++ setup.php 2008-08-28 11:51:47.000000000 -0400
@@ -248,7 +248,8 @@
"default" => "0",
"sql" => "SELECT npc_hosts.host_object_id as id, concat(npc_instances.instance_name, ': ', obj1.name1) "
. "AS name FROM `npc_hosts` LEFT JOIN npc_objects as obj1 ON npc_hosts.host_object_id=obj1.object_id "
- . "LEFT JOIN npc_instances ON npc_hosts.instance_id=npc_instances.instance_id",
+ . "LEFT JOIN npc_instances ON npc_hosts.instance_id=npc_instances.instance_id "
+ . "ORDER BY name",
"form_id" => false
);
}
|
| Description: |
|
 Download |
| Filename: |
sort.patch |
| Filesize: |
872 Bytes |
| Downloaded: |
37 Time(s) |
|
|
| Back to top |
|
 |
driden91
Joined: 20 Jan 2006 Posts: 43
|
Posted: Tue Sep 02, 2008 5:39 am Post subject: |
|
|
hello,
Is it possible to add a machine in easily with your Nagios plugin?
for example at the same time that adding the machine in cacti
thank in advance
|
|
| Back to top |
|
 |
econ
Joined: 16 Nov 2007 Posts: 10
|
Posted: Tue Sep 02, 2008 9:48 am Post subject: Refresh |
|
|
| TheWitness wrote: | I suggest you create your own top_graph_header.php, instead call it top_npc_header.php and remove the refresh bit.
TheWitness |
If I copy top_graph_header.php what else would i need to modify once the file is copied into the plugin directory?
or
Has anyone else found a better way to deal with the refresh rate of NPC without it affecting the rest of cacti?
Thanks!
|
|
| Back to top |
|
 |
blugger
Joined: 07 May 2008 Posts: 28
|
Posted: Fri Sep 05, 2008 8:00 am Post subject: Problem with rights ... |
|
|
Do you have any idea on that?
| Description: |
|
| Filesize: |
108.16 KB |
| Viewed: |
1448 Time(s) |

|
| Description: |
|
| Filesize: |
113.49 KB |
| Viewed: |
1448 Time(s) |

|
| Description: |
|
| Filesize: |
124.16 KB |
| Viewed: |
1448 Time(s) |

|
|
|
| Back to top |
|
 |
econ
Joined: 16 Nov 2007 Posts: 10
|
Posted: Fri Sep 05, 2008 12:36 pm Post subject: Re: Problem with rights ... |
|
|
| blugger wrote: | | Do you have any idea on that? |
Blugger you are getting that error cause you have not specified the full path to the nagios.cmd. Under Settings | NPC put "/usr/local/nagios/var/rw/nagios.cmd" and see if that resolves your issue.
|
|
| Back to top |
|
 |
blugger
Joined: 07 May 2008 Posts: 28
|
Posted: Sat Sep 06, 2008 12:18 pm Post subject: Thx ... |
|
|
Hi again!
Thanks, that fixed my problem.
Now there is the question how to get my cacti devices into nagios (npc)?
There is a "N2C" but no "C2N" ...
I hope nagios (npc) will bring me some advantages here ...
|
|
| Back to top |
|
 |
econ
Joined: 16 Nov 2007 Posts: 10
|
Posted: Wed Sep 10, 2008 8:13 am Post subject: Re: Refresh |
|
|
[quote="econ"] | TheWitness wrote: | I suggest you create your own top_graph_header.php, instead call it top_npc_header.php and remove the refresh bit.
TheWitness |
Does anyone have any suggestions on how to fix the refresh rate for NPC? When you enable NPC it changes the refresh for all of cacti. I have remarked out the piece in npc for refresh but then it adopts cacti's refresh rate and causes lots of tax on cacti.
Thanks!
|
|
| Back to top |
|
 |
Palermo
Joined: 11 Sep 2008 Posts: 36
|
Posted: Thu Sep 18, 2008 11:30 am Post subject: |
|
|
Hi,
I have a question.
I sucssefully installed nagios according the quick manual, but on installing ndoutils-1.4b7 i ran into some problems. hopefully you can help me.
Let me show you what i did....
For CactiEZ
I did the folowing.
| Code: |
#Removed the nagios folder (Older version) in /usr/local/nagios/
#Made a new folder in the same directory and dit the following steps
yum install httpd
yum install gcc
yum install glibc glibc-common
yum install gd gd-devel
#It starded to download all kinds of things. :-)
su -l
#To become a root user
/usr/sbin/useradd -m nagios
passwd nagios
#For creating a user + pass
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd apache
#Creating a usergroup
cd ~/downloads
tar xzf nagios-3.0.3.tar.gz
cd nagios-3.0.3
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
#to Compile the Nagios source code.
cd ~/downloads
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
#To Compile and install the plugins.
chkconfig --add nagios
chkconfig nagios on
Verify the sample Nagios configuration files.
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
#No errors has been found
service nagios start
#When is go to the http://localhost/nagios/ link
#it prompt with a login screen an version 3.0.3 works
#Next i need to install ndoutils-1.4b7 to get NPC working
cd ~/downloads
tar xzf ndoutils-1.4.tar.gz
#This error came
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors
#i extracted the file in windows and copy'd all the files and directory's to #the download folder on the cacti system.
cd ndoutils-1.4b7
#i enterd the commando "make". thats what the manual says.
[root@monitoring ndoutils-1.4b7]# make
make: *** No targets specified and no makefile found. Stop.
|
Well what am i doing wrong?
The manual says that i need to do the "make" commando. but i gess no "make" file is in the directory.
What should i do now?
i hope you can help me.
If you need more info then let me know..
Thx in advanced
| Quote: | Cacti Version - 0.8.7b
Plugin Architecture - 2.0
Poller Type - Cactid v
Server Info - Linux 2.6.9-67.0.4.plus.c4smp
Web Server - Apache/2.0.63 (CentOS)
PHP - 5.1.6
PHP Extensions - libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, standard, SimpleXML, sockets, SPL, shmop, session, Reflection, pspell, posix, mime_magic, iconv, hash, gmp, gettext, ftp, exif, date, curl, ctype, calendar, bz2, zlib, pcre, openssl, apache2handler, gd, ldap, mysql, mysqli, PDO, pdo_mysql, pdo_sqlite, snmp, eAccelerator
MySQL - 5.0.54
RRDTool - 1.2.23
SNMP - 5.1.2
PluginsGlobal Plugin Settings (settings - v0.3)
Thresholds (thold - v0.3.9)
Large Site Performane Booster for Cacti (boost - v1.5)
Device Monitoring (monitor - v0.8.2)
Network Discovery (discovery - v0.8.4)
Network Tools (tools - v0.2)
Syslog Monitoring (syslog - v0.5.2)
Device Tracking (mactrack - v1.1)
RRD Cleaner (rrdclean - v1.1)
Update Checker (update - v0.4)
FlowView (flowview - v0.4)
Host Info (hostinfo - v0.2)
Error Images (errorimage - v0.1)
PHP Network Weathermap (weathermap - v0.95b)
Create Aggregate Graphs (aggregate - v0.63)
Documents (docs - v0.1)
report it! (report it! - v0.5.0) |
|
|
| Back to top |
|
 |
Palermo
Joined: 11 Sep 2008 Posts: 36
|
Posted: Fri Sep 19, 2008 7:41 am Post subject: |
|
|
All progress goes with litle steps sometime
Somwhere on forums elswere i foud the commando show configure
Then when i use this commando again
./configure
It gave an permission problem
i had to change the permissions with this
Then the ./configure workt.
The make commando also workt..
than is start creating a database
| Code: |
mysql>create database nagios
|
Creating a user
| Code: |
mysql>CREATE USER 'nagios'@'localhost' IDENTFIED BY '[i]password[/i]'
|
than is updated the user with all the permissions acording the manual
| Code: |
mysql>GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'nagios'@'localhost';
|
I is try to login with the new user see if its woring
| Code: |
[root@localhost ~]# mysql -u nagios -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 46226
Server version: 5.0.54 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
|
than my next wall came it all went well
| Code: |
[root@localhost db]# ./upgradedb -u nagios -p [i]PASSWORD[/i] -d mysql.sql
DBI connect('database=mysql.sql;host=localhost','nagios',...) failed: Access denied for user 'nagios'@'localhost' (using password: YES) at ./upgradedb line 41
|
when i try to loging with the nagios username an password in mysql than is all ok no error. wy does it give an error?
|
|
| Back to top |
|
 |
econ
Joined: 16 Nov 2007 Posts: 10
|
Posted: Fri Sep 19, 2008 12:13 pm Post subject: |
|
|
| Palermo wrote: | All progress goes with litle steps sometime
| Code: |
[root@localhost db]# ./upgradedb -u nagios -p [i]PASSWORD[/i] -d mysql.sql
DBI connect('database=mysql.sql;host=localhost','nagios',...) failed: Access denied for user 'nagios'@'localhost' (using password: YES) at ./upgradedb line 41
|
when i try to loging with the nagios username an password in mysql than is all ok no error. wy does it give an error? |
Does your mysql user nagios have SELECT, INSERT, UPDATE and DELETE permissions? All four will be needed.
|
|
| Back to top |
|
 |
Palermo
Joined: 11 Sep 2008 Posts: 36
|
Posted: Fri Sep 19, 2008 1:41 pm Post subject: |
|
|
Hi,
Yes the user has all the needed permissions
| Code: |
mysql>GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'nagios'@'localhost';
|
I tested the accoud by logging in into mysql
| Code: |
[root@localhost ~]# mysql -u nagios -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 51480
Server version: 5.0.54 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
|
so the question is wy is the commando not acepting the user and password
| Code: |
[root@localhost db]# ./upgradedb -u nagios -p [i]PASSWORD[/i] -d mysql.sql
DBI connect('database=mysql.sql;host=localhost','nagios',...) failed: Access denied for user 'nagios'@'localhost' (using password: YES) at ./upgradedb line 41
|
|
|
| Back to top |
|
 |
sterpstra
Joined: 27 May 2008 Posts: 33 Location: So Cal
|
Posted: Mon Sep 22, 2008 5:48 pm Post subject: Still have DB problems |
|
|
I'm still having some problems getting my NPC to work. I have been following the thread for a bit and have only changed my php.ini to use 256M of memory. Other than that, everything is original configs... I get to the dashboard but it doesn't completely populate... And when I got to hosts, I get nothing. Anyone have any more ideas? Here's my config:
| Quote: | Cacti Version - 0.8.7b
Plugin Architecture - 2.1
Poller Type - CMD.php
Server Info - Linux 2.6.24-16-server
Web Server - Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.1 with Suhosin-Patch
PHP - 5.2.4-2ubuntu5.1
PHP Extensions - zip, xmlwriter, libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, session, SimpleXML, sockets, soap, SPL, shmop, standard, Reflection, posix, mime_magic, mbstring, json, iconv, hash, gettext, ftp, filter, exif, dom, dba, date, ctype, calendar, bz2, bcmath, zlib, pcre, openssl, xmlreader, apache2handler, PDO, pdo_mysql, ADOdb, gd, mysql, mysqli, snmp
MySQL - 5.0.51a-3ubuntu5.1
RRDTool - 1.2.19
SNMP - 5.4.1
PluginsThresholds (thold - v0.3.9)
SuperLinks (superlinks - v0.72)
Network Tools (tools - v0.3)
Network Discovery (discovery - v0.8.4)
Device Monitoring (monitor - v0.8.2)
PHP Network Weathermap (weathermap - v0.95b)
Realtime for Cacti (realtime - v0.34)
Cacti-ReportIt (reportit - v0.6.1)
Global Plugin Settings (settings - v0.5)
Nagios plugin for Cacti (npc - v2.0.0b)
PHP Network Managing (PHP Network Managing - v0.6)
Syslog Monitoring (syslog - v0.5.2)
Host Info (hostinfo - v0.2)
Device Tracking (mactrack - v1.1) |
|
|
| Back to top |
|
 |
Palermo
Joined: 11 Sep 2008 Posts: 36
|
Posted: Tue Sep 23, 2008 8:34 am Post subject: |
|
|
@ econ
I got it working.
Again i flowed the NDOUTILS install.txt can be found in de default folder of ndoutils-1.4b7 an follow also i flowed the http://trac2.assembla.com/npc/wiki/QuickStartGuide that should work
however i have a deferent problem.
When i start nagios an look at the log
| Code: |
[09-23-2008 15:00:42] ndomod: Error writing to data sink! Some output may get lost...
Informational Message[09-23-2008 15:00:42] ndomod: Successfully flushed 79 queued items to data sink.
Informational Message[09-23-2008 15:00:42] ndomod: Successfully reconnected to data sink! 0 items lost, 79 queued items to flush.
Informational Message[09-23-2008 15:00:26] ndomod: Error writing to data sink! Some output may get lost...
Informational Message[09-23-2008 15:00:26] ndomod: Successfully flushed 86 queued items to data sink.
|
the log is full of it.
Also i don't have nothing in the MySQL tables.
I check t the user name and password
| Code: |
mysql> select * from npc_hosts;
Empty set (0.00 sec)
mysql>
|
The user name has all permissions to do anything.
I check t an compared the files witch has been posted bij divagater
All seems to be good.
padawan had the same problem and had found a ndo.sock file witch i don't have..
Have any idea ???
attach the config files witch i use..
hope someone can help me
| Description: |
|
 Download |
| Filename: |
ndomod.txt |
| Filesize: |
4.79 KB |
| Downloaded: |
65 Time(s) |
| Description: |
|
 Download |
| Filename: |
ndo2db.txt |
| Filesize: |
3.93 KB |
| Downloaded: |
36 Time(s) |
|
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|