check_ping with different packet size

Having issues? Post them here, and help other users.
Post Reply
SteveCourt
Junior Member
Posts: 3
Joined: Mon Dec 07, 2020 7:22 am

check_ping with different packet size

Post by SteveCourt »

Hello all, this is my first post in the support forum.

I've only just recently installed v1.5.2-RPi-Build1 on a Pi Model 3B+ and things were going reasonably smoothly. I was happily adding hosts and verifying that NEMS was able to detect if they were online, until I tried adding a host entry for my EtherRain devices - refer to http://www.quicksmart.com/qs_etherrain.html

NEMS kept reporting that the device was offline even though I could ping it from my windows 10 laptop. I tried manually pinging the device from the NEMS terminal and it failed as well.
I noticed that the windows ping was only 32bytes, but the default ping from the NEMS terminal was 64bytes. Just for giggles I found that if I manually set the packet size to be 32 bytes, it worked.

Code: Select all

ping 192.168.1.112 -> failed
ping -s 32 192.168.1.112 -> worked
ping -s 33 192.168.1.112 -> failed
Now for my actual question... can someone help me work out how to force the relevant check command (eg. check-host-alive or check_ping) to specify the length to be 32bytes ?
SteveCourt
Junior Member
Posts: 3
Joined: Mon Dec 07, 2020 7:22 am

Re: check_ping with different packet size

Post by SteveCourt »

Ok, so I managed to find a solution... use check_fping (instead of check_ping) so that I could set the packet size using the '-b' option.

Here's what I ended up doing:
  • Created a new 'MiscCommand' called 'check-host-alive-fping' and set the command line to be '$USER1$/check_fping -H $HOSTADDRESS$ -b 32'
  • Created a new 'Host Template' called 'etherRain_template' using the same settings as the generic_switch template except for the 'check command' was set to 'check-host-alive-fping' instead of the regular 'check-host-alive'.
  • Created a new 'Host Preset' called 'etherRain_preset' and set the 'host-alive check' to use 'check-host-alive-fping' instead of the regular 'check-host-alive'
  • Changed each of my hosts to use the following:
    • host preset = etherRain_preset
    • host template = etherRain_template
After reloading the config (and deploying), I was pleased to see that my etherRain devices were being detected correctly and I was no longer being spammed with errors.
StrackeJ
Junior Member
Posts: 12
Joined: Thu Mar 12, 2020 5:45 am

Re: check_ping with different packet size

Post by StrackeJ »

Hi Steve,
thanks for your hint.
It works perfectly!
;-)
Post Reply