I'm writing a script which utilises the salt-cli (SaltStack) as well as generic command line arguments to produce a simple HTML-based table outlining all of our servers' Hardware specs and software versions.
It's as simple as it sounds, however my only challenge is stripping my commands outputs so that they can be presented nicely in a table (e.g. one word/number rather than the whole output).
My latest challenge that I'm yet to strip effectively is the output of a simple 'df -Ph. So far I have got it down to this:
'df -Ph /'
My output:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vhfhuffu 50G 8.0G 39G 18% /
I would like it to only show the available for each server, I can't find a reliable way to do this for ever Unix server.