Modifying the SI-NetworkUsageAndPerformance policy to filter by interface
While the Network Usage policy allows to override thresholds using the parameter names from the policy, same as you would do in the DiskCapacity monitor.
Unlike the later, the perl script in the NetworkUsage policy doesn't care about thresholds for specific instances, so something like this:
;XPL config [eaagt] NICByteRateMajorThreshold=80000,eth0=100000
Wouldn't work. The policy would read the "80000" default threshold, but not the threshold for eth0.
I'm trying to adapt part of the script in the DiskCapacity policy to compare specific thresholds against NicNames, which doesn't seem to be all than complicated wasn't it because I got stuck at an unexpected point.
In order to evaluate the overriding thresholds you'd first read the value of the parameter like this:
my $NICByteRateMajorThreshold = $Session->Value("NICByteRateMajorThreshold");
Which would read the value of NICByteRateMajorThreshold as specified by the Node Info policy. You could then split the string and go shifting through each of the thresholds in an array (if there was any).
The problem is, while that works for the DiskCapacity policy, in the NetworkUsage perl I'm not getting the whole string from $Session->Value("NICByteRateMajorThreshold"), only the first bit (default value).
Am I missing something? Is there any reason why I wouldn't get the same value for NICByteRateMajorThreshold that you can see in ovconfget?