Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hrStorage Doesn't Work! Won't Change

0 views
Skip to first unread message

Kevin Vaughn

unread,
Oct 23, 2002, 1:37:12 PM10/23/02
to
Something is wrong with the hrStorage MIB in Windows 2000. The disk
counters never update unless the SNMP service is restarted. the object IDs
I'm trying to query are under 1.3.6.1.2.1.25.2.3.1.

I can reproduce the behavior on all of my Windows 2000 servers. I haven't
tried NT4 yet. Is this a bug, or is it something wrong on my end? If this
is a bug, then would you mind sharing with me how you gather logical disk
information for your Windows servers? I seem to be running out of obvious
options.

Below is the Perl script that is returning logical disk space in MB to MRTG.
I actually get values, but like I said, the values never change unless the
service is restarted. I would appreciate any help and/or other ideas on how
to get this information. Please don't leave me hanging if you know
something.

-Kevin

############################################################

# Begin Script

$ip = @ARGV[0];
$drive = uc(@ARGV[1]);
$community = "public";

if (length($ip) == 0 or length($drive) == 0) {
print "\nERROR: You must specify all required command-line
parameters.\n\n";
print "Usage: hddspace.pl ip drive_letter \n";
print "Example: hddspace.pl 10.5.1.4 c:\\\n";
exit
}

$n4 = 0;
$lastone = 0;

do {
$n4++;
$oid = ".1.3.6.1.2.1.25.2.3.1.1.$n4";
$snmpval = `snmputil get $ip $community $oid`;
$snmpval =~ s/\n//;
if ($snmpval =~ m/Error:/) {
$lastone = 1;
} # end if
} until $lastone;

$n4--;
$numdrives = $n4;
#print "there are $n4 devices on $ip\n";

$n4 = 0;
$lastone = 0;

do {
$n4++;
$oid = ".1.3.6.1.2.1.25.2.3.1.3.$n4";
$snmpval = `snmputil get $ip $community $oid`;
$snmpval =~ s/\n//;
if ($snmpval =~ m/= OCTET STRING/ or $snmpval =~ m/= String/) {
$snmpval =~ s/.*= String //;
$snmpval =~ s/.*- //;
$snmpval =~ s/ Label.*//;
$snmpval =~ s/\n//;
chomp $snmpval;
chomp $drive;
if ($snmpval eq $drive) {
$drivenum = $n4;
} # end if
} else {
if ($snmpval =~ m/Error:/) {
$lastone = 1;
} # end if
} # end if
} until $lastone;

$oid = ".1.3.6.1.2.1.25.2.3.1.4.$drivenum";
$snmpval = `snmputil get $ip $community $oid`;
$snmpval =~ s/\n//;
if ($snmpval =~ m/= INTEGER/ or $snmpval =~ m/= Integer32/) {
$snmpval =~ s/.*= Integer32 //;
$snmpval =~ s/.*- //;
$snmpval =~ s/\n//;
chomp $snmpval;
$allocunits = $snmpval
} else {
if ($snmpval =~ m/Error:/) {
$lastone = 1;
} # end if
} # end if

$oid = ".1.3.6.1.2.1.25.2.3.1.5.$drivenum";
$snmpval = `snmputil get $ip $community $oid`;
$snmpval =~ s/\n//;
if ($snmpval =~ m/= INTEGER/ or $snmpval =~ m/= Integer32/) {
$snmpval =~ s/.*= Integer32 //;
$snmpval =~ s/.*- //;
$snmpval =~ s/\n//;
chomp $snmpval;
$drivesize = $snmpval;
} else {
if ($snmpval =~ m/Error:/) {
$lastone = 1;
} # end if
} # end if

$oid = ".1.3.6.1.2.1.25.2.3.1.6.$drivenum";
$snmpval = `snmputil get $ip $community $oid`;
$snmpval =~ s/\n//;
if ($snmpval =~ m/= INTEGER/ or $snmpval =~ m/= Integer32/) {
$snmpval =~ s/.*= Integer32 //;
$snmpval =~ s/.*- //;
$snmpval =~ s/\n//;
chomp $snmpval;
$driveused = $snmpval;
} else {
if ($snmpval =~ m/Error:/) {
$lastone = 1;
} # end if
} # end if

#print "drivenum is $drivenum\n";
#print "allocunits is $allocunits\n";
#print "drivesize is $drivesize\n";
#print "driveused is $driveused\n";

$truesize = $allocunits * $drivesize;
$truesize = $truesize / 1024;
$truesize = $truesize / 1024;
$truesize = int($truesize + 0.5);

$trueused = $allocunits * $driveused;
$trueused = $trueused / 1024;
$trueused = $trueused / 1024;
$trueused = int($trueused + 0.5);

$truerem = $truesize - $trueused;

print "$truerem\n$truerem\n\n";

# End Script


Kevin Vaughn

unread,
Oct 23, 2002, 2:19:40 PM10/23/02
to
I moved this post to comp.dcom.net-management since that group is more
MRTG-centric. I'm not trying to cross-post.

Still, if you have any ideas I would like to hear from you.

- Kevin

"Kevin Vaughn" <bina...@mail.com> wrote in message
news:urdnh2h...@corp.supernews.com...

Frank Fock

unread,
Oct 23, 2002, 5:40:42 PM10/23/02
to
Kevin,

My Windows 2000 Pro System agent (SP2) is correctly reporting those
counters in the hrStorageTable. The counters are update nearly
in realtime.

I used my MIB Explorer, but I am sure MRGT is also not
the problem here. Did you check the counters with a MIB Browser?
May be its related with your configuration?

Regards,
Frank

Alan J. McFarlane

unread,
Oct 24, 2002, 8:26:34 AM10/24/02
to
"Kevin Vaughn" <bina...@mail.com> wrote in message
news:urdq0ln...@corp.supernews.com...

> I moved this post to comp.dcom.net-management since that group is more
> MRTG-centric. I'm not trying to cross-post.
>
> Still, if you have any ideas I would like to hear from you.
>
Well I'm not going to chase you across the net so I hope you are still
listening here...

You obviously aren't up to date with your patches (nor have done a search at
support.microsoft.com--its quite useful you know). The problem you report
is known and is fixed in SP3, see
<http://support.microsoft.com/default.aspx?scid=kb;en-us;Q295587>

Alan


Kevin Vaughn

unread,
Oct 24, 2002, 10:26:26 AM10/24/02
to
Hi Frank,

Thanks for responding. I have checked the counters with a MIB Browser. We
have Castlerock SNMPc, which does report the same values as my script. The
problem is definitely with the agent. I am in the process of upgrading one
of my servers to SP3, so I'll let you know if that fixes the problem.

-Kevin

"Frank Fock" <fo...@agentpp.com> wrote in message
news:3DB7175A...@agentpp.com...

Kevin Vaughn

unread,
Oct 24, 2002, 10:29:22 AM10/24/02
to
Alan,

I appreciate the time you've taken to respond to my post. I originally
checked Microsoft's site, but I guess I didn't go far enough with it. I am
currently in the process of upgrading one of my servers to SP3. I'll let
you know what happens. Anyway, I appreciate your help.

-Kevin

"Alan J. McFarlane" <alan...@yahoo.com> wrote in message
news:DPRt9.6888$Af5.2...@newsfep2-win.server.ntli.net...

davidmac

unread,
Oct 29, 2002, 2:35:29 PM10/29/02
to
After reading your post, I decided to check my numbers. I have
service pack 3 installed. And the numbers only seem to be updated
when the agent starts.

I am using MS agent for now. I will be switching to net-snmp in the
near future. I hope that corrects the problem.

davidmac

"Kevin Vaughn" <bina...@mail.com> wrote in message news:<urg0njr...@corp.supernews.com>...

davidmac

unread,
Oct 29, 2002, 2:43:48 PM10/29/02
to
OOPS! I did not have SP3 installed, I was thinking of another box.

"Kevin Vaughn" <bina...@mail.com> wrote in message news:<urg0njr...@corp.supernews.com>...

Kevin Vaughn

unread,
Nov 1, 2002, 12:10:25 PM11/1/02
to
Yeah, SP3 definitely fixes the problem. I've tried it on several different
servers now with perfect results.

-Kevin

"davidmac" <david.m...@mail.va.gov> wrote in message
news:6e439c43.02102...@posting.google.com...

0 new messages