cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 10

Compare custom property to total capacity

This could be more generic across other modules, but I'm using it in SRM, hence putting it here.

I have added a custom property for each volume as a text string such as "500.00 GB" and am trying to compare it to volume's total capacity which if I look at the property also shows "500.00 GB". However, when I set an alert to check if two are equal, it doesn't trigger the alert even though they are equal.

Any ideas of how I can accomplish this?

0 Kudos
3 Replies

I „think“ the amount is stored in Bytes rather than GB. At least for NPM this is the case.
I also think you can’t compare a string value to an integer, that doesn’t make sense.
For an alert I usually use a custom SWQL Query as this gives me more flexibility in comparing values. E.g. I can use GB in the Custom property and just convert the value to Byte in my SWQL-Query
0 Kudos

That totally makes sense. I don't know why I lept thinking that it converts a total capacity value from integer to string, hence, I kept trying to compare what I thought was 2 strings. I see it now, though.

Now, I just need to figure out how to compare the 2 using SWQL query. @HerrDoktor , do you have an example for that?

0 Kudos

This is for the NPM/SAM Volume Alerts, it should be translateable to SRM somehow. I don't have many SRM Clients currently....

 

use an alert and alert on a Volume, the upper menu should populate automatically with the volume selection. In the lower selection something like this:

JOIN Orion.VolumesCustomProperties vcp ON v.VolumeID = vcp.VolumeID

JOIN Orion.Nodes nodes on v.NodeID = nodes.NodeID

JOIN Orion.NodesCustomProperties ncp on nodes.NodeID = ncp.NodeID

where v.VolumeSpaceAvailable >= vcp.YourCPNameforTheVolume

 

Your CP should now be in "bytes" if you want it in GB you can use methematical operations like vcp.YourCPNameforTheVolume*1024 etc.

0 Kudos