How to pass the IP to the Input String

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

Moderators: Developers, Moderators

marcohuang
Posts: 16
Joined: Sun Oct 28, 2007 6:02 pm
Location: CA USA

How to pass the IP to the Input String

Post by marcohuang »

Hi..

I got a problem when I try to pass the IP address from Cacti to the Input String. The Graph shows nothing.Here below is my Input string...

perl <path_cacti>/scripts/meminfo/active.pl <ip>

Here belos is my Perl Script...

use Net::SSH::Perl;
$scon = Net::SSH::Perl->new ($ARGV[0]);

...
...

I assume the IP will be pass to the end of the string...
/scripts/meminfo/active.pl <192.168.22.33>

Can someone who can help me to this quesiton? thank you so much.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Did you read the guide on how to create scripts/templates? http://docs.cacti.net/node/70

In your data input method, specify 'hostname' in the special type code field for IP.
marcohuang
Posts: 16
Joined: Sun Oct 28, 2007 6:02 pm
Location: CA USA

Post by marcohuang »

thanks for your information...

Acually I did try perl <path_cacti>/scripts/meminfo/active.pl <hostname>, but seems not work either....Does this issue related to the DNS?

I read from http://docs.cacti.net/node/25 and it shows I can put ip instead of the hostname....
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You have to select Special Host Code and specify "hostname" in the input field. It's the last textbox. Then it becomes automatic.

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?
marcohuang
Posts: 16
Joined: Sun Oct 28, 2007 6:02 pm
Location: CA USA

Post by marcohuang »

Hi...thanks..

I am new for Cacti. What is the special Host Code? How can I specify "hostname" in the input field?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Simply edit the data input method and look to the last text box. You will see it. Read the text. Also, goto docs.cacti.net for an excellent tutorial or two.

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?
marcohuang
Posts: 16
Joined: Sun Oct 28, 2007 6:02 pm
Location: CA USA

Post by marcohuang »

the snapshot is my imput field....am I doing it right ?
Attachments
snap.gif
snap.gif (44.33 KiB) Viewed 2233 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

There you go!!
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?
marcohuang
Posts: 16
Joined: Sun Oct 28, 2007 6:02 pm
Location: CA USA

Post by marcohuang »

thanks...

Actually i had done with it already..but semes still not work...still no graph shows...where am I missing?

BTW, I can run the script from the terminal "perl inactive.pl 11.22.33.44", I also fixed the IP on the "ARGV[0]" in my script....and it draws the graph..see the pic..
Attachments
snap.gif
snap.gif (5.68 KiB) Viewed 2229 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

What does the Cacti log reveal? Are you using cmd.php or cactid/spine?

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?
marcohuang
Posts: 16
Joined: Sun Oct 28, 2007 6:02 pm
Location: CA USA

Post by marcohuang »

Thanks for your help. I guess I am using the cmd.php. where can I find the Cacti log reveal ? thank you..
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Under the Console->System Utilities
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?
marcohuang
Posts: 16
Joined: Sun Oct 28, 2007 6:02 pm
Location: CA USA

Post by marcohuang »

thanks for your help..

the log shows below...

11/16/2007 06:45:05 PM - CMDPHP: Poller[0] Host[28] DS[1293] WARNING: Result from CMD not valid. Partial Result:
Attachments
snap.gif
snap.gif (4.23 KiB) Viewed 2215 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Now, check your poller cache in the same area and see what the script line looks like. Is it what you expected? Post your output from the 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?
marcohuang
Posts: 16
Joined: Sun Oct 28, 2007 6:02 pm
Location: CA USA

Post by marcohuang »

Thanks for your help.

here below is the info from the poller cache...

Script: perl /var/www/html/cacti/scripts/meminfo/Inactive.pl
RRD: /var/www/html/cacti/rra/ntcsjnt41_inactive_1293.rrd

I expected when cacti run the script, it will add the IP address in the end of the script..like below

perl /var/www/html/cacti/scripts/meminfo/Inactive.pl 11.22.33.44
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests