Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.63k stars 404 forks source link

Ping Result not reported properly #5665

Closed carryel closed 7 months ago

carryel commented 7 months ago

Describe the bug

cacti version is develop branch.

Ping Result was always "ICMP ping Timed out" even though the server was alive.

When debugging this issue, the parsing of the results appeared to be incorrect.

It seems to be a side-effect of https://github.com/Cacti/cacti/commit/011ae4c5c53a65d3a6ff077ed66601d79112af4e#diff-22abb1862abff566f5588ec6a9666d11553d088d2bb54a280a7b21b2ca36b499R225 .

I think the "if statement" should be reversed like this:

if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {

https://github.com/Cacti/cacti/blob/develop/lib/ping.php#L225

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'

  2. Click on '....'

  3. Scroll down to '....'

  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

Screenshot 2024-02-07 at 3 08 38 PM Screenshot 2024-02-07 at 3 08 50 PM

Desktop (please complete the following information)

Additional context

Add any other context about the problem here.

sgvfr commented 7 months ago

Also experiancing the same results with commits after https://github.com/Cacti/cacti/commit/011ae4c5c53a65d3a6ff077ed66601d79112af4e

Advanced ping template stops graphing all hosts.. git reset --hard 4563aaa1d resolves it for me.

arno-st commented 7 months ago

Same here, but didn't do the troubleshooting. Except that the ping is OK for spine, and in CLI, but on the dipslay it said ping timeout. I'm using icmp ping and SNMP uptime to get the status and the device is UP as it should be, with the ping timeout error. Cacti dev branch, On almalinux

TheWitness commented 7 months ago

Okay, fixed this. No changelog as this was between releases. Thanks for reporting all!