#Transform output from 'df -k' into nsca format #F=filer name, R=return code, W=warn pct, C=crit pct BEGIN {OFS="\t";} #Get volume name A[3] {split($1,A,"/");} A[2]!="vol" {next;} A[4]==".snapshot" {next;} #Compute return code R {R=(int($5) > C) ? 2 : ((int($5) > W) ? 1 : 0);} #Print nsca line {print tolower(F),"DISK-" toupper(A[3]),R,$5 " used (" $3 " of " $2 " used)";}