'Special Type Code' in Script/Command method

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

Moderators: Developers, Moderators

Post Reply
elsif
Posts: 7
Joined: Wed Jun 08, 2005 9:43 am

'Special Type Code' in Script/Command method

Post by elsif »

I can not get Cacti to pass the 'hostname' to a script called by a Script/Command data input method.

My input string is:
/usr/home/cacti/public_html/scripts/processcount.pl <ip> <string>

Input Fields:
Name Field Order Friendly Name
ip 1 ip Delete
string 2 string

IP is set to Special Type Code 'hostname'.

When I create the datasource, in the 'Custom Data' section, Cacti correctly indicates that I want it to use the IP, and displays the IP in question.

Custom Data [data input: ProcessCount]
ip (From Host: 10.1.11.80)
string (which I have set to: httpd)

Yet when I go to full debug mode, I see that Cacti is not sending the IP to the script...

07/25/2008 10:25:00 AM - CACTID: Poller[0] Host[2] DS[1048] SCRIPT: /usr/home/cacti/public_html/scripts/processcount.pl httpd, output: proccount:0
07/25/2008 10:30:01 AM - CACTID: Poller[0] Host[2] DS[1048] SCRIPT: /usr/home/cacti/public_html/scripts/processcount.pl httpd, output: proccount:0

...Notice the double space between .pl and httpd, making it treat what I intended as $string (httpd) being used as $ip.

What step did I miss? I see older versions of Cacti seemed to allow 'management_ip' as the Special Type Code, but that doesn't work here.
elsif
Posts: 7
Joined: Wed Jun 08, 2005 9:43 am

Post by elsif »

And when I try to flip the order of the two input fields:

07/25/2008 10:55:00 AM - CACTID: Poller[0] Host[2] DS[1048] SCRIPT: /usr/home/cacti/public_html/scripts/processcount.pl httpd , output: proccount:0

...Notice the space after httpd and before the comma.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Interesting, first Repopulate your Poller cache, then view the poller cache for your entry. If Repopulating did not fix it, then change your Data Input Method from "<ip>" to "<hostname>".

Please bear in mind that every time you change a data input method, you have to repopulate your poller cache. It's a bit of a pain. I might fix it some day.

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?
elsif
Posts: 7
Joined: Wed Jun 08, 2005 9:43 am

Post by elsif »

Nope, didn't help. In fact, it repopulated it with the same mistake...

07/25/2008 03:21:53 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_item (local_data_id,host_id,action,hostname, snmp_community,snmp_version,snmp_timeout,snmp_username,snmp_password,snmp_port,rrd_name,rrd_path, rrd_num,arg1,arg2,arg3) values (1048,2,1,'10.1.11.80', 'REMOVED','2','1000', '','','161', 'HOST-tor-apache','/usr/home/cacti/public_html/rra/HOST_tor_cira_ca_HOSTtorapache_1048.rrd', '1','/usr/home/cacti/public_html/scripts/processcount.pl httpd ','','')"
elsif
Posts: 7
Joined: Wed Jun 08, 2005 9:43 am

Post by elsif »

It should be noted that I'd tried removing the Data Input Method and Data Source and replacing a few times, with no luck.

Is it possible this is just broken in 0.8.8l?

Can anyone out there get it to use a Special Type Code properly?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

What version are you running?
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 2 guests