Skip to content

Commit

Permalink
Added version option.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrogaski committed Nov 3, 2015
1 parent add52f1 commit 6eda98e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@ the monitor.
## Usage

```
usage: check_minecraft [-h] [-v] -H HOST [-p PORT] [-w RANGE] [-c RANGE]
usage: check_minecraft [-h] [-V] -H HOST [-p PORT] [-v] [-w RANGE] [-c RANGE]
check_minecraft: A plugin for monitoring a Minecraft server running version
1.7 or 1.8.
check_minecraft: A plugin for monitoring a Minecraft server running version 1.7 or 1.8.
optional arguments:
-h, --help show this help message and exit
-v, --verbose
-V, --version show program's version number and exit
-H HOST, --host HOST hostname or IP address of the server
-p PORT, --port PORT TCP port number of the server
-v, --verbose
-w RANGE, --warning RANGE
return warning if RTD is outside RANGE
-c RANGE, --critical RANGE
return critical if RTD is outside RANGE
```


Expand Down
4 changes: 3 additions & 1 deletion check_minecraft
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,13 @@ class MCServer(nagiosplugin.Resource):
#@nagiosplugin.guarded
def main():
argp = argparse.ArgumentParser(description=__doc__)
argp.add_argument('-v', '--verbose', action='count', default=0)
argp.add_argument('-V', '--version', action='version',
version='%(prog)s ' + __version__)
argp.add_argument('-H', '--host', metavar='HOST', required=True,
help='hostname or IP address of the server')
argp.add_argument('-p', '--port', metavar='PORT', default=25565,
help='TCP port number of the server')
argp.add_argument('-v', '--verbose', action='count', default=0)
argp.add_argument('-w', '--warning', metavar='RANGE', default='120',
help='return warning if RTD is outside RANGE')
argp.add_argument('-c', '--critical', metavar='RANGE', default='300',
Expand Down

0 comments on commit 6eda98e

Please sign in to comment.