Scripts not working after upgrade to 1.2.14

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

Moderators: Developers, Moderators

Post Reply
hecalso
Posts: 1
Joined: Thu Nov 26, 2020 6:01 am

Scripts not working after upgrade to 1.2.14

Post by hecalso »

Hi all,
We have installed version 1.2.14 and imported our previous database from version 0.8.8h. Basic graphs are working fine, but those using scripts show NaN in the new server.
I have tested running the script manually and I am getting the correct output, but if I run spine manually, I get an empty response from the device, causing the NaN in the graphs:

Code: Select all

[root@dfs-cacti-53 scripts]# /usr/bin/spine -C /etc/spine.conf -H 756 -V 5
SPINE: Using spine config file [/etc/spine.conf]
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The path_php_server variable is /usr/share/cacti/script_server.php
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The path_cactilog variable is /usr/share/cacti/log/cacti.log
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The log_destination variable is 1 (FILE)
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The path_php variable is /usr/bin/php
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The availability_method variable is 4
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The ping_recovery_count variable is 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The ping_failure_count variable is 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The ping_method variable is 1
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The ping_retries variable is 1
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The ping_timeout variable is 3000
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The snmp_retries variable is 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The log_perror variable is 1
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The log_pwarn variable is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The boost_redirect variable is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The boost_rrd_update_enable variable is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The log_pstats variable is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The threads variable is 10
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The polling interval is 300 seconds
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The number of concurrent processes is 10
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The script timeout is 60
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The selective_device_debug variable is 786,756
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The spine_log_level variable is 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The number of php script servers to run is 5
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Device List to be polled='756', TotalPHPScripts='0'
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The PHP Script Server is Not Required
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The Maximum SNMP OID Get Size is 100
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Selective Debug Devices 786,756
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Version 1.2.14 starting
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: MySQL is Thread Safe!
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Spine running as 0 UID, 0 EUID
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Spine is running as root.
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Spine has got ICMP
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] SPINE: Initializing Net-SNMP API
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Issues with SNMP Header Version information, assuming old version of Net-SNMP.
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] SPINE: Initializing PHP Script Server(s)
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] NOTE: Spine will support multithread device polling.
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Initial Value of Active Threads is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: In Poller, About to Start Polling of Device for Device ID 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Valid Thread to be Created
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] SPINE: Active Threads is 1, Pending is 1
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: In Poller, About to Start Polling of Device for Device ID 756
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Valid Thread to be Created
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[0] HT[1] Total Time: 0.0028 Seconds
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] SPINE: Active Threads is 2, Pending is 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[0] HT[1] DEBUG: HOST COMPLETE: About to Exit Device Polling Thread Function
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The Value of Active Threads is 1 for Device ID 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] POLLER: Active Threads is 1, Pending is 1
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] INFO: SNMP Device '10.130.62.191' has timeout 10000000 (10000), retries 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] IPv4 address 10.130.62.191 (10.130.62.191)
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: Entering ICMP Ping
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: Attempting to ping 10.130.62.191, seq 0 (Retry 0 of 1)
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: ICMP Device Alive, Try Count:1, Time:3.5319 ms
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: Entering SNMP Ping
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] PING Result: ICMP: Device is Alive
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] SNMP Result: Device responded to SNMP
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] NOTE: Device[756] Checking for System Information Update
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] NOTE: Device[756] Updating Full System Information Table
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] RECACHE: Processing 1 items in the auto reindex cache for '10.130.62.191'
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DQ[1] RECACHE OID: .1.3.6.1.2.1.1.3.0, (assert: 2834714372 < output: 2834724511)
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] NOTE: There are '10' Polling Items for this Device
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: The NIFTY POPEN returned the following File Descriptor 5
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] WARNING: Invalid Response, Device[756] HT[1] DS[9581] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_sip_calls.sh '10.130.62.191', output: 
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[9581] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_sip_calls.sh '10.130.62.191', output: U
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: The NIFTY POPEN returned the following File Descriptor 5
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] WARNING: Invalid Response, Device[756] HT[1] DS[12015] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_xcd_total_resources.sh '10.130.62.191', output: 
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12015] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_xcd_total_resources.sh '10.130.62.191', output: U
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: The NIFTY POPEN returned the following File Descriptor 5
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] WARNING: Invalid Response, Device[756] HT[1] DS[12016] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_xcd_unused_resources.sh '10.130.62.191', output: 
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12016] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_xcd_unused_resources.sh '10.130.62.191', output: U
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] INFO: SNMP Device '10.130.62.191' has timeout 10000000 (10000), retries 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: The NIFTY POPEN returned the following File Descriptor 6
[b]2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[13815] SCRIPT: /bin/sh /usr/share/cacti/scripts/test.sh '10.130.62.191', output: calls:[/b]
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12779] SNMP: v3: 10.130.62.191, dsname: snmp_oid_OK_2023, oid: 1.3.6.1.2.1.10.21.1.2.2.1.3.2023.15, value: 35857
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12780] SNMP: v3: 10.130.62.191, dsname: snmp_oid_NOK_2023, oid: 1.3.6.1.2.1.10.21.1.2.2.1.4.2023.15, value: 88720
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12781] SNMP: v3: 10.130.62.191, dsname: snmp_oid_NOK_2026, oid: 1.3.6.1.2.1.10.21.1.2.2.1.4.2026.16, value: 32090
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12782] SNMP: v3: 10.130.62.191, dsname: snmp_oid_OK_2026, oid: 1.3.6.1.2.1.10.21.1.2.2.1.3.2026.16, value: 72453
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12802] SNMP: v3: 10.130.62.191, dsname: snmp_oid_NOK_23, oid: 1.3.6.1.2.1.10.21.1.2.2.1.6.23.17, value: 64831
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12803] SNMP: v3: 10.130.62.191, dsname: snmp_oid_OK_23, oid: 1.3.6.1.2.1.10.21.1.2.2.1.5.23.17, value: 48443
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] Total Time: 0.32 Seconds
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DEBUG: HOST COMPLETE: About to Exit Device Polling Thread Function
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The Value of Active Threads is 0 for Device ID 756
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] POLLER: Active Threads is 0, Pending is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] SPINE: The Final Value of Threads is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Thread Cleanup Complete
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: PHP Script Server Pipes Closed
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Allocated Variable Memory Freed
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: MYSQL Free & Close Completed
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Net-SNMP Close Completed
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Time: 0.3936 s, Threads: 10, Devices: 2

Code: Select all

[b][root@dfs-cacti-53 scripts]#  /bin/sh /usr/share/cacti/scripts/test.sh '10.130.62.191'[/b]
calls:10
The script is:

Code: Select all

[root@dfs-cacti-53 scripts]#  more test.sh 
#!/bin/bash

sip_calls=$(snmpwalk -v3 -l authPriv -u <user> -a SHA -A <SHA> -x AES -X <AES> $1 1.3.6.1.4.1.9.9.63.1.3.8.1.1.2.2 | cut -d":" -f4 | xargs)

echo calls:$sip_calls
This is just a test script, but we are having the same issue with all our scripts.

Any idea on how to solve it is appreciated. Thank you
User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Scripts not working after upgrade to 1.2.14

Post by macan »

hecalso wrote: Thu Nov 26, 2020 6:20 am Hi all,
We have installed version 1.2.14 and imported our previous database from version 0.8.8h. Basic graphs are working fine, but those using scripts show NaN in the new server.
I have tested running the script manually and I am getting the correct output, but if I run spine manually, I get an empty response from the device, causing the NaN in the graphs:

Code: Select all

[root@dfs-cacti-53 scripts]# /usr/bin/spine -C /etc/spine.conf -H 756 -V 5
SPINE: Using spine config file [/etc/spine.conf]
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The path_php_server variable is /usr/share/cacti/script_server.php
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The path_cactilog variable is /usr/share/cacti/log/cacti.log
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The log_destination variable is 1 (FILE)
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The path_php variable is /usr/bin/php
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The availability_method variable is 4
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The ping_recovery_count variable is 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The ping_failure_count variable is 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The ping_method variable is 1
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The ping_retries variable is 1
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The ping_timeout variable is 3000
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The snmp_retries variable is 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The log_perror variable is 1
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The log_pwarn variable is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The boost_redirect variable is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The boost_rrd_update_enable variable is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The log_pstats variable is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The threads variable is 10
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The polling interval is 300 seconds
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The number of concurrent processes is 10
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The script timeout is 60
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The selective_device_debug variable is 786,756
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The spine_log_level variable is 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The number of php script servers to run is 5
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Device List to be polled='756', TotalPHPScripts='0'
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The PHP Script Server is Not Required
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The Maximum SNMP OID Get Size is 100
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Selective Debug Devices 786,756
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Version 1.2.14 starting
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: MySQL is Thread Safe!
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Spine running as 0 UID, 0 EUID
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Spine is running as root.
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Spine has got ICMP
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] SPINE: Initializing Net-SNMP API
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Issues with SNMP Header Version information, assuming old version of Net-SNMP.
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] SPINE: Initializing PHP Script Server(s)
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] NOTE: Spine will support multithread device polling.
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Initial Value of Active Threads is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: In Poller, About to Start Polling of Device for Device ID 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Valid Thread to be Created
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] SPINE: Active Threads is 1, Pending is 1
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: In Poller, About to Start Polling of Device for Device ID 756
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Valid Thread to be Created
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[0] HT[1] Total Time: 0.0028 Seconds
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] SPINE: Active Threads is 2, Pending is 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[0] HT[1] DEBUG: HOST COMPLETE: About to Exit Device Polling Thread Function
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The Value of Active Threads is 1 for Device ID 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] POLLER: Active Threads is 1, Pending is 1
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] INFO: SNMP Device '10.130.62.191' has timeout 10000000 (10000), retries 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] IPv4 address 10.130.62.191 (10.130.62.191)
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: Entering ICMP Ping
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: Attempting to ping 10.130.62.191, seq 0 (Retry 0 of 1)
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: ICMP Device Alive, Try Count:1, Time:3.5319 ms
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: Entering SNMP Ping
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] PING Result: ICMP: Device is Alive
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] SNMP Result: Device responded to SNMP
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] NOTE: Device[756] Checking for System Information Update
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] NOTE: Device[756] Updating Full System Information Table
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] RECACHE: Processing 1 items in the auto reindex cache for '10.130.62.191'
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DQ[1] RECACHE OID: .1.3.6.1.2.1.1.3.0, (assert: 2834714372 < output: 2834724511)
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] NOTE: There are '10' Polling Items for this Device
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: The NIFTY POPEN returned the following File Descriptor 5
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] WARNING: Invalid Response, Device[756] HT[1] DS[9581] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_sip_calls.sh '10.130.62.191', output: 
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[9581] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_sip_calls.sh '10.130.62.191', output: U
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: The NIFTY POPEN returned the following File Descriptor 5
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] WARNING: Invalid Response, Device[756] HT[1] DS[12015] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_xcd_total_resources.sh '10.130.62.191', output: 
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12015] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_xcd_total_resources.sh '10.130.62.191', output: U
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: The NIFTY POPEN returned the following File Descriptor 5
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] WARNING: Invalid Response, Device[756] HT[1] DS[12016] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_xcd_unused_resources.sh '10.130.62.191', output: 
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12016] SCRIPT: /bin/sh /usr/share/cacti/scripts/query_xcd_unused_resources.sh '10.130.62.191', output: U
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] INFO: SNMP Device '10.130.62.191' has timeout 10000000 (10000), retries 2
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] DEBUG: The NIFTY POPEN returned the following File Descriptor 6
[b]2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[13815] SCRIPT: /bin/sh /usr/share/cacti/scripts/test.sh '10.130.62.191', output: calls:[/b]
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12779] SNMP: v3: 10.130.62.191, dsname: snmp_oid_OK_2023, oid: 1.3.6.1.2.1.10.21.1.2.2.1.3.2023.15, value: 35857
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12780] SNMP: v3: 10.130.62.191, dsname: snmp_oid_NOK_2023, oid: 1.3.6.1.2.1.10.21.1.2.2.1.4.2023.15, value: 88720
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12781] SNMP: v3: 10.130.62.191, dsname: snmp_oid_NOK_2026, oid: 1.3.6.1.2.1.10.21.1.2.2.1.4.2026.16, value: 32090
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12782] SNMP: v3: 10.130.62.191, dsname: snmp_oid_OK_2026, oid: 1.3.6.1.2.1.10.21.1.2.2.1.3.2026.16, value: 72453
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12802] SNMP: v3: 10.130.62.191, dsname: snmp_oid_NOK_23, oid: 1.3.6.1.2.1.10.21.1.2.2.1.6.23.17, value: 64831
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DS[12803] SNMP: v3: 10.130.62.191, dsname: snmp_oid_OK_23, oid: 1.3.6.1.2.1.10.21.1.2.2.1.5.23.17, value: 48443
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] Total Time: 0.32 Seconds
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Device[756] HT[1] DEBUG: HOST COMPLETE: About to Exit Device Polling Thread Function
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: The Value of Active Threads is 0 for Device ID 756
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] POLLER: Active Threads is 0, Pending is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] SPINE: The Final Value of Threads is 0
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Thread Cleanup Complete
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: PHP Script Server Pipes Closed
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Allocated Variable Memory Freed
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: MYSQL Free & Close Completed
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] DEBUG: Net-SNMP Close Completed
2020-11-26 12:15:12 - SPINE: Poller[1] PID[44477] Time: 0.3936 s, Threads: 10, Devices: 2

