Script Server returns U value

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
luthing
Posts: 7
Joined: Tue Jun 14, 2022 12:18 am

Script Server returns U value

Post by luthing »

Morning all,

Hope you will help me to understand and debug my issue.
Any thoughts or comments would be appreciated.

When the script is triggered automatically by Cacti, the output result returned is U (unknown value), whereas when I manually execute the same script with the same arguments & parameters, it returns a normal value.

Logs:

From debug log file cacti.log :

Code: Select all

2022-06-14 09:10:17 - SPINE: Poller[1] Device[535] HT[1] DS[14937] SS[1] SERVER: /usr/share/cacti/scripts/ss_cisco_asr_sfp.php ss_sfp '1.2.3.4' 'xXx' '2' 'get' 'rx' '3789079.3789091', output: U
Manually executing SS:

Code: Select all

sudo -u www-data /usr/bin/php /usr/share/cacti/script_server.php
PHP Script Server has Started - Parent is cmd
/usr/share/cacti/scripts/ss_cisco_asr_sfp.php ss_sfp '1.2.3.4' 'xXx' '2' 'get' 'rx' '3789079.3789091'
-7.5

Thanks
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Script Server returns U value

Post by TheWitness »

Two things I can thing of.

1) poller user does not have permission
2) the script times out

Run the script out side of the script server and time it.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
luthing
Posts: 7
Joined: Tue Jun 14, 2022 12:18 am

Re: Script Server returns U value

Post by luthing »

Thanks for your reply TheWitness.

1) I forgot to say that the same script is working on a different ASR model.
Then it seems the poller user perms are right.

2) I tried to increase the "Remote Agent Timeout" value from 5 to 15 seconds, but the issue remains.
Could you please help me troubleshoot the timeout ?

Or if you have any other ideas ?

Many thanks again
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Script Server returns U value

Post by TheWitness »

Remote Agent does not work with the poller. Increase the devices timeout and/reduce the MAX OID's for other stuff. Maybe the device is real busy. Increasing timeout "should" help this, but I'm not sure what is going on in that script.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
luthing
Posts: 7
Joined: Tue Jun 14, 2022 12:18 am

Re: Script Server returns U value

Post by luthing »

The device was already with 5000ms SNMP GET timeout and 1 max OID per GET request.

I increased both of the "Number of PHP Script Servers" and "Script and Script Server Timeout Value" values in global settings.
I also increased "Data Collector Defaults" and "Data Collector Processes".

It seems to did the job.

Many thanks for pointing me in the right direction.

Last question, how can I correctly tune these settings ? Do you have any guide/doc about Data Collector settings ?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Script Server returns U value

Post by TheWitness »

It's really trial and error based upon the errors/warnings responses you get. Also need to know how timeouts work in the script. Some scripts completely ignore cacti settings, the good ones don't..
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
luthing
Posts: 7
Joined: Tue Jun 14, 2022 12:18 am

Re: Script Server returns U value

Post by luthing »

You'll find the script attached.
It's a modified version of the DOM netniV Script (https://github.com/netniV/cisco-sfp) designed to work for IOS XR > 7.x
ss_cisco_asr_sfp.php.txt
added .txt extension to be allowed with file uploader
(14.62 KiB) Downloaded 27 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Script Server returns U value

Post by TheWitness »

Yikes, @netniV should really rewrite that script. It ignores the Cacti timeout and retry values. It looks maybe a bit chatty too. Not something I can fix and test though since I don't do networking any longer.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
luthing
Posts: 7
Joined: Tue Jun 14, 2022 12:18 am

Re: Script Server returns U value

Post by luthing »

Could you share me any guidelines regarding these settings ?
I will try to add them into that script.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Script Server returns U value

Post by TheWitness »

Pass the host id instead of hostname. The gather the host details using a query. Not sure about the rest.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests