Hi folks, I am trying to do what seems to be a simple function but cannot find the right commands to do it.
I have looked through the forums for hours now for an answer, but there doesn’t seem to be anything.
I want to create a function that returns free disk space on windows servers, this is available as a predefined function however it gives a total for all disks, whereas I want to show each disk, however if you have servers with different disks, some with floppies some without, you can’t use straight SNMP OID’s. What I want to do is this, if you can help I would greatly appreciate it, plus I’m sure it’s something many people would use.
- Identify which OID index is for C:\
- Get OID for total storage for C:\ (index retrieved prior)
- Get OID for used space using index
- Calculate available space by using previous values
This is all simple except to try and find the index for the OID containing the string which has C:\ within it. I can only get the function to work if I put the entire string which is found in the OID value in the array find command, which is the disk letter, name, and serial number, but these will always be different, I want to be able to just specify the drive letter so I can create a generic function and probe that will work for any windows server, and just create one for C:, one for D:, one for E:\ etc etc.
So can anybody help with this ??
Also, surely there has to be some doco somewhere for functions, they are so powerful and useful it’s frustrating not being able to use them more for lack of knowledge on them.
Thanks
Paul