Strange problem on Ping from cacti (not from spine or CLI)

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

Strange problem on Ping from cacti (not from spine or CLI)

Post by Rno »

I have a strange issue that I can't find the origin.

All my device are tested with ping ICMP and SNMP uptime.
Spine is working fine, and for him the ping is working as it should be.

but on the GUY all my device show a ping time out, even if the device is displayed as UP (SNMP is working correctly also)

I try to do a ping from CLI as the user of the web server, and it's working fine.

So where to look for it ?

That's my cli ping:
-rwxr-xr-x. 1 root root 67712 Oct 14 19:19 /usr/bin/ping

Thanks for any idea
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
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Strange problem on Ping from cacti (not from spine or CLI)

Post by macan »

cacti version?
selinux enabled?
Let the Cacti grow!
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: Strange problem on Ping from cacti (not from spine or CLI)

Post by Rno »

Cacti 1.2.26 dev repo of last week
SElinux is active but is configured as permissive, so in my understanding it's not applied.
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
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Strange problem on Ping from cacti (not from spine or CLI)

Post by macan »

something about ping is reported
https://github.com/Cacti/cacti/issues/5665
Let the Cacti grow!
bike
Posts: 5
Joined: Sun Feb 11, 2024 12:58 pm

Re: Strange problem on Ping from cacti (not from spine or CLI)

Post by bike »

New installation of Cacti 1.2.26 - Rocky Linux 8.9, php 8.3.
I came across this problem, I was having a problem with SeLinux.
After debugging and googling, a solution appeared -

module httpd_ping 1.0;

require {
type httpd_t;
class capability { net_admin net_raw };
class icmp_socket { create getopt read setopt write };
class rawip_socket { create getopt read setopt write };
}

#============= httpd_t ==============
allow httpd_t self:capability { net_admin net_raw };
allow httpd_t self:icmp_socket { create getopt read setopt write };
allow httpd_t self:rawip_socket { create getopt read setopt write };

Please criticize.
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Strange problem on Ping from cacti (not from spine or CLI)

Post by macan »

With enabled selinux, you can meet more issues (I guess sending emails, ...). We don't have any howto set selinux correctly for Cacti system.
Let the Cacti grow!
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: Strange problem on Ping from cacti (not from spine or CLI)

Post by Rno »

Yes your right Macan
I try it first to comply with SElinux in enforce mode, but it's a real pain in the neck.

That's why I decide to set it up in permissive mode, and that should create any problem.

And I don't find any issue in SELinux that explain why the ICMP ping is displayed as down on the GUY, but still the device is up.
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
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Strange problem on Ping from cacti (not from spine or CLI)

Post by macan »

SELINUX disallow to create ICMP socket. So ICMP ping is not possible
Let the Cacti grow!
bike
Posts: 5
Joined: Sun Feb 11, 2024 12:58 pm

Re: Strange problem on Ping from cacti (not from spine or CLI)

Post by bike »

Perhaps the starter topic has a different problem, but I gave the solution to the problem with ICMP ping with SeLinux enabled above.
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Strange problem on Ping from cacti (not from spine or CLI)

Post by Osiris »

If using selinux, you have to first enable permissive mode and the run audit2allow to permit thing before going into restrictive settings. With so many Linus varient installing into different locations, the Cacti Group has elected to have admins train themselves using this process.
Before history, there was a paradise, now dust.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest