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
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...
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
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
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...
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...
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>...
"Kevin Vaughn" <bina...@mail.com> wrote in message news:<urg0njr...@corp.supernews.com>...
-Kevin
"davidmac" <david.m...@mail.va.gov> wrote in message
news:6e439c43.02102...@posting.google.com...