Trying to run the Linux Operating system perl script, and am getting the error: Illegal division by zero at DriveSpace.pl line 71
Can someone help?
Line 71 reads:
$free = ($total - $totalused) * 100 / $total;
Hello jclardy,
script gets data from machine using "snmpget" command. If there are no drive sizes returned by this command, variable "$total" value remains zero and then division fails. Also if some data are returned but they are in some unexpected format, value remains zero.
Try to run following command on target Linux computer:
snmpget -v1 -c $community $hostname HOST-RESOURCES-MIB::hrStorageSize.0
Replace $community with your community string and $hostname with hostname of target computer.
Does this command return anything?
Also try:
snmpwalk -v1 -c $community $hostname HOST-RESOURCES-MIB::hrStorageType
What does this command return?