Passing addititional device attributes to command script

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

Moderators: Developers, Moderators

Post Reply
LarsKN
Posts: 3
Joined: Wed Jul 18, 2012 1:57 am

Passing addititional device attributes to command script

Post by LarsKN »

Hello everybody,

for java application monitoring I am using a custom script based on the percona stuff to get all required information via JMX. To keep the number of JMX connections limited data is retrieved for several graphs in one run and afterwards cached.

The script is called as folows:

Code: Select all

<path_php_binary> -q <path_cacti>/scripts/ss_get_by_ssh.php --host <hostname> --type jmx --port2 <jmx_port> --jmx-user <jmx_user> --jmx-pwd <jmx_password> --items la,ld,lm,lp --ant-target knlogin_webapp_apps
Unfortunately only the <hostname> is substituted with device's hostname. All other parameters must be defined for each graph again and again. It would be really nice to define jmx parameters on device level and substitute the corresponding placeholders in the script command, like it is done for hostname. As this feature is not available I am looking for a nice workaround like putting the device specific part of the command into the notes field of the device and substitute <note> in the command string. Unfortunately this does not work too.

Now I would like to patch the php sources so that at least the mentioned workaround works. Can anyone give me hint on this or has a better idea?

Kind regards,

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

Re: Passing addititional device attributes to command script

Post by gandalf »

Are those additional parameters fixed or do they vary between different graphs?
R.
LarsKN
Posts: 3
Joined: Wed Jul 18, 2012 1:57 am

Re: Passing addititional device attributes to command script

Post by LarsKN »

Hi,

the parameters are the same for all graphs related to the device but different to the corresponding graphs of another device (application).

Device 1: Tomcat 1 on server A
  • Graph A: JVM Heap Memory
    Graph B: HTTP Threadpool
    Graph C: JK Threadpool
    Graph D: Garbage Collection Count
    Graph E: Garbage Collection CPU time
The parameters are jmx_port:10209, jmx_user:usr, jmx_password:pwd, ant_target: Webapplication

Device 2: Tomcat 2 on server A
  • Graph A: JVM Heap Memory
    Graph B: HTTP Threadpool
    Graph C: JK Threadpool
    Graph D: Garbage Collection Count
    Graph E: Garbage Collection CPU time
The parameters are jmx_port:10309, jmx_user:usr, jmx_password:pwd, ant_target: Webapplication

Device 3: Java Batchapplication on Server B
  • Graph A: JVM Heap Memory
    Graph B: Garbage Collection Count
    Graph C: Garbage Collection CPU time
    Graph D: Backlog of some processes
    Graph E: Throughput of some processes
The parameters are jmx_port:11109, jmx_user:usr2, jmx_password:pwd2, ant_target: Batch

Overall I want to gather data from 12 Tomcats with 17 Graphs each and 6 batch applications with 25 Graphs each.

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

Re: Passing addititional device attributes to command script

Post by gandalf »

Did you already review http://docs.cacti.net/manual:087:6_refe ... _new_graph for cg graphs?
R.
LarsKN
Posts: 3
Joined: Wed Jul 18, 2012 1:57 am

Re: Passing addititional device attributes to command script

Post by LarsKN »

Hi,

that is in fact a good idea to use the CLI for mass setup of graphs.

Many thanks,

Lars
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests