spine 0.8.7g not returning a script result

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

Moderators: Developers, Moderators

skol
Posts: 41
Joined: Mon Nov 10, 2003 3:06 pm

spine 0.8.7g not returning a script result

Post by skol »

Here is what the output looks like in spine 0.8.7e :

Code: Select all

07/21/2010 11:10:03 AM - SPINE: Poller[0] Host[12] DS[6111] SCRIPT: perl /graphs/graphs/scripts/openldap_operations.pl -h d2r1a10 -p 389 -D cn=dcAuth,ou=Applications,dc=example,dc=com -W  password -t 5 -v 3, output: bind-initiated:22119148 bind-completed:22119148 unbind-initiated:8306632 unbind-completed:8306632 search-initiated:49139241 search-completed:49139240 compare-initiated:0 compare-completed:0 modify-initiated:0 modify-completed:0 modrdn-initiated:0 modrdn-completed:0 add-initiated:0 add-completed:0 delete-initiated:0 delete-completed:0 abandon-initiated:894 abandon-completed:894 extended-initiated:0 extended-completed:0
Here is what its returning in 0.8.7.g :

Code: Select all

07/21/2010 11:00:03 AM - SPINE: Poller[0] Host[17] TH[1] DS[6115] SCRIPT: perl /graphs/graphs/scripts/openldap_operations.pl -h d2r1b10 -p 389 -D cn=dcAuth,ou=Applications,dc=example,dc=com -W  password -t 5 -v 3, output: 0
This is with cacti 0.8.7e.

I rolled back to previous version of spine for now, just FYI if someone else is seeing something like this.

This was the only item out of 100,000 graphs/ds which wasn't working during an upgrade.
pedrofmp
Posts: 3
Joined: Fri Mar 26, 2010 12:05 pm

Post by pedrofmp »

I'm having a similar problem. My script returns U ( empty results) when i use spine ( i tried spine 087a and 087e).
If i use cmd.php it works fine.
Here's a freebsd 8.0 with cacti 087g.
How do i test it with spine ?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please make sure, that all printed data is printed on a single "print" statement.
R.
dh-lin
Posts: 1
Joined: Thu Jul 22, 2010 5:33 am

Post by dh-lin »

HI,

i have same problem with tomcatstats Script. spine-0.8.7e and cmd.php works fine. Script has just one print but lot of values (423 chars).
pedrofmp
Posts: 3
Joined: Fri Mar 26, 2010 12:05 pm

Script

Post by pedrofmp »

In my case it is already a single print statement.
could it be something related to FreeBSD ?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

It's a configure option. You need to build with the popen option is you want to call perl without using a path to perl. If you use the Nifty POpen method, you script must call out the full path to 'perl' aka '/usr/bin/perl'.

To get help, run "./configure --help"

TheWitness
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?
fcorazza
Posts: 9
Joined: Fri Jul 17, 2009 6:09 am

Post by fcorazza »

TheWitness wrote:It's a configure option. You need to build with the popen option is you want to call perl without using a path to perl. If you use the Nifty POpen method, you script must call out the full path to 'perl' aka '/usr/bin/perl'.

To get help, run "./configure --help"

TheWitness
It is not a problem concerning popen / nifty popen because I get exactly the same issue even specifying the full path of the shell:

Code: Select all

SCRIPT: /usr/bin/sh /var/opt/webstack/apache2/2.2/htdocs/cacti-0.8.7g/scripts/iw_rmt_apstat.sh server.bla.com www.website.com, output: 0
DEBUG: The POPEN returned the following File Descriptor 6
^CFATAL: Spine Interrupted by Console Operator (Spine thread)
Of course this doesn't happen on 0.8.7e, whether you're using popen or nifty popen (btw: I've tried compiling spine 0.8.7g with popen and the problem is still there).

I've looked at this bug and apparently this seems to be the issue:

http://bugs.cacti.net/bug_view_page.php?bug_id=1833

However not all of us can access svn as in my case I'm behind a proxy, and doing a checkout from websvn doesn't work because your web server seems to be badly configured (trailing slash problem with websvn, it's a known problem which can be solved by fixing the apache configuration - http://subversion.apache.org/faq.html#http-301-error):

Code: Select all

Command: Checkout from http://svn.cacti.net/viewvc/spine/branches/0.8.7, revision HEAD, Fully recursive, Externals included  
Error: Repository moved permanently to '/viewvc/spine/branches/0.8.7/'; please relocate  
Finished!:   
Back to the missing script output issue - as this is a major showstopper for script based data sources can you please release a patch to be applied against the "stable" 0.8.7g version as it's not very encouraging to run svn code in production.

Thanks a lot
fcorazza
Posts: 9
Joined: Fri Jul 17, 2009 6:09 am

Post by fcorazza »

Been able to get a friend to check out the latest HEAD from the Spine SVN repository and send it to me by email - I can confirm the scripts now back working!

As I said, it would be appreciated if:

- a patch would be rolled out to address this problem
- the websvn would get fixed so that we can also check out svn using HTTP

If you need help for doing the latter I can provide assistance.


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

Post by TheWitness »

Understood on the SVN comment. All the devs have full time jobs, but we stillfeel guilty.

TheWitness
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?
User avatar
classen
Cacti User
Posts: 116
Joined: Thu Nov 12, 2009 3:07 pm

Re: spine 0.8.7g not returning a script result

Post by classen »

Aha I'm not alone. I wondered why my openldap_operations.pl script wasn't working from within cacti.

consider this another humble request to the revered cacti developers to provide a patch for 0.8.7g

thanks^6
User avatar
classen
Cacti User
Posts: 116
Joined: Thu Nov 12, 2009 3:07 pm

Re:

Post by classen »

fcorazza wrote:Been able to get a friend to check out the latest HEAD from the Spine SVN repository and send it to me by email - I can confirm the scripts now back working!
I have many php and perl scripts which return proper results when run from the command line, but return 0 when called from cacti/spine.

Would you please elaborate on what exactly you did with the SVN version to get your 0.8.7g installation working again. I'm very afraid to jump to a non-alpha 0.8.8 until advised by the developers.

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

Re: spine 0.8.7g not returning a script result

Post by TheWitness »

Post you scripts. The 087g release + patches are stable.

TheWitness
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?
User avatar
classen
Cacti User
Posts: 116
Joined: Thu Nov 12, 2009 3:07 pm

Re: spine 0.8.7g not returning a script result

Post by classen »

There are two scripts which I'm having problems with:

1. The LDAP Perl scripts referred to in this post http://forums.cacti.net/viewtopic.php?f=12&t=8905
and
2. The MySQL PHP scripts from here. http://code.google.com/p/mysql-cacti-templates/

Both work from the command line, but return 0 from within cacti/spine.

I have applied all of the following patches:

Code: Select all

patch -p1 -N < data_source_deactivate.patch
patch -p1 -N < graph_list_view.patch
patch -p1 -N < html_output.patch
patch -p1 -N < ldap_group_authenication.patch
patch -p1 -N < script_server_command_line_parse.patch
patch -p1 -N < ping.patch
patch -p1 -N < poller_interval.patch
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: spine 0.8.7g not returning a script result

Post by TheWitness »

Show me the output from one of these commands.
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?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: spine 0.8.7g not returning a script result

Post by TheWitness »

The first file should work unless the Cacti poller account does not have access.

Code: Select all

ldap_response_time.pl


The second file will NOT work due to the way it produces output. It's an easy fix.

Code: Select all

openldap_operations.pl
Also, you may also have to specify the full path to perl. For example, instead of:

Code: Select all

perl <path_cacti>/scripts/file.pl
It's better to do:

Code: Select all

/usr/bin/perl <path_cacti/scripts/file.pl
I don't think this is a requirement anylonger thought.

Also, how long do these scripts take to run. If you don't have a high enough timeout, the result will always be 0. A good test would be something on the order of:

Code: Select all

time /usr/bin/perl <path_cacti>/scripts/file.pl
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 1 guest