I did some work on my test system in regards to thresholds as I've had a similar internal request for a while so can put it to use on our own system at some point.
For your Volume Space Used (%) DCI (on the instance DCI in your template), add a script threshold as follows (Value for script thresholds need to be "1"):
That'll be for your "Warning" Threshold.
Create two more, one using fileSystem_Error and one using fileSystem_Critical instead of fileSystem_Warning. Those will be your Error and Critical thresholds, assign events as required.
This will allow you to use the following "Persistent Storage" variables (which you must create first):
You can override them in three ways:
Mix and match as required.
Priority in thresholds is as follows:
As always, there may be easier/faster/better/more efficient ways of doing this.
The above worked on my test system (I was testing with Linux, i.e. /, /var and similar instances, but should work with P:, C:, etc. as well) and should get you started.
If nothing else, it might serve as an example of Persistent Storage & Custom Attribute usage.
Note: What the above will not do is include the actual disk space usage value in the alert message.
For your Volume Space Used (%) DCI (on the instance DCI in your template), add a script threshold as follows (Value for script thresholds need to be "1"):
Code Select
if ( GetCustomAttribute($node,"fileSystem_Warning_".$dci->instance) != NULL ) { threshold = GetCustomAttribute($node,"fileSystem_Warning_".$dci->instance); }
else if ( GetCustomAttribute($node,"fileSystem_Warning") != NULL ) { threshold = GetCustomAttribute($node,"fileSystem_Warning"); }
else if ( ReadPersistentStorage("fileSystem_Warning_".$dci->instance) != "" ) { threshold = ReadPersistentStorage("fileSystem_Warning_".$dci->instance); }
else { threshold = ReadPersistentStorage("fileSystem_Warning"); }
if ( ( threshold == null ) || ( threshold == "" ) ) { return null; }
if ( $1 >= threshold ) return 1;
else return 0;That'll be for your "Warning" Threshold.
Create two more, one using fileSystem_Error and one using fileSystem_Critical instead of fileSystem_Warning. Those will be your Error and Critical thresholds, assign events as required.
This will allow you to use the following "Persistent Storage" variables (which you must create first):
- fileSystem_Critical
- fileSystem_Error
- fileSystem_Warning
You can override them in three ways:
- A global override for a specific file system, i.e. a Persistent Storage variable called "fileSystem_Critical_P:" with a value of 98 will mean any file system with instance "P:" will trigger a critical threshold at 98 or higher.
- A per-node override. This overrides all global thresholds and will be the new default for this node for all file systems. Simply create a "fileSystem_Critical" (or _Error or _Warning) Custom Attribute on the node and set it to the required value.
- A per-node, per-file system override. Same as with the global override for a file system, but create this as a custom attribute as opposed to a Persistent Storage variable. For example creating a "fileSystem_Critical_P:" custom attribute with a value of 50 will trigger the critical threshold for file system P: on this particular node.
Mix and match as required.
Priority in thresholds is as follows:
- Per-Node & Per-FileSystem Override
- Per-Node Override
- Global Per-FileSystem Override
- Global Default
As always, there may be easier/faster/better/more efficient ways of doing this.
The above worked on my test system (I was testing with Linux, i.e. /, /var and similar instances, but should work with P:, C:, etc. as well) and should get you started.
If nothing else, it might serve as an example of Persistent Storage & Custom Attribute usage.

Note: What the above will not do is include the actual disk space usage value in the alert message.