Flow designer- how to calculate total disk space on a server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2021 01:24 AM
I am trying to figure out how I can create an action in flow designer that wil get me the total disk space on a server.
example:
The server has 3 disks that have different sizes (100, 200 and 300 Gb) that totales to 600 Gb.
I would like to sum these values when different servers have different number of disks?
When I get the total I can use this value further down my flow.
Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2021 01:13 AM
And if the number of disks varies, how do I get the actual number of disks in the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2021 09:47 AM
Discovery will populate the Disk Space variable on the 'computer' device with the available space. IF that doesn't work for you, a script running a sum query across all related disks would do the trick:
var totalDisk = new GlideQuery('cmdb_ci_disk')
.where('computer', {computer sys id})
.sum('size')
.orElse(0);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2021 11:12 PM
I know Discovery will get the answer, however I am aiming at using the SCCM 2012V2 integration, and that gives the challenge.
also SCCM integration gies disk space in Mb, Gb and Tb so that can be messy 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2021 12:13 AM
HI,
I dont think there is a need of scripted action for this, check the below it may help you.
I am choosing a config item first using - Look up record, and sending the record to "disk" table to check the no of disk associated.
then looping all the records found in the disk table to a for loop to update the description of main CI (I set up in the first step).
I used description field to update so used ParseInt and if it is someother field you can try without a parseint.
The only disadvantage of this in Paris is, it updates the record 3 times as there are 3 disks, but as you are in Quebec you can use the flow variables to overcome that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2021 04:38 AM
It looks like a viable solution but how will it cope with different size reporting (MB, GB and TB)?
Or does it just get the raw bytes and then a transformation is needed afterwards?