Display ping status on weathermap
Moderators: Developers, Moderators
Display ping status on weathermap
Hello,
Could someone help me with a simple code to display the ping status (not latency) of an IP address ?
I would like to know if my servers, routers, NAS, etc are pinging or timing out. I'm going to use a scale with 2 icons, 1 red and 1 green.
can I query from the weathermap script directly or do I have to setup every units in cacti first?
Ideally if I could query from an external web server where my cacti setup is installed and ping to TCP/UDP through a forward in the router of the remote location.
Thanks,
Could someone help me with a simple code to display the ping status (not latency) of an IP address ?
I would like to know if my servers, routers, NAS, etc are pinging or timing out. I'm going to use a scale with 2 icons, 1 red and 1 green.
can I query from the weathermap script directly or do I have to setup every units in cacti first?
Ideally if I could query from an external web server where my cacti setup is installed and ping to TCP/UDP through a forward in the router of the remote location.
Thanks,
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Display ping status on weathermap
Do you mean ping (ICMP) or do you want TCP/UDP?
For actual ping, you can use the fping datasource built in to Weathermap (see the Targets page in the manual). You'll need to install fping.
If the devices are in Cacti, you can use Cacti's status too, using the cactihost: datasource (same page in the manual).
If you want to actually bounce packets off of TCP or UDP ports, you'd need something else. I think smokeping might do this for you, but that's quite a bit to get going.
For actual ping, you can use the fping datasource built in to Weathermap (see the Targets page in the manual). You'll need to install fping.
If the devices are in Cacti, you can use Cacti's status too, using the cactihost: datasource (same page in the manual).
If you want to actually bounce packets off of TCP or UDP ports, you'd need something else. I think smokeping might do this for you, but that's quite a bit to get going.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Re: Display ping status on weathermap
Hello Howie,
Thanks for the quick answer. I finally got Advanced Ping to work and it really looks like smokeping. Now I have my data in cacti, but I'm not sure how to paste the good info in the weathermap.
How should I use "TARGET" so that I have the most accurate average of the last minute ping result ?.. I'm not getting the proper output.. I tried: :loss:- and :-:loss
here's working TCP Ping:
Here's timing out TCP Ping:
My code
Thanks for the quick answer. I finally got Advanced Ping to work and it really looks like smokeping. Now I have my data in cacti, but I'm not sure how to paste the good info in the weathermap.
How should I use "TARGET" so that I have the most accurate average of the last minute ping result ?.. I'm not getting the proper output.. I tried: :loss:- and :-:loss
here's working TCP Ping:
Here's timing out TCP Ping:
My code
Code: Select all
SET nowarn_clipping 1
SET snmp_abort_count 4
HTMLSTYLE overlib
TITLE Ping Status
# The SNMP community
SET community cacti
#
# Scale that maps the SNMP state numbers to colours
#
FONTDEFINE 66 /usr/share/cacti/site/plugins/weathermap/VeraSe.ttf 8
SCALE PING 0 95 255 255 255 images/green.png
SCALE PING 96 100 255 255 255 images/red.png
NODE DC
USESCALE PING absolute
POSITION 164 361
TARGET gauge:/var/lib/cacti/rra/dion_-_dc_loss_733.rrd:loss:-
ICON {node:this:inscaletag}
NODE ESXI
USESCALE PING absolute
POSITION 358 361
TARGET gauge:/var/lib/cacti/rra/dion_-_esxi_host_-_ping_loss_736.rrd:loss:-
ICON {node:this:inscaletag}
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Display ping status on weathermap
Rule 0: What do the logs say?
In this case, if the DS name is wrong, the rrdtool datasource will tell you, and also tell you what the valid choices are.
In this case, if the DS name is wrong, the rrdtool datasource will tell you, and also tell you what the valid choices are.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Re: Display ping status on weathermap
Thanks for your patience Howie, I'm not a very good programmer and my linux skills are very low.
the Data Source says: (I use the DS:loss)
There's no error on the weathermap poller, on cacti's side I have:
is there a way to paste in weathermap the value of what is in the RRD?.. which info weathermap is reading?
I'd like to be able to get the average of the last minute in %.. so if in the last minute it's 100% loss, it shows red icon.png and under 95% green.png
the Data Source says: (I use the DS:loss)
Code: Select all
Data Source Debug
/usr/bin/rrdtool create \
/var/lib/cacti/rra/dion_-_dc_loss_733.rrd \
--step 60 \
DS:loss:GAUGE:120:0:100 \
DS:avg:GAUGE:120:0:500 \
DS:max:GAUGE:120:0:500 \
DS:dev:GAUGE:120:0:500 \
DS:min:GAUGE:120:0:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
Code: Select all
07/25/2018 05:14:10 PM - CMDPHP: Poller[0] Host[54] DS[736] SERVER: /usr/share/cacti/site/scripts/ss_fping.php ss_fping xx.xx.xx.xx 20 TCP 10080, output: min:9.3400 avg:9.6855 max:9.8700 dev:0.1345 loss:0.0000
I'd like to be able to get the average of the last minute in %.. so if in the last minute it's 100% loss, it shows red icon.png and under 95% green.png
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Display ping status on weathermap
If weathermap is running the map, and there is a problem reading data, it'll log a warning in the cacti.log
To see more information, you can enable DEBUG logging in Cacti (don't leave it on - it generates a lot of data), then wait for one poll (usually 5 minutes) and look at cacti.log
You should see lines starting with ReadDataFromRRD that will tell you what is being read, and what numbers are being used.
But your TARGET should look something like:
To see more information, you can enable DEBUG logging in Cacti (don't leave it on - it generates a lot of data), then wait for one poll (usually 5 minutes) and look at cacti.log
You should see lines starting with ReadDataFromRRD that will tell you what is being read, and what numbers are being used.
But your TARGET should look something like:
Code: Select all
# a scale for loss - 0=green, <30% yellow, >=30% red
SCALE updown 0 0 0 255 0
SCALE updown 0 30 255 255 0
SCALE updown 30 100 255 0 0
NODE xxx
TARGET /var/lib/cacti/rra/dion_-_dc_loss_733.rrd:loss:-
MAXVALUE 100
USESCALE updown in
# POSITION etc..
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Re: Display ping status on weathermap
Oh.. I think I got it !
let me run more tests .. but I should be fine.
I think that my issue was from the Down device detection in DEVICES.. I was setting it up with ping as well.. but when cacti can't reach the unit, it won't log the data in the RRD..
I set it to NONE, and the data source collection runs everytime.
thanks again.
let me run more tests .. but I should be fine.
I think that my issue was from the Down device detection in DEVICES.. I was setting it up with ping as well.. but when cacti can't reach the unit, it won't log the data in the RRD..
I set it to NONE, and the data source collection runs everytime.
thanks again.
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Display ping status on weathermap
Yeah, that is the benefit of using the weathermap fping datasource. But if you also want graphs, Cacti is the way to go.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Who is online
Users browsing this forum: No registered users and 0 guests