EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6g
Moderators: Developers, Moderators
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
You need to enable the socket extension in php.ini.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
I get this error when trying to import the template.
Error: XML: Cacti version does not exist.
I've verified that I'm running the current version
mysql> select * from version\G
*************************** 1. row ***************************
cacti: 0.8.6g
1 row in set (0.00 sec)
How do I solve this?
Error: XML: Cacti version does not exist.
I've verified that I'm running the current version
mysql> select * from version\G
*************************** 1. row ***************************
cacti: 0.8.6g
1 row in set (0.00 sec)
How do I solve this?
[size=84][color=red] Electronic Frontier Foundation[/color]
[url]http://eff.org[/url][/size]
[url]http://eff.org[/url][/size]
I have the same issue, running by hand seems to work, results are properly returned, but the script is not able to generate anything other than loss:100.00TheWitness wrote:If you are running UNIX, the script_server has to have rights to create a RAW socket (aka root or asroot). Otherwise use something like "TCP 80" or something similar. Windows does not care.
TheWitness
[root@cacti log]# php /data/www/cacti/scripts/ss_fping.php lab1-ewr2 20 ICMP
min:1.3700 avg:1.4370 max:1.5400 dev:0.0524 loss:0.0000
or
[root@cacti log]# php /data/www/cacti/script_server.php
PHP Script Server has Started - Parent is cmd
/data/www/cacti/scripts/ss_fping.php ss_fping lab1-ewr2 20 ICMP
min:1.3300 avg:1.4637 max:2.3200 dev:0.2102 loss:5.0000
quit
PHP Script Server Shutdown request received, exiting
So how do you give the server_script the needed rights ?
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
What does your poller_cache look like for those items? Have you logged in as the poller account and tried this?
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
I saw your other post on making the poller run as "root" to be one of theTheWitness wrote:What does your poller_cache look like for those items? Have you logged in as the poller account and tried this?
TheWitness
options here to allow the sockets to be created by the process and once
I did that it started working
Thanks.
-
- Posts: 18
- Joined: Sun May 15, 2005 6:12 pm
Advanced Ping - PHP socket support
How do I enable socket support without recompiling php? Is that possible? I am trying to get the Advanced Pink v1.3 working and have seen that enabling the socket support needs to be done. I am running Fedora Core 4 and Cacti 0.86g.
Thanks in advance!
Thanks in advance!
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
This is from my /etc/php.ini
Reinhard
Code: Select all
; Default timeout for socket based streams (seconds)
default_socket_timeout = 60
; Default socket name for local MySQL connects. If empty, uses the built-in
mysql.default_socket =
[Sockets]
sockets.use_system_read = On
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
I would think it would be something like:
extension=php_socket.so
TheWitness
btb: I only run in Windows right now.
extension=php_socket.so
TheWitness
btb: I only run in Windows right now.
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Hello,
I have made some additional speedups as well as support for IPv6 in ping.php. Please keep in mind that you must have PHP 5.x or better.
Also, please note, that I have moved to the dark side (Linux) as of yesterday and saw some nasty things relative to DNS caching. Therefore, I made some additional changes to speed that stuff up.
I think you will like these enhancements.
Regards,
TheWitness
I have made some additional speedups as well as support for IPv6 in ping.php. Please keep in mind that you must have PHP 5.x or better.
Also, please note, that I have moved to the dark side (Linux) as of yesterday and saw some nasty things relative to DNS caching. Therefore, I made some additional changes to speed that stuff up.
I think you will like these enhancements.
Regards,
TheWitness
- Attachments
-
- ping.zip
- (3.18 KiB) Downloaded 2408 times
-
- ss_fping.zip
- (1.11 KiB) Downloaded 1921 times
Last edited by TheWitness on Tue Nov 15, 2005 7:07 am, edited 3 times in total.
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
is it a bug in ping.php
function ping($avail_method = AVAIL_SNMP_AND_PING, $ping_type = ICMP_PING, $timeout=500, $retries=3)
$ping_type = ICMP_PING
should be $ping_type = PING_ICMP
$ping_type = ICMP_PING
should be $ping_type = PING_ICMP
TheWitness wrote:Hello,
I have made some additional speedups as well as support for IPv6 in ping.php. Please keep in mind that you must have PHP 5.x or better.
Also, please note, that I have moved to the dark side (Linux) as of yesterday and saw some nasty things relative to DNS caching. Therefore, I made some additional changes to speed that stuff up.
I think you will like these enhancements.
Regards,
TheWitness
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Get the following error when I try to import your template:
Notice: Only variable references should be returned by reference in /usr/share/cacti/lib/import.php on line 44
Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/lib/import.php:44) in /usr/share/cacti/templates_import.php on line 67
Ideas?
Notice: Only variable references should be returned by reference in /usr/share/cacti/lib/import.php on line 44
Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/lib/import.php:44) in /usr/share/cacti/templates_import.php on line 67
Ideas?
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
What version of php are you running? (4.4 or 5.0.5) What version of Cacti are you running. Best to upgrade to 0.8.6g and apply the patches.
Larry
Larry
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
-
- Posts: 1
- Joined: Tue Nov 15, 2005 9:57 pm
TheWitness wrote:If you are running UNIX, the script_server has to have rights to create a RAW socket (aka root or asroot). Otherwise use something like "TCP 80" or something similar. Windows does not care.
TheWitness
I noticed that a lot of people have had this 'Operation not permitted' problem using ICMP pings on Linux - I've had the same problem, and despite a lot of research, couldn't find any suggestions on how to fix it.
The issue, in my case, is that the gateway I wish to ping, to monitor our internet link, only responds to ICMP pings - there are no TCP/UDP ports open for me to use, so that rules out using those protocols as a work-around. I need ICMP, therefore, cacti needs elevated priveleges somehow.
I don't want to run cacti in it's entirety as root, so in the absence of any other ideas, or knowledge of the cacti script mechanism, or PHP, I hacked up a little modification to the ss_fping.php script, using sudo to give it elevated privileges
It's ugly, but it works - in case anyone else might find this handy, here's the summary of the changes I made: (Cacti 0.8.6g, up-to-date Fedora Core 4 install)
1.) Install sudo if you haven't got it already, and add the following lines to /etc/sudoers: (you may need to change 'cacti' to whatever user is running the poller)
# Allow cacti user to run ping script with elevated privileges (so it can send ICMP pings)
cacti ALL=NOPASSWD: /usr/bin/php /var/www/cacti/scripts/ss_fping_exec.php [0-9a-zA-Z]*
2.) Rename ss_fping.php to ss_fping_exec.php
3.) Create a new ss_fping.php with the following code snippet (ripped from ss_fping.php) - change the ''/var/www/cacti/" reference to match the path to your cacti installation.
<?php
#!/usr/bin/php -q
//STANDARD SCRIPT SERVER HEADER!!!
$no_http_headers = true;
/* display No errors */
error_reporting(E_ERROR);
if (!isset($called_by_script_server)) {
array_shift($_SERVER["argv"]);
print call_user_func_array("ss_fping", $_SERVER["argv"]);
}
//End header.
function ss_fping($hostname, $ping_sweeps=6, $ping_type="ICMP", $port=80) {
return exec('sudo /usr/bin/php /var/www/cacti/scripts/ss_fping_exec.php '.$hostname.' '.$ping_sweeps.' '.$ping_type.' '.$port);
}
?>
4.) That's it! (I think The ss_fping.php wrapper script should now invoke the real ss_fping script using sudo, without requiring a password, allowing ICMP pings to be sent without running anything else as root.
This isn't ideal, from a security point of view (I haven't looked over the ss_fping script to see if the root privileges could be exploited somehow by passing bogus parameter values), but it works, so I'm happy enough
If anyone wants to make any suggestions, or point out some horrid mistake I've made, please do so!
Who is online
Users browsing this forum: No registered users and 1 guest