GithubHelp home page GithubHelp logo

aamarques / torqueacct Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 26 KB

Parses the Torque accounting files to extract some importants fields.

License: GNU General Public License v3.0

Python 100.00%

torqueacct's Introduction

torqueacct

Parses the Torque accounting files to extract some importants fields.

Use as default directory, /var/spool/torque/server_priv/account, for accounting files.

This can be changed in code.

For my use, I put an argument ("-n or --cluster") to change a little the directory of accounting files. That is because I have many clusters to manage and put all accounting logs into /var/spool/torque/<name_cluster>/accounting.

If you want to use it, fell free to change.

Parses the Torque accounting files to extract some importants fields.

usage: torqueacct.py [-h] [-l FILENAME] [-j JOBID] [-u USERNAME] [-q QUEUE]
                     [-n CLUSTER] [-d] [-t] [-f | -c] [-v]

optional arguments:
  -h, --help            show this help message and exit
  -l FILENAME, --log FILENAME
                         The input log file to be parsed. REQUIRED
  -j JOBID, --job JOBID
                          Search for a specific JobID
  -u USERNAME, --user USERNAME
                        Search for a specific username
  -q QUEUE, --queue QUEUE
                        Search for queue name
  -n CLUSTER, --cluster CLUSTER
                        Name of the cluster 
  -d, --del             Shows the Deleted results
  -t, --segs            Shows time fields in seconds
  -f, --csv             Shows the output results in a CSV format. DO NOT USE
                        with --count
  -c, --count           Shows only the Total count of results. DO NOT USE with
                        --csv
  -v, -V, --version     show program's version number and exit

Here are some examples of filename use


torqueacct.py -l 20170401            -> This will parse this date
torqueacct.py -l "201704*"           -> This will parse all accounting files starting with 201704*. 
torqueacct.py -l "2017*"             -> This will parse all accounting files starting with 2017*
torqueacct.py -l 20170401 --csv      -> This will parse this date and output in CSV format
torqueacct.py -l 20170401 -d --csv   -> This will parse this date, only for deleted jobs and output in CSV format

Note: When you are using wildcard, you must put it between quotation marks ("") because unix shell expand it before to pass it to program.

You can mixe up all parameters to extract information you need

Attention:

The default directory is /var/spool/torque/server_priv/accounting

The option '-n or --cluster' is used to parse the log file in other directory where I put log files from many clusters.

In my case, /var/spool/torque//accounting

Maybe you will need to change this.

torqueacct's People

Contributors

aamarques avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.