All DiskSpaces in one graph

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

User avatar
idg-PM
Posts: 13
Joined: Thu Apr 26, 2007 3:59 am
Location: Koeln, Germany

Re: XML.script how to ;)

Post by idg-PM »

[quote="gandalf"] Wenn ein Skript dabei ist, bitte nicht vergessen dieses in das ./scripts Verzeichnis zu kopieren
Reinhard[/quote]

in welches Scipt verzeichnis? script_server oder script_queries???

in which script folder? script_server or script_queries???

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

Post by gandalf »

The script folder exists only once, directly under cacti default folder. e.g. for RHEL /var/www/html/cact/scripts.
The other folders are at /var/www/html/cacti/resources/... and are not related (at least if your're not using a Data Query or a php script server script). In any case, the author should have included words on what to put where.
Reinhard
User avatar
idg-PM
Posts: 13
Joined: Thu Apr 26, 2007 3:59 am
Location: Koeln, Germany

Post by idg-PM »

[quote="gandalf"]The script folder exists only once, directly under cacti default folder. e.g. for RHEL /var/www/html/cact/scripts.
The other folders are at /var/www/html/cacti/resources/... and are not related (at least if your're not using a Data Query or a php script server script). In any case, the author should have included words on what to put where.
Reinhard[/quote]

We have this folders:

drwxr-xr-x 2 cacti cacti 144 2007-01-18 01:23 script_queries/
drwxr-xr-x 2 cacti cacti 112 2007-01-18 01:23 script_server/
drwxr-xr-x 2 cacti cacti 280 2007-05-22 18:31 snmp_queries/

Aren't this the default folders?

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

Post by gandalf »

The "default folder" is the one where e.g. poller.php lives in
Reinhard
Michael66
Posts: 4
Joined: Thu Aug 04, 2011 5:42 am

Re: All DiskSpaces in one graph

Post by Michael66 »

Hi @all,

I found this topic and I´ve a few questions, because no graph will be displayed:

Here´re my steps:
I only imported the xml-File named "cacti_graph_template_combined_used_disk_space_test.xml" via console -> Import Templates ... without any errors.

Then I went to "Devices" and create a graph for the device I want to monitor.
Next he wanted to know "Index Type, Index Value and Output Type ID" ???

I entered nothing (is this right?) and switch to Graphs to have a look at my newly created graph, but nothing will be displayed.

Where´s my mistake, and where I can enter the partitions I want to monitor?

Please can anyone tell me a detailed install- and configureguide for this?
Thanks in advance.
Greets from Germany,
Michael
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: All DiskSpaces in one graph

Post by noname »

How to use

1) Download and install this
- http://docs.cacti.net/usertemplate:data:host_mib:disk_usage

2) Create graphs with that data query ("SNMP - hrStorageTable")

Sample:
Image

3) Import mokeybrains' combined graph template, then combine existing graphs
- http://forums.cacti.net/viewtopic.php?p=99678#p99678
mokeybrains wrote: Import the XML file.
Click on
*Console
*Graph Management
*Add (upper right of screen)
*Pick Combined - Used Disk Space - 5 partitions
*Pick a host
*Click Create
*fill out all the partitions
Sample:
Image
Michael66
Posts: 4
Joined: Thu Aug 04, 2011 5:42 am

Re: All DiskSpaces in one graph

Post by Michael66 »

... I´m going mad …

I followed your steps:
First I downloaded Disk Space Usage from
http://docs.cacti.net/usertemplate:data ... disk_usage

then I followed steps 1-4 as described (untar, drop into snmp_queries, import xml via Import Feature and add to a device)
so long ... no error

Code: Select all

Cacti has imported the following items:
CDEF
[success] Host MIB - hrStorageTable Units [update]
GPRINT Preset
[success] Normal [update]
Data Input Method
[success] Get SNMP Data (Indexed) [update]
Data Template
[success] Host MIB - hrStorageTable [update]
Graph Template
[success] Host MIB - hrStorageTable [new]
Data Query
[success] SNMP - hrStorageTable [new]
after the import I took a look at
-> Data Template and found "Host MIB - hrStorageTable"
-> Graph Template ... found "Host MIB - hrStorageTable"
-> Data Query ... found "SNMP - hrStorageTable"
-> Data Input Methods but found no "Get SNMP Data"

