Doubt on ping function

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Doubt on ping function

Post by Rno »

Hello,
I try to monitor some AP (WiFi Access Point) on my network, but even if I can ping it from the cli, Cacti is always telling me it's down!
If i do a debug I got:
2017-10-09 16:29:18 - SPINE: Poller[1] DEBUG: The Value of Active Threads is 0 for Device ID 1123
2017-10-09 16:29:18 - SPINE: Poller[1] Device[wa-se46-tst-1850] TH[1] DEBUG: HOST COMPLETE: About to Exit Device Polling Thread Function
2017-10-09 16:29:18 - SPINE: Poller[1] Device[wa-se46-tst-1850] TH[1] Total Time: 0.41 Seconds
2017-10-09 16:29:18 - SPINE: Poller[1] Device[wa-se46-tst-1850] DEBUG: UDP Timeout, Try Count:2, Time:402.0791 ms
2017-10-09 16:29:18 - SPINE: Poller[1] Device[wa-se46-tst-1850] DEBUG: UDP Timeout, Try Count:1, Time:400.8000 ms
2017-10-09 16:29:18 - SPINE: Poller[1] Device[wa-se46-tst-1850] DEBUG: Entering UDP Ping
2017-10-09 16:29:18 - SPINE: Poller[1] Device[wa-se46-tst-1850] DEBUG Falling back to UDP Ping Due to SetUID Issues
2017-10-09 16:29:18 - SPINE: Poller[1] DEBUG: In Poller, About to Start Polling of Device for Device ID 1123

On my setting for the Availability/Reachability Options I use only ping and ICMP type; why the log is showing me UDP
And on the top when I'm looking on the device is see:
Ping Results
ICMP Ping Success (1.878 ms)

And doing a tcpdump why do I have a udp/23 on it ?
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
dieselboy
Cacti User
Posts: 135
Joined: Wed May 27, 2009 5:10 pm

Re: Doubt on ping function

Post by dieselboy »

Just posted something similar, relating to selinux which I don't know how to resolve. Do you have selinux running at the moment? You dont say which system you have.
I'm trying to find a solution in this thread viewtopic.php?f=2&t=58055
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: Doubt on ping function

Post by Rno »

I'm not sure the problem is on linux, the trace show a udp ping that is not suppose to happen, and Cacti is using this udp ping to check the status of my device.
Even if the config is set with icmp ping. And when I look on the device, it show as 'ICMP Ping Success (0.787 ms)'
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
dieselboy
Cacti User
Posts: 135
Joined: Wed May 27, 2009 5:10 pm

Re: Doubt on ping function

Post by dieselboy »

I think you misunderstood me :)

If you run CLI command on the server: "sestatus" does it return "enforcing" ? IF true then I believe the reason your ping is not working is because the security on your server is not set up to permit cacti / web server to send a ping. To fix this, the selinux config needs to be adjusted to allow the web server to send a ping (create a socket). I am stuck here, I don't know how to proceed. I've tried to google to find best practice to allow this to be done. A lot of people say they have fixed this by turning off selinux but that's not good. It's the equivalent of removing your front door of your house, to let your relative stay for a visit = not secure.

As a temporary fix, you can run this command:

Code: Select all

setenforce permissive
This will turn off selinux temporarily. Selinux will be enabled again after a reboot OR, you can run "setenforce enforcing". But be CAREFUL, with selinux turned off I believe new files are not labelled with a selinux policy so doing this long-term might cause more problems and difficulties.

Still waiting for someone to reply to my post :cry: :cry:
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: Doubt on ping function

Post by Rno »

I do not have SELinux active:
SELinux status: disabled


And I know the icmp ping is working, but cacti is doing both icmp and udp
And I think this udp stuff is taken from the default device config under settings. because it's a ping on port 23 UDP.

But I will have to find some time to look on the code to trace why it doe's that.


So I just made test, change the ping method to be udp, change the port 69, put back the pint to icmp

Now the udp ping is doing it on port 69
Even with no port on the ping port neither on the device, nor on the default solve the issue; actually it does the icmp ping, then an udp on port 0
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
dieselboy
Cacti User
Posts: 135
Joined: Wed May 27, 2009 5:10 pm

Re: Doubt on ping function

Post by dieselboy »

Understood...
Your symptom doesn't happen for me. I am running cacti 1.1.24. Have you tried updating?
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: Doubt on ping function

Post by Rno »

I'm on 1.1.23, and I doubt the 24 to 26 solve the problem.

I will try to updated later this week, and look into the code
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Re: Doubt on ping function

Post by super-hornet »

Since u are using spine, you can set to use ICMP ping instead.
But you need to set the spine (should be in /usr/local/spine/bin/spine) to have +s executable.
Do this in root, use sudo:
chmod +s /usr/local/spine/bin/spine
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: Doubt on ping function

Post by Rno »

Yes that's was my problem, during a upgrade spine change his right setup, and I forgot to put it back.
now it's working as it should
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
dv8
Posts: 7
Joined: Sun Mar 17, 2019 6:15 pm

Re: Doubt on ping function

Post by dv8 »

super-hornet wrote:Since u are using spine, you can set to use ICMP ping instead.
But you need to set the spine (should be in /usr/local/spine/bin/spine) to have +s executable.
Do this in root, use sudo:
chmod +s /usr/local/spine/bin/spine
Thankyou for that- I was banging my head against a wall trying to figure out why I had 3 devices out of 7 that were marked as down and returning UDP ping failures!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests