Input fields

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

Moderators: Developers, Moderators

Post Reply
marcostrullato
Posts: 1
Joined: Mon Sep 30, 2013 6:57 am

Input fields

Post by marcostrullato »

Hi all, I need to make a script that is collecting data from remote hosts more general: unfortunately I'm not able to make the port number as a variable.

Now in the "data input method" I have the command line "perl <path_cacti>/scripts/script.pl <hostname>:<port>".
In the input fields I have "hostname". The Field [Input] is "hostname", then the "Special Type Code" is hostname.

I think this "hostname" comes from the "Devices" > "machine" page, hostname field.

How can I make the port a variable that I can fill during the creation of the device?


Thanks

Marco
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Input fields

Post by gandalf »

Please make use of
Special Type Code
If this field should be treated specially by host templates, indicate so here. Valid keywords for this field are 'hostname', 'host_id', 'snmp_community', 'snmp_username', 'snmp_password', 'snmp_auth_protocol', 'snmp_priv_passphrase', 'snmp_priv_protocol', 'snmp_context', 'snmp_version', 'snmp_port', 'snmp_timeout'
You can pass the SNMP port to that script.
Honestly, this won't work in case you are using SNMP on that host and not only scripts.
In this case, you'll have to create a new input parameter, like "script_port". Now, each time you create a graph using a data template which refers to this script, you will be prompted to enter a "script_port".
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests