THOLD - Disk Percentage calculations

Support questions about the Threshold plugin

Moderators: Developers, Moderators

redawg
Posts: 6
Joined: Sun Mar 30, 2008 10:58 pm

THOLD - Disk Percentage calculations

Post by redawg »

Alright,

I have been struggling with this for awhile now, the CDEF fix works some of the time. but if you calc alot of they are very inconsistent..

So I took a patch from a couple people finagled around and edited it and have it working consistently.

Here are my files, working with cacti 8.7b

Remember to recreate the datasources for disk space on all your current hosts that use this,
Most importantly, this includes re-querying the "Associated Data Query" for the device!

After you install these files you will see this in you cacti.log


/09/2008 01:44:18 PM - CMDPHP: Poller[0] Host[6] DS[585] SERVER: /usr/local/cacti/scripts/ss_host_disk.php ss_host_disk 127.0.0.1 6 1:161:500:XXXXXXXXX:::MD5::DES: get total 4, output: 18656718848

07/09/2008 01:44:18 PM - CMDPHP: Poller[0] Host[6] DS[585] SERVER: /usr/local/cacti/scripts/ss_host_disk.php ss_host_disk 127.0.0.1 6 1:161:500:XXXXXXXXX:::MD5::DES: get used 4, output: 2781540352

07/09/2008 01:44:18 PM - CMDPHP: Poller[0] Host[6] DS[585] SERVER: /usr/local/cacti/scripts/ss_host_disk.php ss_host_disk 127.0.0.1 6 1:161:500:XXXXXXXXX:::MD5::DES: get percent 4, output: 14.91






quote]Cacti Version - 0.8.7b
Plugin Architecture - 2.1
Poller Type - CMD.php
Server Info - Linux 2.6.18-53.1.21.el5
Web Server - Apache/2.2.3 (CentOS)
PHP - 5.1.6
PHP Extensions - libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, standard, SimpleXML, sockets, SPL, shmop, session, Reflection, pspell, posix, mime_magic, iconv, hash, gmp, gettext, ftp, exif, date, curl, ctype, calendar, bz2, zlib, pcre, openssl, apache2handler, mysql, mysqli, PDO, pdo_mysql, pdo_sqlite, snmp
MySQL - 5.0.22
RRDTool - 1.2.23
SNMP - 5.3.1
Plugins
  • Change password (passwd - v0.1)
    Global Plugin Settings (settings - v0.5)
    Documents (docs - v0.1)
    Update Checker (update - v0.4)
    Network Tools (tools - v0.3)
    Host Info (hostinfo - v0.2)
    Status: Read-only Devices Tab (status - v0.1)
    Cycle Graphs (Cycle Graphs - v0.5)
    NTop Viewer (ntop - v0.1)
    Thresholds (thold - v0.3.9)
    Device Monitoring (monitor - v0.8.2)
    Uptime (uptime - v0.3)
    Cacti-ReportIt (reportit - v0.6.1)
[/quote]


Here are the files in the zip with readme as to where they go. Hope it helps trying the other way was annoying the crap out of me.
Attachments
HOST MIB-Working percentage.rar
Unzip and move to correct locations in the Readme files
(5.34 KiB) Downloaded 1155 times
jrego
Posts: 44
Joined: Mon Jul 14, 2008 9:55 am

Post by jrego »

Thanks for the files.

when you say import this file using the cacti interface? You mean the website right? also where in the website?

thanks.
jrego
Posts: 44
Joined: Mon Jul 14, 2008 9:55 am

Post by jrego »

and then what after i do that? do i need to make any additional changes? or will there be an option now for %?

thanks for your help.
umarzuki
Posts: 8
Joined: Tue Jul 22, 2008 10:46 pm
Contact:

Post by umarzuki »

jrego wrote:Thanks for the files.

when you say import this file using the cacti interface? You mean the website right? also where in the website?

thanks.
import cacti_graph_template_host_mib_available_disk_space.xml as template:
Console > Import Templates
jewnlie
Posts: 1
Joined: Fri Aug 01, 2008 1:15 am

how to intall this package

Post by jewnlie »

Hrrr....
with this package
I should add a new Data Input methods,but
how should i write input string
php <path_cacti>/scripts/ss_host_disk.php doesn't work

any one show me step by step
thanks a lot

# snmpwalk -c public -v 1 localhost .1.3.6.1.2.1.25.2.3.1.5
HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 3632116
HOST-RESOURCES-MIB::hrStorageSize.3 = INTEGER: 5663724
HOST-RESOURCES-MIB::hrStorageSize.6 = INTEGER: 215428
HOST-RESOURCES-MIB::hrStorageSize.7 = INTEGER: 961856
HOST-RESOURCES-MIB::hrStorageSize.8 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageSize.10 = INTEGER: 2031608
HOST-RESOURCES-MIB::hrStorageSize.31 = INTEGER: 8094174
HOST-RESOURCES-MIB::hrStorageSize.32 = INTEGER: 101086
gsaray101
Cacti User
Posts: 233
Joined: Thu May 17, 2007 9:18 am

reporting disk space as percent

Post by gsaray101 »

I have cacti verstion 0.8.7a and your graph template does not work on that. I created a graph template with disk but I dont see any percentage values. Are you doing anything different on this graph template? Can you please explain
juge
Posts: 4
Joined: Tue Aug 12, 2008 3:07 am

Post by juge »

It works perfectly for me on 0.8.7b.

thank redawg !
stephan_r
Posts: 5
Joined: Fri Aug 22, 2008 1:21 am

Post by stephan_r »

Hi,

i don´t get the percentage displayed so far. Maybe first of all my system configuration:

Fedora 8

Apache/2.2.6
mySQL 5.0.45
PHP 5.2.6

Cacti 0.8.7b
Plugin Architecture 2.1
Settings 0.5
Thold 0.3.8

First of all i imported the template. After that i copied the two .xml files and overwrote the existing files. Then i added a new device (Windows XP SP2) and created a graph to display the disk usage. The max capacity and the used space are displayed correctly, but the percentage is only displayed as "nan".
In the readme file it is said to "recreate the database" and to "requerying the associated data query". How can i do this, or is it not important, because i added the new device after the modification?
I don´t realy know where to search for a mistake. Maybe somebody here has an idea.

bye
redawg
Posts: 6
Joined: Sun Mar 30, 2008 10:58 pm

Post by redawg »

Re query the associated data source.. What I am refering to is going into the device and clicking on the circle to refresh the snmp data for disk space. if you want the source it will say

SNMP - Get Mounted Partitions (Verbose Query) Uptime Goes Backwards Success [32 Items, 8 Rows] Reload Data Query

if successful your items should be 3 time the amount of rows, previously it was 2 x the amount of rows because it was only doing max and used value.
kroyer22
Posts: 4
Joined: Thu Sep 11, 2008 10:13 am

Post by kroyer22 »

I installed the Patch, Deleted all Graphs and re queried the data source. When I recreate a new graph I get NAN or 0% for the percent. Any thoughts?
atanasio
Posts: 4
Joined: Tue Mar 18, 2008 2:07 pm

Post by atanasio »

kroyer22 wrote:I installed the Patch, Deleted all Graphs and re queried the data source. When I recreate a new graph I get NAN or 0% for the percent. Any thoughts?
Same problem with me.

Cacti 0.8.7b
Plugin Architecture 2.1
Debian Etch

Thanks anyway.
mlum
Posts: 19
Joined: Mon Oct 20, 2008 5:20 am
Location: uk

Post by mlum »

Same problem for me. Tried all the steps above a few times but still 0 showing.

I'm assuming the percent figure is calculated in the amended ss_host_disk.php file? I wonder if it something to with the if statement order?

Anyone know PHP?
mlum
Posts: 19
Joined: Mon Oct 20, 2008 5:20 am
Location: uk

Post by mlum »

11/14/2008 03:35:04 PM - CMDPHP: Poller[0] Host[10] DS[42] SERVER: /usr/share/cacti/site/scripts/ss_host_disk.php ss_host_disk 172.16.212.18 10 2:161:500:public:::MD5::DES: get total 2, output: 6432133120
11/14/2008 03:35:04 PM - CMDPHP: Poller[0] Host[10] DS[42] SERVER: /usr/share/cacti/site/scripts/ss_host_disk.php ss_host_disk 172.16.212.18 10 2:161:500:public:::MD5::DES: get used 2, output: 5955248128

Not receiving the third "get percent" entry. hmmm. will keep looking.
caoboth
Posts: 8
Joined: Fri Sep 09, 2005 2:59 am

Post by caoboth »

I had the same issue however ive since resovled it, check the graph templates have imported correctly, as i noticed that they dont create the extra hdd_percentage variable, (this is in the Host MID available disk space) trace this back through the data sources and make sure that SNMP - Get Mounted Partitions also have the hdd_percentage variable.

Cheers

Andy
P.s this was on 0.8.7b on sles 10 sp1
gheppner
Posts: 20
Joined: Thu Dec 04, 2008 5:10 pm

Post by gheppner »

Same issue - FIXED . Here's how:

Go to Data Queries --> ucd 10fs --> "Available Disk Space" link (under Associated Graph Templates)

You'll notice that Data Source: hdd_percent is set to hrStorageSize (Total Size). Use the drop down to select hrStoragePercent (Percentage Used). That fixed it for me.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests