Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sun May 26, 2019 10:40 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 527 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 36  Next
Author Message
 Post subject:
PostPosted: Thu Nov 03, 2005 6:22 am 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14804
Location: MI, USA
You need to enable the socket extension in php.ini.

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 03, 2005 10:48 am 
Offline
Cacti User

Joined: Tue Sep 21, 2004 2:22 pm
Posts: 65
Location: Madison, WI
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?

_________________
Electronic Frontier Foundation
http://eff.org


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 03, 2005 2:38 pm 
Offline

Joined: Wed Apr 13, 2005 3:11 pm
Posts: 30
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 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.00

[[email protected] 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

[[email protected] 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 ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 5:25 am 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14804
Location: MI, USA
What does your poller_cache look like for those items? Have you logged in as the poller account and tried this?

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 9:41 am 
Offline

Joined: Wed Apr 13, 2005 3:11 pm
Posts: 30
TheWitness wrote:
What does your poller_cache look like for those items? Have you logged in as the poller account and tried this?

TheWitness


I saw your other post on making the poller run as "root" to be one of the
options here to allow the sockets to be created by the process and once
I did that it started working :-)

Thanks.


Top
 Profile  
 
 Post subject: Advanced Ping - PHP socket support
PostPosted: Fri Nov 04, 2005 12:20 pm 
Offline

Joined: Sun May 15, 2005 6:12 pm
Posts: 18
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!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 05, 2005 8:41 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
This is from my /etc/php.ini
Code:
; 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

Reinhard


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 05, 2005 10:05 am 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14804
Location: MI, USA
I would think it would be something like:

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 MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 5:53 pm 
Offline

Joined: Tue Oct 26, 2004 11:35 am
Posts: 11
How do I do this as I am having the Loss 100% issue from the script_server?

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 8:19 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14804
Location: MI, USA
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


Attachments:
ping.zip [3.18 KiB]
Downloaded 2142 times
ss_fping.zip [1.11 KiB]
Downloaded 1780 times

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.


Last edited by TheWitness on Tue Nov 15, 2005 7:07 am, edited 3 times in total.
Top
 Profile  
 
 Post subject: is it a bug in ping.php
PostPosted: Tue Nov 15, 2005 12:30 am 
Offline

Joined: Tue Aug 23, 2005 9:40 pm
Posts: 5
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



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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 6:57 am 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14804
Location: MI, USA
:oops:

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 9:50 am 
Offline

Joined: Tue Nov 15, 2005 9:33 am
Posts: 3
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?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 2:49 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14804
Location: MI, USA
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

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 10:36 pm 
Offline

Joined: Tue Nov 15, 2005 9:57 pm
Posts: 1
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 527 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 36  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group