Installation nmidSmokeping PLUGIN

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
adigigi
Posts: 9
Joined: Tue Nov 06, 2012 4:23 am

Re: Installation nmidSmokeping PLUGIN

Post by adigigi »

The source code of the page with debug=1 is:

<h3>Main Server</h3>https://10.0.206.25/
<hr>
<h3>SP URL</h3>https://10.0.206.25/cgi-bin/smokeping.cgi
<hr>
<h3>Response Str</h3>
<hr>
<h3>File Part</h3>1352197431_1352111031.png<hr><h3>Image URL</h3>https://10.0.206.25/cache/1352197431_13 ... ut</h3><hr>


the getSmokePingImage.php is with original code, no change when the debug info from above is returned.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Installation nmidSmokeping PLUGIN

Post by phalek »

The Response string needs(!) to have something in it.

Is that really all ? Is that smokeping URL working ?

Maybe it's the SSL connection that causes this issue. Is the smokeping installation also reachable via http ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
adigigi
Posts: 9
Joined: Tue Nov 06, 2012 4:23 am

Re: Installation nmidSmokeping PLUGIN

Post by adigigi »

phalek wrote:The Response string needs(!) to have something in it.

Is that really all ? Is that smokeping URL working ?

Maybe it's the SSL connection that causes this issue. Is the smokeping installation also reachable via http ?
i've enabled http in apache2 so cacti and smokeping were reached under http (port 80) and i've modified in cacti, under setting nmidSmokeping, the url values for cacti site and smokeping with http insted https and they worked and cacti has been able to show the graph.

any chance to debug what happens over https ? As i said both site works under https , only cacti can't show image when only https is enable in apache2.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Installation nmidSmokeping PLUGIN

Post by phalek »

please try the attached code.
Attachments
nmidSmokeping_v1.11.zip
(7.14 KiB) Downloaded 415 times
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
adigigi
Posts: 9
Joined: Tue Nov 06, 2012 4:23 am

Re: Installation nmidSmokeping PLUGIN

Post by adigigi »

phalek wrote:please try the attached code.
IT IS WORKING under https and http (also with http off under apache): "nmidSmokeping_v1.11"
THANK YOU !!!!


P.S.
Some improvements and wil be complete:
- When add new devices to smokeping from cacti Devices On click link " Add to Smokeping (https://site) behind this automatically execute the following:
1. rm /tmp/smokeping_nmid_spserver1_config.txt
2. generate a new smokeping_nmid_spserver1_config.txt only with selected tree devices - THIS IS DOING NOW
-------THIS I DO MANUALY FROM SHELL-------------
3. cat /tmp/smokeping_nmid_spserver1_config.txt >> /etc/smokeping/config.d/Targets
4. /etc/init.d/smokeping restart

i think that at point 3 , before execute cat it is important to check if Targets already have this host
THIS HAPPEND TO ME AND at point 4 i was getting:
Shutting down latency logger daemon: smokeping.
Starting latency logger daemon: smokepingERROR: /etc/smokeping/config.d/Targets, line 37: section or variable already exists
AND I HAD TO MANUALY EDIT Targets and delete all things and do a cat /tmp/smokeping_nmid_spserver1_config.txt >> /etc/smokeping/config.d/Targets AGAIN.
This happens because "smokeping_nmid_spserver1_config.txt " and "Targets" aren't sync.

Also when remove a device form cacti this change to reflect in smokeping with serach and remove from Targets also

To bypass all from above i think that will be a good idea to remove this generetaed file in /tmp/smokeping_nmid_spserver1_config.txt and work directly with Targets from smokeping config
if Targets file differ from distro to disto (Debian Redhat suse etc) can be added in Cacti > Settings > nmidSmokeping a field path to it
but the checks/syncs when click ADD to and REMOVE still must be done.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Installation nmidSmokeping PLUGIN

Post by phalek »

I'm not quite sure, but the following command should work, as that txt file contains all devices currently configured:

Code: Select all

 cat /tmp/smokeping_nmid_spserver1_config.txt > /etc/smokeping/config.d/Targets
So it's overwriting the Targets every time, which results in removed devices being deleted and newly added ones being add to this Targets file
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
pad19
Posts: 5
Joined: Fri Feb 01, 2013 3:33 pm

Re: Installation nmidSmokeping PLUGIN

Post by pad19 »

Hello,
cacti and smokeping works perfectly. But nmidSmokeping plugin doesn't work. It shows some warnings and tries to read image from /cache/SZKIELET/szkielet-orc-pkin_mini.png, but image is actually on smokeping/cache/SZKIELET/szkielet-orc-pkin_mini.png

CentOS 6.3 - Cacti 0.8.8a - Smokeping 2.6 - nmidSmokeping plugin 1.11

Code: Select all

<h3>Main Server</h3>http://95.254.174.8/
<hr>
<h3>SP URL</h3>http://95.254.174.8/smokeping/smokeping.fcgi
<hr>
<h3>Response Str</h3><?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>404 - Not Found</title>
 </head>
 <body>
  <h1>404 - Not Found</h1>
 </body>