And when I want to create the graph, I only got error
This data query returned 0 rows, perhaps there was a problem executing this query.
I ran it in debug mode and the output was:

+ Running data query [12].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/hrStorageTable.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.25.2.3.1.1'
+ No SNMP data returned
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/hrStorageTable.xml'
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/hrStorageTable.xml'
+ Found data query XML file at '/srv/www/htdocs/cacti/resource/snmp_queries/hrStorageTable.xml'

Whats wrong here, why he said, that no SNMP Data returned??
When I run for example at the console:
snmpwalk -Os -c public -v 2c localhost system
then I get a result.

Perhaps you´ve an idea again?
If you need further information, please let me know.
Kind regards,
Michael
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: All DiskSpaces in one graph

Post by noname »

>> -> Data Input Methods but found no "Get SNMP Data"

It's no need to care.
Michael66 wrote: And when I want to create the graph, I only got error
This data query returned 0 rows, perhaps there was a problem executing this query.
I ran it in debug mode and the output was:

...
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.25.2.3.1.1'
+ No SNMP data returned
...

Whats wrong here, why he said, that no SNMP Data returned??
When I run for example at the console:
snmpwalk -Os -c public -v 2c localhost system
then I get a result.
Try snmpwalk to ".1.3.6.1.2.1.25.2.3.1.1" (or upper OID: ".1.3.6.1.2.1.25.2.3.1") instead of "system".
If SNMP agent on your target host doesn't support HOST-RESOURCES-MIB::hrStorageTable, you can't use this template.
Michael66
Posts: 4
Joined: Thu Aug 04, 2011 5:42 am

Re: All DiskSpaces in one graph

Post by Michael66 »

so when I try
snmpwalk -Os -c public -v 2c localhost .1.3.6.1.2.1.25.2.3.1
then I get answer

Code: Select all

hrStorageIndex.1 = INTEGER: 1
hrStorageIndex.2 = INTEGER: 2
hrStorageIndex.3 = INTEGER: 3
hrStorageIndex.4 = INTEGER: 4
hrStorageIndex.5 = INTEGER: 5
hrStorageIndex.6 = INTEGER: 6
hrStorageIndex.7 = INTEGER: 7
hrStorageType.1 = OID: hrStorageOther
hrStorageType.2 = OID: hrStorageRam
hrStorageType.3 = OID: hrStorageVirtualMemory
hrStorageType.4 = OID: hrStorageFixedDisk
hrStorageType.5 = OID: hrStorageFixedDisk
hrStorageType.6 = OID: hrStorageFixedDisk
hrStorageType.7 = OID: hrStorageFixedDisk
hrStorageDescr.1 = STRING: Memory Buffers
hrStorageDescr.2 = STRING: Real Memory
hrStorageDescr.3 = STRING: Swap Space
hrStorageDescr.4 = STRING: /
hrStorageDescr.5 = STRING: /sys
hrStorageDescr.6 = STRING: /sys/kernel/debug
hrStorageDescr.7 = STRING: /var
hrStorageAllocationUnits.1 = INTEGER: 1024 Bytes
hrStorageAllocationUnits.2 = INTEGER: 1024 Bytes
hrStorageAllocationUnits.3 = INTEGER: 1024 Bytes
hrStorageAllocationUnits.4 = INTEGER: 4096 Bytes
hrStorageAllocationUnits.5 = INTEGER: 4096 Bytes
hrStorageAllocationUnits.6 = INTEGER: 4096 Bytes
hrStorageAllocationUnits.7 = INTEGER: 4096 Bytes
hrStorageSize.1 = INTEGER: 256608
hrStorageSize.2 = INTEGER: 256608
hrStorageSize.3 = INTEGER: 771080
hrStorageSize.4 = INTEGER: 774823
hrStorageSize.5 = INTEGER: 0
hrStorageSize.6 = INTEGER: 0
hrStorageSize.7 = INTEGER: 1549609
hrStorageUsed.1 = INTEGER: 42192
hrStorageUsed.2 = INTEGER: 247752
hrStorageUsed.3 = INTEGER: 84
hrStorageUsed.4 = INTEGER: 716784
hrStorageUsed.5 = INTEGER: 0
hrStorageUsed.6 = INTEGER: 0
hrStorageUsed.7 = INTEGER: 72232
Please can you say again something to how I have to create the graphs with that Data Query?
Thanks in advance.
Regards,
Michael
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: All DiskSpaces in one graph

Post by noname »

Hmm, that result looks like fine..

Is there something to prevent poller user from accessing these SNMP OIDs?
e.g.) Did you restrict access rights to particular user in your snmpd.conf?

For example, if your poller is "cactiuser", please check like this:
# su - cactiuser -c '/path/to/snmpwalk -v1 -c public localhost .1.3.6.1.2.1.25.2.3.1'
Michael66
Posts: 4
Joined: Thu Aug 04, 2011 5:42 am

Re: All DiskSpaces in one graph

Post by Michael66 »

... I get the same answer as I do it with root-user ...

I think there´s something wrong with the graphs, thats why I asked about how to create the graphs ...
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: All DiskSpaces in one graph

Post by noname »

But your Cacti can't get information properly..
Other graphs using SNMP query (e.g. "SNMP - Interface Statistics") are working for localhost?
canislupus59
Posts: 14
Joined: Mon Jul 18, 2011 8:55 am

Re: All DiskSpaces in one graph

Post by canislupus59 »

I have tried to import the mokeybrains xml, but i have strange values reported in the related graph.
As you can see from the screenshot provided, i have 2 Gbit used on / partition (3 Gbit is the total space), but in the combined graph i can read under the Capacity: "712.94 k".
How i can solve this issue ? And if i want to combine more than 5 partition ? How i can do it ? (it's a stupid question i know...)
Thanks to all for your precious support.
Attachments
Disk_Usage.PNG
Disk_Usage.PNG (14.4 KiB) Viewed 3719 times
Combined_disk_used.PNG
Combined_disk_used.PNG (16.47 KiB) Viewed 3719 times
canislupus59
Posts: 14
Joined: Mon Jul 18, 2011 8:55 am

Re: All DiskSpaces in one graph

Post by canislupus59 »

Please anyone can help me ? :( :( :(
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: All DiskSpaces in one graph

Post by noname »

canislupus59 wrote:I have tried to import the mokeybrains xml, but i have strange values reported in the related graph.
As you can see from the screenshot provided, i have 2 Gbit used on / partition (3 Gbit is the total space), but in the combined graph i can read under the Capacity: "712.94 k".
Ah, indeed.
"HOST-RESOURCES-MIB::hrStorageTable" returns its disk size (used and total) in "blocks",
so actual size should be calculated by multiplying blocksize.

gandalf's 'disk_usage' template fulfills it by using CDEF "Host MIB - hrStorageTable Units".

Code: Select all

cdef=CURRENT_DATA_SOURCE,|query_hrStorageAllocationUnits|,*
Try this graph template: Import Results
Image
After imported, simply change graph template of existing graph. (or create new graph by the same way as original)

Comparison between original and this one
Image
NOTICE: On this server, blocksize of /tmp is 4096 bytes, others are 1024 bytes.

When performed 'df' on the server..

Code: Select all

% df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/dsk/c1d0s0         370135    315876     17246  95% /
/dev/dsk/c1d0s3       30258542   6826888  23129069  23% /usr
/dev/dsk/c1d0s4       30258542   2041661  27914296   7% /var
swap                   1861768     15976   1845792   1% /tmp
/dev/dsk/c1d0s6       30258542   1502785  28453172   6% /opt
... Somehow several partitions (/ and /opt) look like different from the above graph, but I don't care with details. 8)
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests