Display ping status on weathermap

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

Post Reply
Author
Message
JeffCBM
Posts: 9
Joined: Mon Oct 27, 2014 4:04 pm

Display ping status on weathermap

#1 Post by JeffCBM » Tue Jul 24, 2018 3:59 pm

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,

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Display ping status on weathermap

#2 Post by Howie » Tue Jul 24, 2018 4:51 pm

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.
Weathermap 0.98 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!)

JeffCBM
Posts: 9
Joined: Mon Oct 27, 2014 4:04 pm

Re: Display ping status on weathermap

#3 Post by JeffCBM » Wed Jul 25, 2018 9:55 am

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:

Image

Here's timing out TCP Ping:

Image

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}
  

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Display ping status on weathermap

#4 Post by Howie » Wed Jul 25, 2018 1:03 pm

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.
Weathermap 0.98 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!)

JeffCBM
Posts: 9
Joined: Mon Oct 27, 2014 4:04 pm

Re: Display ping status on weathermap

#5 Post by JeffCBM » Wed Jul 25, 2018 3:51 pm

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)

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 \
There's no error on the weathermap poller, on cacti's side I have:

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
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

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Display ping status on weathermap

#6 Post by Howie » Wed Jul 25, 2018 4:37 pm

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:

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.98 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!)

JeffCBM
Posts: 9
Joined: Mon Oct 27, 2014 4:04 pm

Re: Display ping status on weathermap

#7 Post by JeffCBM » Wed Jul 25, 2018 4:45 pm

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.

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Display ping status on weathermap

#8 Post by Howie » Wed Jul 25, 2018 5:10 pm

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.98 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!)

Post Reply