</html>

<hr>
<h3>File Part</h3>SZKIELET/szkielet-orc-pkin_mini.png<hr>
Warning: preg_match(): Unknown modifier 'z' in /var/www/html/cacti/plugins/nmidSmokeping/getSmokePingImage.php on line 90

Warning: preg_match(): Unknown modifier 'z' in /var/www/html/cacti/plugins/nmidSmokeping/getSmokePingImage.php on line 92
<h3>Image URL</h3>http://95.254.174.8/cache/SZKIELET/szkielet-orc-pkin_mini.png<hr><h3>Output</h3><?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>404 - Not Found</title>
 </head>
 <body>
  <h1>404 - Not Found</h1>
 </body>
</html>
<hr>
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/cacti/plugins/nmidSmokeping/getSmokePingImage.php:67) in /var/www/html/cacti/plugins/nmidSmokeping/getSmokePingImage.php on line 115
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>404 - Not Found</title>
 </head>
 <body>
  <h1>404 - Not Found</h1>
 </body>
</html>

User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Installation nmidSmokeping PLUGIN

Post by phalek »

Hi,

Can you check if the other URLS are acutally working correctly ?

The first "Response Str" sais that it was unable to find/connect to your SP URL "http://95.254.174.8/smokeping/smokeping.fcgi"
Is that the correct URL ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
barryward
Posts: 3
Joined: Mon Feb 11, 2013 12:58 pm

Re: Installation nmidSmokeping PLUGIN

Post by barryward »

Platform Ubuntu 12.10 Cacti 0.8.8a installed from apt, smokeping 2.6.8 installed from apt. nmidsmokeping 1.11 from this thread.
Problem: when creating device and adding to nmidsmokeping the following error is logged in apache error log..
[Mon Feb 11 17:04:14 2013] [error] [client 192.168.5.118] PHP Warning: fopen(smokeping_nmid_spserver1_config.txt): failed to open stream: Permission denied in /usr/local/share/cacti/plugins/nmidSmokeping/setup.php on line 214, referer: http://192.168.10.126/cacti/host.php
this was fixed temporarily by changing line 211
from: $ourFileName = read_config_option("nmid_spdir")."smokeping_nmid_spserver1_config.txt";
to: $ourFileName = read_config_option("nmid_spdir")."/tmp/smokeping_nmid_spserver1_config.txt";
this allows the script to run however issue appears to be there is no information stored for config option "nmid_spdir", where is this variable normally set?

Regards

Barry
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Installation nmidSmokeping PLUGIN

Post by phalek »

That setting can be configured at:

Code: Select all

Cacti -> Console -> Settings -> NMID
But as I just realized, the code for this setting is currently commented out. Please change the following lines in setup.php (lines 383-388) from:

Code: Select all

//		"nmid_spdir" => array(
//		    "friendly_name" => "Smokeping Config Creation Dir",
//		    "description" => "This is the local directory to store the smokeping target config to .  (ex: /tmp/).",
//		    "method" => "textbox",
//		    "max_length" => 255,
//		),

to

Code: Select all

		"nmid_spdir" => array(
		    "friendly_name" => "Smokeping Config Creation Dir",
		    "description" => "This is the local directory to store the smokeping target config to .  (ex: /tmp/).",
		    "method" => "textbox",
		    "max_length" => 255,
		),
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
barryward
Posts: 3
Joined: Mon Feb 11, 2013 12:58 pm

Re: Installation nmidSmokeping PLUGIN

Post by barryward »

I'll will change this and report back, also on some of the previous screen shots I've sheen there was a smokeping tab on the home page has that now been superseded or is there somewhere that I need to activate it.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Installation nmidSmokeping PLUGIN

Post by phalek »

yes, that's gone now. the nmidsmokeping plugin is standalone now and does not need the NMID base plugin (where that tab came from)
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
barryward
Posts: 3
Joined: Mon Feb 11, 2013 12:58 pm

Re: Installation nmidSmokeping PLUGIN

Post by barryward »

Excellent, and my final question for the night, does the PHP script restart the smokeping service or does that need to be done manually.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Installation nmidSmokeping PLUGIN

Post by phalek »

It's a manual process. Also, that smokeping config txt file only contains the "target" section, so it's not a working complete smokeping config.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
pad19
Posts: 5
Joined: Fri Feb 01, 2013 3:33 pm

Re: Installation nmidSmokeping PLUGIN

Post by pad19 »

phalek wrote:Hi,

Can you check if the other URLS are acutally working correctly ?

The first "Response Str" sais that it was unable to find/connect to your SP URL "http://95.254.174.8/smokeping/smokeping.fcgi"
Is that the correct URL ?
Yes, http://95.254.174.8/smokeping/smokeping.fcgi working correctly. Smokeping draws images, everything look good. I have only problem with this plugin
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests