Cacti / cacti

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

after upgrade from 1.2.24 to 1.2.25, cacti shows status UP for ALL hosts, even for hosts that are DOWN. #5505

Closed luizfernandoandrade closed 1 year ago

luizfernandoandrade commented 1 year ago

Describe the bug

after upgrade from 1.2.24 to 1.2.25, cacti shows status UP for ALL hosts, even for hosts that are DOWN.

To Reproduce

ping 172.20.6.12

PING 172.20.6.12 (172.20.6.12) 56(84) bytes of data. --- 172.20.6.12 ping statistics --- 6 packets transmitted, 0 received, 100% packet loss, time 5163ms

php /opt/cacti_new/cmd.php --first=335 --last=335 --debug

Cannot load Zend OPcache - it was already loaded Total[1.0057] Device[335] STATUS: Device '172.20.6.12' is UP. Total[1.0059] Device[335] RECACHE: Processing 4 items in the auto reindex cache for '172.20.6.12'. Total[5.0106] Device[335] DQ[23] RECACHE OID: .1.3.6.1.2.1.1.3.0, (assert: < output:) Total[9.0154] Device[335] DQ[25] RECACHE OID: .1.3.6.1.2.1.1.3.0, (assert: < output:) Total[13.0199] Device[335] DQ[26] RECACHE OID: .1.3.6.1.2.1.1.3.0, (assert: < output:) Total[17.0242] Device[335] DQ[28] RECACHE OID: .1.3.6.1.2.1.1.3.0, (assert: < output:)

Expected behavior

when host go down, cacti status shows DOWN

Screenshots

Desktop (please complete the following information)

Date Tue, 26 Sep 2023 11:04:51 +0000 Cacti Version 1.2.25 Cacti OS unix (Amazon Linux 2) RSA Fingerprint d4:5b:6b:68:76:d1:66:85:78:23:57:bd:93:7b:95:7b NET-SNMP Version NET-SNMP version: 5.7.2 RRDtool Version Configured 1.4.0+ RRDtool Version Found 1.4.8

PHP Version 8.2.9 PHP OS Linux PHP uname Linux noc11 5.15.128-81.144.amzn2.x86_64 #1 SMP Wed Sep 6 21:02:12 UTC 2023 x86_64

version 10.5.18-MariaDB

Additional context

TheWitness commented 1 year ago

I suspect you have an issue with your data collector. The following test hosts have the following ping method and are reporting down properly:

1) SNMP Uptime 2) ICMP 3) TCP Port 22 4) UDP Port 23

image

luizfernandoandrade commented 1 year ago

after upgrated cacti 1.2.24 to 1.2.25 , ALL devices status are show as UP, despite there being several targets OFF. the web interface, in the console->device->(edit), the ICMP and SNMP responses fail, but the status information at console->device remains as UP. Screenshot 2023-09-28 080046 Screenshot 2023-09-28 080224

at linux shell, ping (icmp) and snmpget (snmp) have no answer (host is down), but cmd.php (in debug mode) shows UP. i supose ther is some bug in cacti colector.

I have this behavior on 2 cacti servers, with many devices each.

TheWitness commented 1 year ago

Once you get snmpget to work, then Cacti will start to work again. Did someone block you with a firewall or change the community strings on the switches and routers, or create an ACL on the devices that blocks your access? That's what this sounds like and not a Cacti issue. If this issue was happening more broadly, we would have see reams of tickets. So, I'm suggesting this is more of a local issue and will mark this ticket as support and close it. Best to take these issues to the forums anyway.

luizfernandoandrade commented 1 year ago

data collection is working (ICMP, SNMP or TCP). Graphics are being generated. What is not working as it should is the information about the device's STATUS. ALL devices appear as UP in the web interface, even those that are OFF (and should appear as DOWN).

In the example, the erpdb24hm server (172.20.6.12) is OFF, therefore it should appear with DOWN status. the editing screen shows that there is no SNMP or ICMP response, but on the devices screen it appears with status UP (it should appear as DOWN because, I repeat, it is off).

the problem is with the identification and registration of the device STATUS.

Running cmd.php in debug mode, the device is identified as UP (which is WRONG because it is OFF)

TheWitness commented 1 year ago

What about spine?

TheWitness commented 1 year ago

You should post the cmd.php debug output for that device.

luizfernandoandrade commented 1 year ago

i am using spine as regular pooler. i use cmd.php just for debug. cmd.php debug is at bug description, but here again:

php /opt/cacti_new/cmd.php --first=335 --last=335 --debug

