See Example of Installing PingER
If you have installed PingER2 then try:
Otherwise see here. There is an example of a complete pinger.xml configuration file which may help you to understand the documentation. The file at the monitoring site is usually kept in /afs/slac/package/pinger/pinger2/share/pinger/pinger.xml
PingER does not support non Linux OS's for the PingER monitoring host. We have never supported Windows for this application. We used to try and support various flavors of Unix but the difference in specifying the ping comand and parsing the results was just a nightmare, made the code unreasonably complex, we have no suitable hosts with the right OS installed to implement and test PingER on, and almost everybody used Linux everywhere, so we gave up and support Linux only with pinger2.
If you are determined to modify pinger2 to work with non Linux OS's the following may help (from perldoc pinger2.pl)The ping command is defined in the xml configuration file: <PingV4Cmd> PingER2 uses this command to ping individual host using IPV4 protocol. PingER2 will try to determine this command during the installation. Make sure that the user the script is run under has all the rights to execute the PingCmd, which might not be the case if you are running a security restricted *nix distri- bution. This means that either you have to have suid-bits set on the command or run the script using root rights of which the latter is strongly discouraged. The following identifiers should be present in the command: * %deadline Should be placed where the timeout parameter is placed * %count Will be replaced with the number of pings to send * %interval The script fills in the interval between individ- ual pings * %packetsize The size of individual packets will be entered here by the script * %destination The destination IP, without it there is no ping. Examples: <PingV4Cmd>/bin/ping -n -w %deadline -c %count -i %interval -s %packetsize %destination</PingV4Cmd> or <PingV4Cmd>/sbin/ping -c %count -s %packetsize %destination</PingV4Cmd>Typically %count is 10, %packetsize is 100 or 1000, %interval is one second, the %deadline is %count+20 seconds. You may need to look at the Linux man page for ping to see exactly how it works, the defaults, or how to translate this to the ping command available on your OS.
However you are not done yet since you will probably need to change the pinger2 code to properly parse the ping output.
An example of Linux output is seen below (however there are lots of edge/error cases):15cottrell@pinger:~>ping -n -w 20 -c 10 -i 1 -s 100 www.slac.stanford.edu PING www8.slac.stanford.edu (220.127.116.11) 100(128) bytes of data. 108 bytes from 18.104.22.168: icmp_seq=0 ttl=251 time=0.591 ms 108 bytes from 22.214.171.124: icmp_seq=1 ttl=251 time=0.315 ms 108 bytes from 126.96.36.199: icmp_seq=2 ttl=251 time=0.752 ms 108 bytes from 188.8.131.52: icmp_seq=3 ttl=251 time=0.686 ms 108 bytes from 184.108.40.206: icmp_seq=4 ttl=251 time=0.619 ms 108 bytes from 220.127.116.11: icmp_seq=5 ttl=251 time=0.551 ms 108 bytes from 18.104.22.168: icmp_seq=6 ttl=251 time=0.484 ms 108 bytes from 22.214.171.124: icmp_seq=7 ttl=251 time=0.417 ms 108 bytes from 126.96.36.199: icmp_seq=8 ttl=251 time=0.354 ms 108 bytes from 188.8.131.52: icmp_seq=9 ttl=251 time=0.782 ms --- www8.slac.stanford.edu ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9005ms rtt min/avg/max/mdev = 0.315/0.555/0.782/0.153 ms, pipe 2
See the documentation on pinger2.pl. Basically you have to edit the pinger.xml file (normally to be found in /usr/local/share/pinger/pinger.xml) to add the extra hosts in the field:
<HostList> This field holds any number of <Host>-entries which will get called by PingER2. In contrast to <BeaconList> these entries are not overridden by the refresh as defined in <BeaconListConfig>. That means that all custom hosts that are to be monitored in addition to the BeaconList should go into this list.Example: <HostList> <Host> <Name>www.cc.gatech.edu</Name> </Host> <Host> <Name>www.foo.bar</Name> <IP>192.168.1.1</IP> </Host> </HostList>These entries will be preserved in this file until you re-edit them
There are three possible explanations:
- pinger.xml is malformed: To ensure that the file pinger.xml is not malformed, excute the command xmllint /usr/local/share/pinger/pinger.xml. Any errors if existing will be highlighted. For example if the closing tag </Host> under <HostList> is missing a forward slash ‘/’ the output of xmllint /usr/local/share/pinger/pinger.xml would be as follows:<HostList> ^ pinger.xml:631: parser error : Opening and ending tag mismatch: Host line 577
- Incorrect domain names (or IP addresses):There is a possibility that the domain names (and/or IP addresses) added under the <HostList> tag have a typing mistake or the entries do not exist all together. In this case sift through the files pingerCronStat.stdout and pingerCronStat.stderr to look for relevant notifications.
- Miscellaneous errors: Alternatively, if the configuration file pinger.xml is well formed, you may need to debug the code to determine why and where the errors (if any) are occuring. To do so, enter the command perl -d /usr/local/share/pinger/pinger2.pl > /usr/local/share/pinger/pingerCronStat.stdout 2> /usr/local/share/pinger/pingerCronStat.stderr. To obtain help on the commands for the debugger, enter h.
See the documentation on pinger2.pl. Basically you have to add the remote host name in the <HostList>Example: <HostList> <Host> <Name>www.foo.bar</Name> <IP>192.168.1.1</IP> </Host> </HostList>A missing host name will result in the host name being identified as N/A. N.b. the host name has to be the same as the name the host is accessed via DNS.
The remote host name is entered as the IP address of the remote host.
If the hostname is not set, you can add it with (as root):
# hostname juarez-med.core.cudi.edu.mx
or with some flavors of Linux, you must declare separate hostname and domainname:
# hostname juarez-med
# domainname core.cudi.edu.mx
You should review the /etc/hosts and /etc/resolv.conf files to see that they are correct. For example the /etc/resolv.conf file should not say domain local but the correct domain name e.g. domain vsnl.in
Once the name is set, you can reinstall pinger2. Or you can edit pinger.xml and type it in within the SrcName, e.g.
If the monitor hostname is incorrect then edit the correct value in the SrcName. Note that the host name must be the same as the DNS name the host is accessed by.
To test whether the name is correct in the recorded data use http://<web_hostname>cgi-bin/ping_data.pl to get the most recent data. For example at one site the hostname should have been sfsmds2.vsnl.net but the data appeared as:sfsmds2.local 184.108.40.206 rainbow.inp.nsk.su 220.127.116.11 1000 1177327669 11 10 246.197 246.939...
The most complete way is to access the data via the ping_data.pl CGI script. E.g. access http://host.network.tld/cgi-bin/ping_data.pl, enter the date and time and press Get Data! Also you can look at the raw data that is saved locally in /usr/local/share/pinger/data/. Look at the date on pingerCronStat.stdout, it should be updated each 30 mins. Look at the contents of pingerCronStat.stdout to see what is happening.
This probably means there is no PingER data measured and cached at the site for the requested time frame. This may mean the pinger2.pl measurement task is not running. Check the crontab (see below).
Make sure there is an entry in the crontab for pinger2.pl. It should look like:crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.11495 installed on Sun Jan 2 23:58:43 2011) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) MAILTOemail@example.com #00,30 * * * * /home/pingman/share/pinger/pinger2.pl > /home/pingman/share/pinger/pingerCronStat.stdout 2> /home/pingman/share/pinger/pingerCronStat.stderr 00,30 * * * * /usr/local/share/pinger/pinger2.pl > /usr/local/share/pinger/pingerCronStat.stdout 2> /usr/local/share/pinger/pingerCronStat.stderrIf this exists then make sure cronjob runs, by re-running make install_cron. Also you may need to start ntpd. We have also seen cases where make install.cron fails and there is no cronjob (i.e. crontab -l does not show the pinger2.pl in the cron table. In this case it is probably necessary to edit your own crontab using the crontab -e command from root.
Refer to the answer here for a solution to edit the crontab manually.
Apache is configured by placing directives in plain text configuration files. The main configuration file is usually called httpd.conf. The location of this file is set at compile-time, but may be overridden with the -f command line flag.
Apache has a file httpd.conf. Doing a Google search on Apache configuration cgi-bin I get http://httpd.apache.org/docs/2.0/howto/cgi.html that says
In order to get your CGI programs to work properly, you'll need to have Apache configured to permit CGI execution. There are several ways to do this.
The ScriptAlias directive tells Apache that a particular directory is set aside for CGI programs. Apache will assume that every file in this directory is a CGI program, and will attempt to execute it, when that particular resource is requested by a client. The ScriptAlias directive looks like:
ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/
The example shown is from your default httpd.conf configuration file, if you installed Apache in the default location. The ScriptAlias directive is much like the Alias directive, which defines a URL prefix that is to mapped to a particular directory. Alias and ScriptAlias are usually used for directories that are outside of the DocumentRoot directory. The difference between Alias and ScriptAlias is that ScriptAlias has the added meaning that everything under that URL prefix will be considered a CGI program. So, the example above tells Apache that any request for a resource beginning with /cgi-bin/ should be served from the directory /usr/local/apache2/cgi-bin/, and should be treated as a CGI program.
For example, if the URL http://www.example.com/cgi-bin/test.pl is requested, Apache will attempt to execute the file /usr/local/apache2/cgi-bin/test.pl and return the output. Of course, the file will have to exist, and be executable, and return output in a particular way, or Apache will return an error message.
Another possibilty is that the permissions on ping_data.pl are incorrect. Apache may run as userid=nobody with very limited permissions. The permissions are typically of the form:
It is also a good idea to look in the web server's logs to see if it reports why the URL is not working.
One gets an error message of the form:
Can't open $$$$ DATADIR $$$$/ping-2010-02.txt: file or directory does not exist.
It is trying to open the file given in the pinger.xml directive
. In this case it appeared as:
<DataDirectory>$$$$ DATADIR $$$$</DataDirectory>
The default value for the <DataDirectory> directive is:
<DataDirectory>/usr/local/share/pinger/data</DataDirectory> Possibly the pinger.xml file (usually found at /usr/local/share/pinger/pinger.xml) has been corrupted. You will need to edit pinger.xml to correct the <DataDirectory> directive.
We have also seen corruption in the directive:
<AlarmCmd>echo '%message' | $$$$ MAIL $$$$ `whoami` -s "PingER2 Error Message"</AlarmCmd> The default value for this directive is:
<AlarmCmd>echo '%message' | /bin/mail `whoami` -s "PingER2 Error Message"</AlarmCmd> Again the pinger.xml file will need editing.
- This may result in ping_data.pl returning:#Warning ping_data.pl can't open /usr/local/pinger2/share/pinger/data/ping-2007-07.txt: No such file or directory or #No data between dates specified found in /usr/local/share/pinger/data/ping-2011-03.txtExamine the directory where pinger2 is installed with ls -l. The user running the pinger2.pl cron job should have read, write, and execute on the directory and the pinger2.pl script, and read and write permission on all the other files in the directory.
See the example directory listing
- Look at when pingerCronStat.stdout and .sterr were last updated. This will indicate if the cron job is still installed and working.
- Look at the contents of pingerCronStat.stdout and .stderr. These files contain the stdout and stderr streams from the most recent pinger run.
- pingerCronStat.stderr should be empty if the script ran successfully. Permissions errors, missing perl dependenices, and other error messages will be in this file.
- A successful pinger run will include output from each host pinged. alert() messages seen in the .stdout file are not uncommon -- they occur when a host is not resolvable, which is a common occurence. See example.
- The stdout file on a run where the beacon list is empty will end with the line pingAllHosts(): Starting to ping all hosts. rather than showing any detail for the individual hosts being pinged. See example.
- The beacon list is updated usually once a week, but occasionally that process fails. Look at when pinger.xml was last updated, this indicates when the beacon list was last refreshed.
- Look at the pinger.xml file and see if there are any entries in between the <BeaconList> tags. If it's empty, e.g.:<BeaconList> </BeaconList>See example for an example of an empty <BeaconsList> block. See this example of a populated <BeaconsList> block in pinger.xml.
- First make sure that the location for lynx given in pinger.xml is correct for your site. If this is incorrect it can lead to <BeaconsList> being empty.
- Then make sure the pinger.xml file contains <BeaconListURL>http://www-iepm.slac.stanford.edu/pinger/beacons.txt</BeaconListURL>, that it points to the right place and that the file there is not empty. If it is empty then contact firstname.lastname@example.org making sure you provide the full URL (i.e. http://www-iepm.slac.stanford.edu/pinger/beacons.txt).
- Assuming the beacons.txt file is not empty, then proceed using one of the following mechanisms (in order of increasing difficulty) to fill the <BeaconsList> block:
- Delete the <LastChecked> value from the <BeaconListConfig> block in the pinger.xml file. This will force the beacon list to update next time pinger2.pl runs. OR
- Download pinger.xml from http://www-iepm.slac.stanford.edu/pinger/pinger.xml to a temporary space. Copy the definitions in the <BeaconList></BeaconList> section and paste them in the local copy of pinger.xml's <BeaconList> section. OR
- Download a master pinger.xml from http://www-iepm.slac.stanford.edu/pinger/pinger.xml You will need to edit <SrcName>localhost.localdomain</SrcName> to the correct localhost and localdomain. Also inspect and edit as necessary the locations for /bin/mail, /bin/ping, /bin/ping6, /usr/bin/dig, and /usr/local/bin/lynx.
- Look at the contents of pinger.xml. You can verify that the XML syntax of pinger.xml is correct by using Verify XML Syntax. If the syntax is invalid or the contents appear garbled as shown below, pinger.xml needs to be rebuilt.<BeaconList> <Host> .... <Name> & lt; html & gt;</Name> </Host>Note that the name tag should have the domain name and not html code. To rebuild pinger.xml either of the methods below may be followed:
- Deleted the <LastChecked> in the <BeaconListConfig> block as described above. If things work as expected it should update pinger.xml next time pinger2.pl runs.
- If the pinger.xml file has 0 length, maybe you have run out of disk space.[root@pinger ~]# df /usr/local/share/pinger/ Filesystem Size Used Avail Use% Mounted on /dev/sda1 5.8G 5.5G 0 100% /In this case delete some old files from the data/ directory (the files are gathered daily from pinger.slac.stanford.edu so they are not needed locally for very long):[root@pinger ~]# rm -v /usr/local/share/pinger/data/ping-2007*Then try copying a backup copy of pinger.xml and deleting the <LastChecked> in the <BeaconListConfig> block:[root@pinger ~]# ls -l /usr/local/share/pinger/ total 172 -rw-r--r-- 1 pinger pinger 16844 Sep 25 2006 beacons.txt drwxr-xr-x 2 pinger pinger 4096 Aug 18 03:02 data/ -rwxr-xr-x 1 pinger pinger 300 Sep 25 2006 dnsV4Cmd.pl* -rwxr-xr-x 1 pinger pinger 5385 Sep 25 2006 installCron.pl* -rw-r--r-- 1 pinger pinger 34443 Sep 25 2006 pinger2.html -rw-r--r-- 1 pinger pinger 46312 Sep 26 2007 pinger2.pl -rw-r--r-- 1 pinger pinger 21974 Oct 27 2006 pinger-back.xml -rw-rw-r-- 1 pinger pinger 0 Aug 18 03:00 pingerCronStat.stderr -rw-rw-r-- 1 pinger pinger 0 Aug 18 03:00 pingerCronStat.stdout -rw-r--r-- 1 pinger pinger 0 Aug 18 03:00 pinger.xml -rw-r--r-- 1 pinger pinger 21844 Sep 26 2007 pinger.xml~ -rw-r--r-- 1 pinger pinger 2512 Sep 25 2006 pinger.xsd [root@pinger ~]# cp /usr/local/share/pinger/pinger.xml~ /usr/local/share/pinger/pinger.xml cp: overwrite `/usr/local/share/pinger/pinger.xml'? yes [root@pinger ~]# vi /usr/local/share/pinger/pinger.xml [root@pinger ~]# ls -l /usr/local/share/pinger/ total 196 -rw-r--r-- 1 pinger pinger 16844 Sep 25 2006 beacons.txt drwxr-xr-x 2 pinger pinger 4096 Aug 18 03:02 data/ -rwxr-xr-x 1 pinger pinger 300 Sep 25 2006 dnsV4Cmd.pl* -rwxr-xr-x 1 pinger pinger 5385 Sep 25 2006 installCron.pl* -rw-r--r-- 1 pinger pinger 34443 Sep 25 2006 pinger2.html -rw-r--r-- 1 pinger pinger 46312 Sep 26 2007 pinger2.pl -rw-r--r-- 1 pinger pinger 21974 Oct 27 2006 pinger-back.xml -rw-rw-r-- 1 pinger pinger 0 Aug 18 03:00 pingerCronStat.stderr -rw-rw-r-- 1 pinger pinger 0 Aug 18 03:00 pingerCronStat.stdout -rw-r--r-- 1 pinger pinger 21802 Aug 18 03:04 pinger.xml -rw-r--r-- 1 pinger pinger 21844 Sep 26 2007 pinger.xml~ -rw-r--r-- 1 pinger pinger 2512 Sep 25 2006 pinger.xsd
- pinger2.pl can be run from the command line. To randomize when the pings are sent, a random delay is set in the pinger.xml file in the <waitInterval> entity. The impatient may wish to skip this delay when running interactively; set it to one before running pinger2.pl from the command line.
- There may also be a problem with cronjob (see below>.
In the newer version of ping_data.pl there's a tab on top called PingER2CronOutput. In case the cron is not running the output would be just the following two lines:
Starting Output of Standard Cron Out[/usr/local/share/pinger/pingerCronStat.stdout] --------------Output complete---------------------
Otherwise this output would contain several debug statements from PingER2's last execution.
Also note, you can look at any errors caused by PingER2 by using the tab PingER2CronErrors.
Typically in this case the webserver's form to request the data reponds correctly but no data is supplied in response to pushing the "Get Data!" button. One possibility is that the web server does not have permission to access the data. In that case the user will probably get a message of the form:
#Warning ping_data.pl can't open /usr/local/share/pinger/data/ping-2009-10.txt: Permission denied
This can also happen if a routing policy is enforced which blocks traffic from the node executing the data-collection process while allowing traffic from other nodes.
To confirm that this is the case, logon to the node executing the data collection process and manually execute the wget command. If it fails -- while permitting access from other nodes -- we can be sure that this is the case (We experienced this one in Aug 2009 with citehep130.ultralight.org).
Logon to host and see if can execute from the command line, for example:[root@slac slac]# /var/www/cgi-bin/ping_data.pl bash: /var/www/cgi-bin/ping_data.pl: /usr/local/bin/perl5: bad interpreter: No such file or directoryYou may also be able to look at the root file to find a similar message, e.g.[root@slac slac]# tail /var/log/httpd/error.log tail: cannot open `/var/log/httpd/error.log' for reading: No such file or directory [root@slac slac]# tail /var/log/httpd/error_log [Thu Mar 29 04:58:41 2007] [error] [client 18.104.22.168] Premature end of script headers: ping_data.pl [Thu Mar 29 10:10:00 2007] [error] [client 22.214.171.124] (2)No such file or directory: exec of '/var/www/cgi-bin/ping_data.pl' failed ...The above shows a failure, in that case from the command line try:[root@slac slac]# perl /var/www/cgi-bin/ping_data.pl "Status: 200 OK Content-type: text/html <HTML> <HEAD> ...If this works (as above) then modify the first line of ping_data.pl to point to the correct location for perl on this monitor host.
It is available under "ADDITIONAL SOFTWARE: Install ping_data.pl and traceroute.pl. Detail can be found at http://www-iepm.slac.stanford.edu/pinger/tools/install2.html"
Ping_data.pl only displays the beacon sites not those you added to the HostList tag (see above). This is a bug and will be fixed in future.
If it asks you if you want to download the file (MSIE), or pops up a window saying 'Opening ping_data.pl' (Firefox), then it is possible that your web server is not configured to recognize .pl files as executable. You may need to add
AddHandler cgi-script .pl
to your httpd.conf file (if you're running Apache),
There is a Timeout value in httpd.conf (saved in different places on different hosts, e.g. in /etc/httpd/httpd.conf). It should be set to 300.
Try wget to get more details, e.g. below it failed:4cottrell@pinger:~>wget 'http://fad.ucad.sn/cgi-bin/traceroute.pl' --11:58:13-- http://fad.ucad.sn/cgi-bin/traceroute.pl => `traceroute.pl' Resolving fad.ucad.sn... 126.96.36.199 Connecting to fad.ucad.sn|188.8.131.52|:80... connected. HTTP request sent, awaiting response... 500 Internal Server Error 11:58:13 ERROR 500: Internal Server Error. Exit 1Try logging onto the web server and executing traceroute.pl from the command line:##########################Testing ############################################## # For testing from command line you need to set some environment variables, e.g. # setenv QUERY_STRING www.cern.ch; setenv REMOTE_HOST ns1.slac.stanford.edu # setenv REMOTE_ADDR 184.108.40.206; setenv SERVER_NAME www.slac.stanford.edu # setenv REQUEST_URI /cgi-wrap/traceroute.pl # You will also need to include the -T option in the command line if you want to # use the perl -d debug facility, i.e. you need to use: # perl -d -T traceroute.plIf the above works then maybe the perl interpreter is not found in /usr/bin/perl, in which case change the first line in traceroute.pl to point to the perl interpreter.
Have a look at:
Also look at the error log from your web server from after you try to run traceroute.pl.
We managed to get it working. The problem was the SELinux security feature. We set it to disabled.
The "problem" is that SELinux is preventing what it considers to be violations of security. This is because the file contexts are incorrect. Execute the command below to address the issue. See this for further details.
chcon -t httpd_unconfined_script_exec_t traceroute.pl
The monitor is running an older version of pinger2.pl that does not record the individual RTTs the inter quartile range of the packets and inter packet delay variation (ipdv) cannot be calculated and so MOS (that is a function of ipdv as a measure of jitter) also is not calulable. The monitor needs to load a new version of pinger.pl.
For cgi-bin scripts such as ping_data.pl try /usr/local/apache2/cgi-bin, or /var/www/cgi-bin. One may be able to look in /etc/httpd to find the web server configuration file which may indicate the location for cgi-bin scripts.
Many files (e.g. pinger.xml) are to be found in /usr/local/share/pinger/
The recorded data files are found in /usr/local/share/pinger/data/
This error is due to the fact that lynx has not been installed by the user. The README clearly lists lynx as a pre-req to installing PingER2. The user can do any of the following steps to ensure smooth running of PingER2
- Request an updated copy of pinger.xml from slac and set the config values according to his local machine
- Install lynx and the other pre-reqs and then attempt to re-install pinger2
pinger.xml can be found under /usr/local/share/pinger/
The README file list all the requirements of the pinger software. Typically the Lynx browser and perl’s XML::Simple module are found to be missing.
See the XXL::Simple web page.
To install the perl module XML::Simple the following command should suffice:perl -MCPAN -e "Install XML::Simple"Alternatively, apt-get may be used:apt-get install libxml-simple-perl
Similarly, to install the lynx browser use apt-get or yum:apt-get install lynxAlternatively, you may download and install the lynx browser from here.
See Installing XML::SAXBack to top
Created February 8, 2007.
Comments to email@example.com