Quote from: rainerh on January 09, 2025, 05:57:21 PMconsole output:looks like awk part did not work at all. How is it specified in agent config file, could be some issue with quotes.
root@pve110:~# zpool status rpool | grep -E "raid|mirror" | awk '{print $2}'
ONLINE
root@pve110:~# zpool status datastore01 | grep -E "raid|mirror" | awk '{print $2}'
ONLINE
NetXMS output:
zpoolStateRAID(datastore01) = raidz2-0 ONLINE 0 0 0
zpoolStateRAID(rpool) = mirror-0 ONLINE 0 0 0
You can also do something like this:
Code Select
zpool status datastore01 | grep -E "raid|mirror" | tr -s " " | cut -d" " -f 4Another option is to have all the command in a separate .sh file and just call that. For zpool_influxdb, may be adding --no-histogram will print less lines. Also looks cumbersome to parse, you can try something like this:
Code Select
zpool_influxdb | "vdev=root/raidz-0\ " | cut -d',' -f 3 | cut -d'=' -f 2If you can extract names of HDDs from it's output, you can use that as external list (https://netxms.org/documentation/adminguide/agent-management.html#externallist) - this way you could create DCIs automatically for HDDs.