Floppy being polled
Moderators: Developers, Moderators
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Yah, don't use Microsoft SNMP.....
Sorry, there is not a better answer.
Sorry, there is not a better answer.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
-
- Posts: 30
- Joined: Fri Apr 15, 2005 7:34 am
- Location: Canada
- TheWitness
- Developer
- Posts: 17061
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Net-SNMP. The Microsoft version is very very bad about polling drives.
TheWitness
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?
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?
-
- Posts: 30
- Joined: Fri Apr 15, 2005 7:34 am
- Location: Canada
If you already have to install software on your MS boxes you could use SNMP-Informant (http://www.snmp-informant.com/). The free version offers OIDs for memory, processor, logical disk, network interface.
Thomas Rupp
Percent HD Space as Datasource (for thresholds) and stuff
If anyone is interested, I have done a few things that have resolved this on my end, I also added a few extra things that are useful to me, maybe not so useful to others.
I modified "host_disk.xml" to add an Input for the "Total Size". I do this so cacti will now cache this. It rarely if ever changes, so I would rather not have to repull it from servers every polling. This saves me about 30 seconds each polling with the 80 win servers I poll. I also added an Output called "Percent", which I will explain later.
In "ss_host_disk.php" I modified the 'total' query to first check and see if we are already caching the total, and if so, then use it, otherwise walk it as normal. Then I have added the extra output for 'percent'. I re-get the 'used' (to be sure its accurate) and pull the total from the cache and one simple math function later I have a "% Used Space" which is outputted as a datasource (I'll explain why in a sec). Next I also happen to rewalk the "total" when I do the query so that I can leave out anything that doesn't have a toal size of over 100000 bytes, which means it leaves out the floppy, cd-rom, and the virtual memory from the "Create Graphs" screen, so a simple "Check All" does all the hard drives, without having to bother unchecking these misc devices. The floppy can't be polled if you can't create a graph for it.
I perfer a datasource instead of a CDEF for the Percent since I want to be able to set a Threshold on the Percent, instead of just using it to show it on the graph. I am sure there is a better way to do a few of these things, but this was easy enough for me. Let me know if there is anything you see a better way to do, or if you happen to like the changes I made.
I modified "host_disk.xml" to add an Input for the "Total Size". I do this so cacti will now cache this. It rarely if ever changes, so I would rather not have to repull it from servers every polling. This saves me about 30 seconds each polling with the 80 win servers I poll. I also added an Output called "Percent", which I will explain later.
Code: Select all
===================================================================
RCS file: /home/CVSROOT/cacti/resource/script_server/host_disk.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- host_disk.xml 2005/04/04 15:09:17 1.1
+++ host_disk.xml 2005/04/19 19:10:11 1.2
@@ -28,6 +28,11 @@
<direction>input</direction>
<query_name>sau</query_name>
</hrStorageAllocationUnits>
+ <hrStorageTotalCache>
+ <name>Total Size</name>
+ <direction>input</direction>
+ <query_name>total</query_name>
+ </hrStorageTotalCache>
<hrStorageSize>
<name>Total Size</name>
@@ -44,5 +49,10 @@
<direction>output</direction>
<query_name>failures</query_name>
</hrStorageAllocationFailures>
+ <hrStoragePercent>
+ <name>Percent Used</name>
+ <direction>output</direction>
+ <query_name>percent</query_name>
+ </hrStoragePercent>
</fields>
</interface>
I perfer a datasource instead of a CDEF for the Percent since I want to be able to set a Threshold on the Percent, instead of just using it to show it on the graph. I am sure there is a better way to do a few of these things, but this was easy enough for me. Let me know if there is anything you see a better way to do, or if you happen to like the changes I made.
Code: Select all
===================================================================
RCS file: /home/CVSROOT/cacti/scripts/ss_host_disk.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ss_host_disk.php 2005/04/04 15:09:19 1.1
+++ ss_host_disk.php 2005/04/19 19:07:58 1.2
@@ -26,29 +26,50 @@
if ((func_num_args() == "9") || (func_num_args() == "7") || (func_num_args() == "6") || (func_num_args() == "5")) {
if ($cmd == "index") {
$return_arr = ss_host_disk_reindex(cacti_snmp_walk($hostname, $snmp_community, $oids["index"], $snmp_version, "", "", $snmp_port, $snmp_timeout, SNMP_POLLER));
-
for ($i=0;($i<sizeof($return_arr));$i++) {
print $return_arr[$i] . \n;
}
}elseif ($cmd == query) {
$arg = $arg1;
-
$arr_index = ss_host_disk_reindex(cacti_snmp_walk($hostname, $snmp_community, $oids[index], $snmp_version, , , $snmp_port, $snmp_timeout, SNMP_POLLER));
$arr = ss_host_disk_reindex(cacti_snmp_walk($hostname, $snmp_community, $oids[$arg], $snmp_version, , , $snmp_port, $snmp_timeout, SNMP_POLLER));
+ $arr2 = ss_host_disk_reindex(cacti_snmp_walk($hostname, $snmp_community, $oids['total'], $snmp_version, , , $snmp_port, $snmp_timeout, SNMP_POLLER));
for ($i=0;($i<sizeof($arr_index));$i++) {
- print $arr_index[$i] . ! . $arr[$i] . \n;
+ if ($arr2[$i] > 100000)
+ print $arr_index[$i] . "!" . $arr[$i] . "\n";
}
}elseif ($cmd == "get") {
$arg = $arg1;
$index = $arg2;
- if (($arg == "total") || ($arg == "used")) {
+ if ($arg == "total") {
/* get hrStorageAllocationUnits from the snmp cache since it is faster */
$sau = eregi_replace("[^0-9]", "", db_fetch_cell("select field_value from host_snmp_cache where host_id=$host_id and field_name='hrStorageAllocationUnits' and snmp_index='$index'"));
+ $total = eregi_replace("[^0-9]", "", db_fetch_cell("select field_value from host_snmp_cache where host_id=$host_id and field_name='hrStorageTotalCache' and snmp_index='$index'"));
+ if ($total > 0)
+ return ($total * $sau);
+ return (cacti_snmp_get($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, "", "", $snmp_port, $snmp_timeout, SNMP_POLLER) * $sau);
+ } elseif ($arg == "used") {
+ /* get hrStorageAllocationUnits from the snmp cache since it is faster */
+ $sau = eregi_replace("[^0-9]", "", db_fetch_cell("select field_value from host_snmp_cache where host_id=$host_id and field_name='hrStorageAllocationUnits' and snmp_index='$index'"));
+ return (cacti_snmp_get($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, "", "", $snmp_port, $snmp_timeout, SNMP_POLLER) * $sau);
+ }elseif ($arg == "percent") {
+ $sau = eregi_replace("[^0-9]", "", db_fetch_cell("select field_value from host_snmp_cache where host_id=$host_id and field_name='hrStorageAllocationUnits' and snmp_index='$index'"));
+ $total = eregi_replace("[^0-9]", "", db_fetch_cell("select field_value from host_snmp_cache where host_id=$host_id and field_name='hrStorageTotalCache' and snmp_index='$index'"));
- return cacti_snmp_get($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, "", "", $snmp_port, $snmp_timeout, SNMP_POLLER) * $sau;
- }else{
+ if ($total > 0)
+ $total = $total * $sau;
+ else
+ $total = (cacti_snmp_get($hostname, $snmp_community, $oids['total'] . ".$index", $snmp_version, "", "", $snmp_port, $snmp_timeout, SNMP_POLLER) * $sau);
+
+ $used = (cacti_snmp_get($hostname, $snmp_community, $oids['used'] . ".$index", $snmp_version, "", "", $snmp_port, $snmp_timeout, SNMP_POLLER) * $sau);
+ if ($total > 0)
+ $percent = round(($used / $total) * 100,2);
+ else
+ $percent = 0;
+ return $percent;
+ } else {
return cacti_snmp_get($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, "", "", $snmp_port, $snmp_timeout, SNMP_POLLER);
}
}
-
- Cacti User
- Posts: 63
- Joined: Mon Jul 04, 2005 10:12 am
- Location: Brazil
I wrote graph templates for Windows XP/2K/2K3 memory and disk counters that don't poll the floppy drive. They are based on the free, rock-solid SNMP Informant.
I'm thinking of contributing this as a new host template, using some native Microsoft counters and some SNMP Informant counters. Anyone interested? Regards,
Georger
I'm thinking of contributing this as a new host template, using some native Microsoft counters and some SNMP Informant counters. Anyone interested? Regards,
Georger
Beaujolais wrote:Is there any solution to this a:\ problem yet?
Who is online
Users browsing this forum: No registered users and 3 guests