Disk Usage through SSH script

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

Moderators: Developers, Moderators

Post Reply
ar1
Posts: 18
Joined: Mon Mar 13, 2006 4:33 pm
Location: Bloomington, IL

Disk Usage through SSH script

Post by ar1 »

I'm wondering if it's possible to do the following using Cacti: have a graph for a remote machine (not running SNMP) with a line for the used space (percentage) for each partition of the disk.

So that will allow me to monitor the disk usage for each partition on the same graph, will be very helpful I think.

Any ideas on how it could be done best?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

There are several users world-wide using ssh to poll hosts. It's just much slower though.

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?
ar1
Posts: 18
Joined: Mon Mar 13, 2006 4:33 pm
Location: Bloomington, IL

Post by ar1 »

Well, I'm using ssh scripts for other stuff like cpu and memory usage. But I was wondering if anyone knows how to do what I want with the partitions being on one graph.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

YOu have to keep two things in mind: When using ssh, be aware of the fact that the scripts are executed by the cactiuser given in your crontab. You will have to perform kex exchange for this user. When using ssh for Script Queries, this is even needed for the httpd's user (when running Verbose Query or adding the Query for the first time)
If you think about adding partitions to a single graph, this will result in a big problem, because the number of partitions will vary between target host's. And there is no such thing as a Graph Template with variable number of Graph Items. If the number is fixed, there's a way, of course.
Reinhard
ar1
Posts: 18
Joined: Mon Mar 13, 2006 4:33 pm
Location: Bloomington, IL

Post by ar1 »

You will have to perform kex exchange for this user. When using ssh for Script Queries, this is even needed for the httpd's user (when running Verbose Query or adding the Query for the first time)
This part is already done and working.
If you think about adding partitions to a single graph, this will result in a big problem, because the number of partitions will vary between target host's. And there is no such thing as a Graph Template with variable number of Graph Items. If the number is fixed, there's a way, of course.
Right, that's the problem. Well, I suppose I could make a graph template for 2 partitions and another for 3 partitions (since most of my servers have 2 or 3 partitions that need to be monitored). The question, Reinhard, is how to get the mount point name for each partition on the graphs. Without the device or mount point names, the graphs will obviously be useless. Now I can get the device/mount names using script queries, but can I get multiple lines in a graph usign script query (as opposed to script/command) ?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

ar1 wrote:The question, Reinhard, is how to get the mount point name for each partition on the graphs. Without the device or mount point names, the graphs will obviously be useless. Now I can get the device/mount names using script queries, but can I get multiple lines in a graph usign script query (as opposed to script/command) ?
Yep, this is possible. Even Script Queries do create a single set of rrd files for each index, not one big rra containg all data. From the Graph Template's point of view, these rrd's are independant, so you can combine them in one single Graph (please search for Overview Graphs and see http://forums.cacti.net/viewtopic.php?t=5703). Theh partition name should be handled as a <direction>input</direction> XML field, so you can display it in graphs as a text using |query_<field_name>| syntax. When combining partitions, this will not be used as a title, but perhaps with COMMENT statements
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests