Script/Command inputs not working

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

Moderators: Developers, Moderators

Post Reply
dankingdon
Posts: 24
Joined: Wed Jan 07, 2009 3:00 am
Location: Bristol, UK

Script/Command inputs not working

Post by dankingdon »

I have made a custom script to grab a 1mb file from a proxy server and return the time taken for basic response monitoring.

I am trying to make cacti pass the host to the script so I can monitor multiple proxies. I have tested the script at command line and it works fine.

If I hard code the proxy address in the script it works fine in cacti.

The debug ouput from cacti shows that it is passing;
CMD: php /usr/share/cacti/site/scripts/proxy.php , output: U
My data input method is:
php <path_cacti>/scripts/proxy.php <host>
And I have added the input "host" to the inputs.

I have been running around in circles checking against existing input methods for differences but I just cannot find why mine is not passing the host address correctly.

Any help on things to check would be greatly appreciated.

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

Post by TheWitness »

Post a screen shot of your data input method while editing the "host" data input variable. What is special type code set to? It should be hostname or something to that affect.

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
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

After you make that change, you have to repopulate your poller cache.

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?
dankingdon
Posts: 24
Joined: Wed Jan 07, 2009 3:00 am
Location: Bristol, UK

Post by dankingdon »

Thanks for the info.

I have attached the screen shot.

I have just rebuilt the poller cache as well, will check the logs in a few mins to see if it is passing the host correctly. I have a feeling that the cache may have been the problem.
Attachments
proxy host input.JPG
proxy host input.JPG (43.15 KiB) Viewed 1600 times
dankingdon
Posts: 24
Joined: Wed Jan 07, 2009 3:00 am
Location: Bristol, UK

Post by dankingdon »

Just checked the poller cache entries. Looks like the rebuild didn't fix it.

The cache entry looks like this:
Script: perl /usr/share/cacti/site/scripts/ping.pl staffproxy.swgfl.org.uk
RRD: /var/lib/cacti/rra/staffproxy_swgfl_org_uk_ping_593.rrd
Script: php /usr/share/cacti/site/scripts/proxy.php
RRD: /var/lib/cacti/rra/staffproxy_swgfl_org_uk_latency_595.rrd
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Look again :o :o Those entries are, in fact, correct.

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?
dankingdon
Posts: 24
Joined: Wed Jan 07, 2009 3:00 am
Location: Bristol, UK

Post by dankingdon »

Surely there should be a host after the proxy.php? Just like the ping.pl?

The debug log is still showing
CMD: php /usr/share/cacti/site/scripts/proxy.php , output: 1048.38
It should be passing
CMD: php /usr/share/cacti/site/scripts/proxy.php hostname, output: 1048.38
Thanks for your help so far. Debugging these things can be a real pain! :)
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Sorry, looked ay the firt entry. Have you attempted to delete and recreate the graph?

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?
dankingdon
Posts: 24
Joined: Wed Jan 07, 2009 3:00 am
Location: Bristol, UK

Post by dankingdon »

That's done it. Was just the combination of getting the setup correct for the templates and then recreating the graphs. Will remember that for future issues.

Now to just sit back and watch the pretty graphs go!

Thanks for all the help.
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Good. One down, 50 more to go ;) Make sure you give back to the forums as your experience grows. Our key guy is taking a sabbatical and he may not be back for a while.

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?
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests