Last active
December 18, 2015 10:49
-
-
Save almorel/5771742 to your computer and use it in GitHub Desktop.
Extraction des statistiques d'un serveur TORQUE/MAUI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extract des statistiques TORQUE | |
cat /opt/torque/serv_priv/accounting/2012*|awk -F ';' '{if ($2 ~ '/E'/){print $4}}'|awk '{for (i=1;i<NF;i++){if ($i ~ '/^Exit\|^resources\|^user\|^group\|^Resource\|^queue/'){printf("%s ", $i);}};print ""}'|python -c 'import sys;a=[elt.rstrip().split(" ") for elt in sys.stdin.readlines()]; b=[["".join(subelt.split("=")[1::]) for subelt in elt] for elt in a];c=[";".join(ligne) for ligne in b];print "\n".join(c);' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment