Nagios Plugin for Cacti (NPC) 2.0.4
Moderators: Developers, Moderators
-
- Posts: 25
- Joined: Mon May 08, 2006 10:31 am
n2o_2k,
I'm the one who had the previous error, and I worked around it (before upgrading php) by modifying the line in controllers.php from
return(json_encode(array('success' => false, 'msg' => "An error occurred in $class->$method. See error logs for detail.")));
to
return(json_encode(array('success' => false, 'msg' => "An error occurred in class->method. See error logs for detail.")));
Regards
Ian
I'm the one who had the previous error, and I worked around it (before upgrading php) by modifying the line in controllers.php from
return(json_encode(array('success' => false, 'msg' => "An error occurred in $class->$method. See error logs for detail.")));
to
return(json_encode(array('success' => false, 'msg' => "An error occurred in class->method. See error logs for detail.")));
Regards
Ian
Thanks for the quick reply, it fixed my problem. Now time to move to the next step.sonartribe wrote:n2o_2k,
I'm the one who had the previous error, and I worked around it (before upgrading php) by modifying the line in controllers.php from
return(json_encode(array('success' => false, 'msg' => "An error occurred in $class->$method. See error logs for detail.")));
to
return(json_encode(array('success' => false, 'msg' => "An error occurred in class->method. See error logs for detail.")));
Regards
Ian
Edit:
After looking at the statement causing the problem: $class->$method, you need to make sure that there is a space between $class and -> so that php doesn't think that you are trying to access a member of $class. Two ways I tested it and it worked fine:
Code: Select all
return(json_encode(array('success' => false, 'msg' => "An error occurred in {$class}->{$method}. See error logs for detail.")));
Code: Select all
return(json_encode(array('success' => false, 'msg' => "An error occurred in $class -> $method. See error logs for detail.")));
- divagater
- Cacti User
- Posts: 191
- Joined: Wed Nov 17, 2004 5:22 pm
- Location: Chapel Hill, NC.
- Contact:
Great catch. the double quotes should have prevented the $class->$method from being interpreted as an actual method. The error is directly related to the json_module's incorrect interpretation and it not an issue in json above 5.2 however, you suggestion for reformatting that line makes perfect sense and will allow for json support at and below 5.2.0. This will be corrected in the next release coming soon.After looking at the statement causing the problem: $class->$method, you need to make sure that there is a space between $class and -> so that php doesn't think that you are trying to access a member of $class.
Cheers,
Billy
- divagater
- Cacti User
- Posts: 191
- Joined: Wed Nov 17, 2004 5:22 pm
- Location: Chapel Hill, NC.
- Contact:
gimpel, you are on the right track. If a particular service is returning performance data then when you view the 'Service State Information' screen for that service you will see a button on the tool bar that says 'Data Input Method'. Click that button and acknowledge the confirmation. Then the data input method will have been created.gimpel wrote:Hi,
first I want to thank for this great nagios frontend. This really makes nagios look good for our not-so-tech staff to show off server and website status.
I'm testing this on an openSUSE-10.3 VM in ESX - and so far it works just fine.
I have one question regarding N2C and creating graphs.
Is there something missing?
I somehow fail on seeing how to get performance data from NPC. Over to the graphs in Cacti
You get the service state information screen by double clicking on a service. I attached a screen shot as an example. If you don't see the button it is because there is not any performance data available for that service (or host).
~Billy
- Attachments
-
- Data Input Method button on the service state information screen.
- npc_data_import.png (46.34 KiB) Viewed 6915 times
Aah, now I got it. Thank you very much, Billy.
The point where I failed to find the way was actually, that I have to double-click on a service in the Services tab to enter the Service State Information menu. I didn't know that this menu actually exists.
From there it's clear how to proceed. Maybe adding a button or an entry in the right-click menu like "View Service State Information" would make that more obvious to find.
Wow, that's superb! For an alpha, this already works very well!
Thanks again!
The point where I failed to find the way was actually, that I have to double-click on a service in the Services tab to enter the Service State Information menu. I didn't know that this menu actually exists.
From there it's clear how to proceed. Maybe adding a button or an entry in the right-click menu like "View Service State Information" would make that more obvious to find.
Wow, that's superb! For an alpha, this already works very well!
Thanks again!
-
- Posts: 3
- Joined: Tue Apr 01, 2008 3:29 pm
Non Paging Extjs Grid & filtering
Can you add in the option to specify whether I want to use a (extjs that is) paging grid, or a non-paging grid. And/or allow me to specify how many items I want it to display per page? Using this in a large noc environment, the service problems view is very important. However if I can only see 20 services per page it makes it hard. This would apply to other grid pages as well.
Another option is the concept of a livegrid, no paging just scrolling.
http://www.siteartwork.de/livegrid/
Also, filtering on the grid would be great too. Saving the filers so that they can be used by other users would be great. e.g. an acknowledged filter, and a "new alert" filter etc.
If these could be added as enhancement requests that would be great.
Another option is the concept of a livegrid, no paging just scrolling.
http://www.siteartwork.de/livegrid/
Also, filtering on the grid would be great too. Saving the filers so that they can be used by other users would be great. e.g. an acknowledged filter, and a "new alert" filter etc.
If these could be added as enhancement requests that would be great.
- divagater
- Cacti User
- Posts: 191
- Joined: Wed Nov 17, 2004 5:22 pm
- Location: Chapel Hill, NC.
- Contact:
Re: Non Paging Extjs Grid & filtering
Thanks for the feature requests.
User configurable setting for items per page will be available in the beta release of NPC coming soon. Some of the code for this is in place already but I disabled it for the alpha release because it wasn't fully implemented.
I did have the grid rows under Cacti->Console->Settings for portlets and full page grids but that was system wide and I want to do this per user. I think I will end up adding a top toolbar with a settings option to the full page grids like hosts, services etc. The portlets already have a configuration icon that is simply hidden at the moment.
Cheers,
Billy
Code: Select all
Can you add in the option to specify whether I want to use a (extjs that is) paging grid, or a non-paging grid. And/or allow me to specify how many items I want it to display per page?
I did have the grid rows under Cacti->Console->Settings for portlets and full page grids but that was system wide and I want to do this per user. I think I will end up adding a top toolbar with a settings option to the full page grids like hosts, services etc. The portlets already have a configuration icon that is simply hidden at the moment.
This idea has merit and I will see what I can do to get it into 2.1.0. I have frozen major features for 2.0.0 so I could get a GA release out.Another option is the concept of a livegrid, no paging just scrolling.
Another good idea that I had not considered. I will open enhancement request for this and the live grid and add them to the 2.1.0 milestone.Also, filtering on the grid would be great too. Saving the filers so that they can be used by other users would be great. e.g. an acknowledged filter, and a "new alert" filter etc.
Cheers,
Billy
very nice plugins !
i've been waiting a long time to get an issue to mix nagios and cacti!
installation is finish
i've got the bug on controller on line 363 too
i modify this line as :
it works fine now i got to add hosts services ect ect ^^
i've been waiting a long time to get an issue to mix nagios and cacti!
installation is finish
i've got the bug on controller on line 363 too
i modify this line as :
removing $method to methodreturn(json_encode(array('success' => false, 'msg' => "An error occurred in $class->method. See error logs for detail.")));
it works fine now i got to add hosts services ect ect ^^
Last edited by padawan on Fri Apr 11, 2008 9:26 am, edited 1 time in total.
- divagater
- Cacti User
- Posts: 191
- Joined: Wed Nov 17, 2004 5:22 pm
- Location: Chapel Hill, NC.
- Contact:
There is a fix for this in the next release coming soon. The fix will update the line to read:padawan wrote:very nice plugins !
i've been waiting a long time to get an issue to mix nagios and cacti!
installation is finish
i've got the but on controller on line 363 too
i modify this line as :
removing $method to methodreturn(json_encode(array('success' => false, 'msg' => "An error occurred in $class->method. See error logs for detail.")));
it works fine now i got to add hosts services ect ect ^^
Code: Select all
return(json_encode(array('success' => false, 'msg' => "An error occurred in $class -> $method. See error logs for detail.")));
- divagater
- Cacti User
- Posts: 191
- Joined: Wed Nov 17, 2004 5:22 pm
- Location: Chapel Hill, NC.
- Contact:
Please check out the quick start guide for installation instructions. There are various requirements of which ndo2db is one. Thats not what is causing the blank page however. You are probably missing json or pdo support (or both).lavermil wrote:I have NPC install but I get a blank screen when i click on the tab. Any idea?
P.S. I do not have the NDO util installed. Do i need that?
FYI for the people having issues getting json installed use
pecl install json
~Billy
billy,divagater wrote:Please check out the quick start guide for installation instructions. There are various requirements of which ndo2db is one. Thats not what is causing the blank page however. You are probably missing json or pdo support (or both).lavermil wrote:I have NPC install but I get a blank screen when i click on the tab. Any idea?
P.S. I do not have the NDO util installed. Do i need that?
FYI for the people having issues getting json installed use
pecl install json
~Billy
thx for your reply.
I have PDO and json installed. Well lets say json is installed via pear. I don't get any code complaints about it missing like when I uninstall it. i have nagios 3.0.1 installed along with ndo. However the interesting part is NDO has some wierd issues. Any thoughts?
Code: Select all
Apr 10 09:37:15 iss-mon nagios: ndomod: Successfully reconnected to data sink! 0 items lost, 80 queued items to flush.
Apr 10 09:37:15 iss-mon nagios: ndomod: Successfully flushed 80 queued items to data sink.
Apr 10 09:37:15 iss-mon nagios: ndomod: Error writing to data sink! Some output may get lost...
Code: Select all
[PHP Modules]
bz2
calendar
ctype
curl
date
exif
ftp
gd
gettext
gmp
hash
iconv
libxml
mime_magic
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
posix
pspell
Reflection
session
shmop
SimpleXML
snmp
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
zlib
[Zend Modules]
[root@iss-mon ~]# pecl install json
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update
Skipping package "pear/json", already installed as version 1.2.1
- divagater
- Cacti User
- Posts: 191
- Joined: Wed Nov 17, 2004 5:22 pm
- Location: Chapel Hill, NC.
- Contact:
lavermil, edit plugins/npc/controllers/controller.php and find the following line around line 363:
Change the line to:
I need to just get the latest trunk built so this will stop messing up people. This may niot be your issue but is a good candidate. If the issue persists tail the apache error logs and then click the npc tab. Look for any fatal errors and post here.
Cheers,
Billy
Code: Select all
return(json_encode(array('success' => false, 'msg' => "An error occurred in $class->$method. See error logs for detail.")));
Code: Select all
return(json_encode(array('success' => false, 'msg' => "An error occurred in $class -> $method. See error logs for detail.")));
Cheers,
Billy
That got me a screen to look at. Now I have different errors. the new window displays the following now.
I have the following in the httpd/error_log
Code: Select all
// Add some properties to the params array npc.params.npc_portlet_refresh = 60; npc.params.npc_date_format = "Y-m-d"; npc.params.npc_time_format = "H:i:s"; npc.params.npc_nagios_url = "http://172.20.18.11/nagios/"; npc.params.userName = "admin"; var ExtState = Ext.decode('
Code: Select all
[Thu Apr 10 10:42:38 2008] [error] [client 172.20.19.254] PHP Fatal error: Call to undefined function json_encode() in /var/www/cacti/plugins/npc/controllers/layout.php on line 58, referer: http://172.20.18.11/cacti/plugins/npc/npc.php
- divagater
- Cacti User
- Posts: 191
- Joined: Wed Nov 17, 2004 5:22 pm
- Location: Chapel Hill, NC.
- Contact:
You are using the json support from pear. That will not be adequate as the pear json uses totally different method names etc. for encoding and decoding json objects.[Thu Apr 10 10:42:38 2008] [error] [client 172.20.19.254] PHP Fatal error: Call to undefined function json_encode() in /var/www/cacti/plugins/npc/controllers/layout.php on line 58, referer: http://172.20.18.11/cacti/plugins/npc/npc.php
NPC requires either PHP 5.2 and above with json support included or the php-json module to be installed.
~Billy
Who is online
Users browsing this forum: No registered users and 1 guest