Cannot load Zend OPcache - it was already loaded Total[1.0054] Device[335] STATUS: Device '172.20.6.12' is UP. Total[1.0057] Device[335] RECACHE: Processing 4 items in the auto reindex cache for '172.20.6.12'. Total[5.0106] Device[335] DQ[23] RECACHE OID: .1.3.6.1.2.1.1.3.0, (assert:2769820 < output:) Total[5.0107] Device[335] DQ[23] RECACHE ASSERT FAILED '2769820< Total[9.0169] Device[335] DQ[25] RECACHE OID: .1.3.6.1.2.1.1.3.0, (assert:2769820 < output:) Total[9.0170] Device[335] DQ[25] RECACHE ASSERT FAILED '2769820< Total[13.0246] Device[335] DQ[26] RECACHE OID: .1.3.6.1.2.1.1.3.0, (assert:2769820 < output:) Total[13.0247] Device[335] DQ[26] RECACHE ASSERT FAILED '2769820< Total[17.0313] Device[335] DQ[28] RECACHE OID: .1.3.6.1.2.1.1.3.0, (assert:2769820 < output:) Total[17.0314] Device[335] DQ[28] RECACHE ASSERT FAILED '2769820< Total[27.0405] Device[335] DS[5942] TT[10007.26] SCRIPT: perl /opt/cacti_new/scripts/ping.pl '172.20.6.12', output: U Total[29.0431] Device[335] DS[5943] TT[2002.32] SNMP: v2: 172.20.6.12, dsname: proc, oid: .1.3.6.1.2.1.25.1.6.0, output: U Total[31.0453] Device[335] DS[5944] TT[2002.07] SNMP: v2: 172.20.6.12, dsname: users, oid: .1.3.6.1.2.1.25.1.5.0, output: U Total[35.0839] Device[335] DS[5945] TT[4038.52] SERVER: /opt/cacti_new/scripts/ss_host_cpu.php ss_host_cpu '172.20.6.12' '335' '2:161:500:1:10:BatutaPreta::::::' 'get' 'usage' '0', output: U Total[39.1361] Device[335] DS[5946] TT[4052.06] SERVER: /opt/cacti_new/scripts/ss_host_cpu.php ss_host_cpu '172.20.6.12' '335' '2:161:500:1:10:BatutaPreta::::::' 'get' 'usage' '1', output: U

...

Total[171.3184] Device[335] DS[6264] TT[2002.3] SNMP: v2: 172.20.6.12, dsname: DiskWritesPerSec, oid: .1.3.6.1.4.1.9600.1.1.1.1.19.6.95.84.111.116.97.108, output: U Total[173.3209] Device[335] DS[6264] TT[2002.35] SNMP: v2: 172.20.6.12, dsname: DiskTransfersPerSec, oid: .1.3.6.1.4.1.9600.1.1.1.1.17.6.95.84.111.116.97.108, output: U Total[173.3210] Device[335] Writing 75 items to Poller Output Table Total[173.3230] Device[335] Time[173.32] Items[75] Errors[29] Total[173.3311] Time: 173.4569 s, Poller: 1, Threads: N/A, Devices: 1, Items: 75, Errors: 29

TheWitness commented 1 year ago

I just checked with SNMP Uptime on one of my lab hosts using cmd.php. Looks like it's working perfectly. Avoid using the or and and options.

[root@vmhost5 cacti]# php -q cmd.php --first=33 --last=33 --debug
Total[4.0080] Device[33] STATUS: Device '192.168.11.201' is Down.
Total[4.0087] Device[33] Time[4.01] Items[0] Errors[0]
Total[4.0189] Time: 4.1256 s, Poller: 1, Threads: N/A, Devices: 1, Items: 23, Errors: 0
luizfernandoandrade commented 11 months ago

I made more testes and realize that if i use just "PING" or just "SNMP uptime" as "Downed Device Detection" all works fine. But if i use "PING or SNMP uptime" option, ALL devices apear with status UP, even if it is powered off.

timofeev-ak commented 10 months ago

Same problem!!! Data collection is working (ICMP, SNMP or TCP). Graphics are being generated. What is not working as it should is the information about the device's STATUS. ALL devices appear as UP in the web interface, even those that are OFF (and should appear as DOWN). the problem is with the identification and registration of the device STATUS. Running cmd.php in debug mode, the device is identified as UP (which is WRONG because it is OFF)

TheWitness commented 10 months ago

For those devices, what is the ping method?

timofeev-ak commented 10 months ago

2023-11-30_11-20-54

TheWitness commented 10 months ago

Which ping method?