Code: Select all

[b][root@dfs-cacti-53 scripts]#  /bin/sh /usr/share/cacti/scripts/test.sh '10.130.62.191'[/b]
calls:10
The script is:

Code: Select all

[root@dfs-cacti-53 scripts]#  more test.sh 
#!/bin/bash

sip_calls=$(snmpwalk -v3 -l authPriv -u <user> -a SHA -A <SHA> -x AES -X <AES> $1 1.3.6.1.4.1.9.9.63.1.3.8.1.1.2.2 | cut -d":" -f4 | xargs)

echo calls:$sip_calls
This is just a test script, but we are having the same issue with all our scripts.

Any idea on how to solve it is appreciated. Thank you
Maybe any PATH variable issue? Run by hand - you have correct PATH variable like
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:....

But your script doesn't know PATH. You have two posiblities:
1) add PATH to your script:
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin ....
2) insert full path for commands snmpwalk, cut and xargs (type xargs)
result will be something like:
sip_calls=$(/usr/local/bin/snmpwalk -v3 -l authPriv -u <user> -a SHA -A <SHA> -x AES -X <AES> $1 1.3.6.1.4.1.9.9.63.1.3.8.1.1.2.2 | /bin/cut -d":" -f4 | /usr/bin/xargs)
It is only example, your paths could be different, use type xargs, type snmpwalk, type cut
Let the Cacti grow!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests