Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
Post general support questions here that do not specifically fall into the Linux or Windows categories.
Moderators: Developers , Moderators
MrGde
Posts: 1 Joined: Tue Jun 05, 2012 10:11 am
Post
by MrGde » Tue Jun 05, 2012 10:22 am
I've tried around two days with the Advanced Ping (ss_fping.php) but can't get it to work. When the script is called by Cacti it returns 100% Packetloss and U for min/max/avg - when I call it manually it works correctly:
Problem:
The logfile shows that Cacti is starting the fping correctly but then it only gets back unknown values:
Code: Select all
06/05/2012 05:15:01 PM - CMDPHP: Poller[0] Host[6] DS[71] CMD: /usr/local/bin/php /usr/local/share/cacti/scripts/ss_fping.php my.host.name 10 ICMP , output: min:U avg:U max:U dev:U loss:100.00
When I start the the script manually as user cacti it works:
Code: Select all
# su cacti
% php /usr/local/share/cacti/scripts/ss_fping.php my.host.name 10 ICMP
min:21.1200 avg:22.5696 max:24.2470 dev:0.9942 loss:0.0000%
My setup:
- FreeBSD 9
- Cacti 0.8.8a_1
- ss_fping.php that comes with the distribution
- Cronjob running as user "cacti"
I already tried to have ss_fping called as script server - having the same issue here.
Can anyone help?
David
Last edited by
MrGde on Tue Jun 26, 2012 1:04 am, edited 1 time in total.
okeozkilic
Posts: 9 Joined: Thu Mar 24, 2011 2:54 pm
Location: Ankara / Turkey
Post
by okeozkilic » Tue Jun 26, 2012 12:45 am
Same thing here,
I am willing to change/migrate our Ubuntu Cacti server to FreeBSD but I could not make ss_fping script work on FreeBSD.
By the way, realtime plugin graph works without any problem.
Cacti logs:
Code: Select all
06/25/2012 05:10:01 PM - SPINE: Poller[0] Host[4] TH[1] DS[26] SS[0] SERVER: /usr/local/www/cacti/scripts/ss_fping.php ss_fping 10.86.4.111 20 ICMP , output: min:U avg:U max:U dev:U loss:100.00
FreeBSD prompt:
Code: Select all
[root@Ghost /usr/local/www/cacti/scripts]# su -m cacti
[cacti@Ghost /usr/local/www/cacti/scripts]$ /usr/local/bin/php ss_fping.php localhost 10
min:0.1470 avg:0.1625 max:0.2200 dev:0.0213 loss:0.0000
[cacti@Ghost /usr/local/www/cacti/scripts]$
Code: Select all
[root@Ghost /usr/local/www/cacti/scripts]# su -m cacti
[cacti@Ghost /usr/local/www/cacti/scripts]$ /usr/local/bin/php /usr/local/www/cacti/script_server.php
PHP Script Server has Started - Parent is cmd
ss_fping.php ss_fping localhost 10
min:0.0770 avg:0.5757 max:2.5110 dev:0.9095 loss:0.0000
* FreeBSD 9.0
* Cacti 0.8.8a
Regards...
There are 10 kinds of people in the world. Those who understand binary, and those who don't...
okeozkilic
Posts: 9 Joined: Thu Mar 24, 2011 2:54 pm
Location: Ankara / Turkey
Post
by okeozkilic » Tue Jul 03, 2012 10:34 am
I could not solve this problem but instead wrote a shell script which does the same thing (more or less). I know that it may be optimized way further but currently the only important thing is that it works on my FreeBSD server.
Code: Select all
#!/usr/local/bin/bash
out=`/sbin/ping -c 10 -q -t 2 $1`
loss=`echo "$out"|awk -F', ' '/loss$/ {print $3}'`
loss=${loss%\%*}
if [[ "$loss" != "100.0" ]]; then
echo -n "$out"|awk '/^round/ {printf $4}'|awk -F'/' '{printf "min:"$1 " avg:"$2 " max:"$3 " dev:"$4}'
echo -n " loss:$loss"
else
echo -n "min:U avg:U max:U dev:U loss:100.0"
fi
* I created a file named FreeBSD_Ping.sh under cacti scripts folder
* made the script file executable (chmod +x FreeBSD_Ping.sh)
* changed PING - Advanced Ping v1.3, Input Type to "Script/Command"
* finally changed PING - Advanced Ping v1.3, Input String (from Data Input Methods) as:
Code: Select all
<path_cacti>/scripts/FreeBSD_Ping.sh <hostname> <attempts> <protocol> <port>
I know this whole method is also far from acceptable (did I say I was lazy) but as I stated above it does the job...
There are 10 kinds of people in the world. Those who understand binary, and those who don't...
okeozkilic
Posts: 9 Joined: Thu Mar 24, 2011 2:54 pm
Location: Ankara / Turkey
Post
by okeozkilic » Tue Jul 03, 2012 11:14 am
By the way, if anyone is curious why I replaced my Cacti Ubuntu Server with FreeBSD one I would like to share some statistics:
Ubuntu Server
* 1 GB RAM
* 10 GB Disk space
* 2 CPUs
SYSTEM STATS: Time:85.2523 Method:spine Processes:2 Threads:16 Hosts:151 HostsPerProcess:76 DataSources:17831
FreeBSD Server
* 512 MB RAM
* 12 GB Disk space
* 2 CPUs
SYSTEM STATS: Time:35.5644 Method:spine Processes:2 Threads:8 Hosts:149 HostsPerProcess:75 DataSources:17053
Both servers are VMs on the same physical machine. Both Cacti have the same plugins (no Boost plugin) and polling from the same machines.
Before Ubuntu server, I had installed Cacti on a Windows server (about double the resources) and you really do not want to know the polling times.
There are 10 kinds of people in the world. Those who understand binary, and those who don't...
hhhtron
Posts: 2 Joined: Fri Dec 28, 2007 1:48 am
Post
by hhhtron » Sun Aug 12, 2012 9:12 am
Same thing......
FreeBSD 9.0, Cacti 0.8.8a, PHP 5.4.5
I guess it is PHP related issue ?
Users browsing this forum: No registered users and 3 guests