diff --git a/LICENCE b/LICENCE index 6e94f52..0c8b333 100644 --- a/LICENCE +++ b/LICENCE @@ -1,4 +1,4 @@ -Copyright (c) 2015, Vihar M +Copyright (c) 2015~18, Viharm All rights reserved. diff --git a/README.md b/README.md index 5276df5..acbfb1e 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,161 @@ # HDDtempNC -[![Version][mg_BadgeVersion]][ln_ReleaseLatest] -[![Issues][mg_BadgeIssues]][ln_Issues] +| | | +|:----------|:----------------------------------------------------| +| Version | 1.3.0 | +| Changes | https://github.com/viharm/HDDtempNC/pull/4/commits | +| Download | https://github.com/viharm/HDDtempNC/releases | +| Issues | https://github.com/viharm/HDDtempNC/issues | +| License | Modified BSD (3-clause) | +| Language | [Python](https://www.python.org) | -[![Language][mg_BadgeCodeLang]][ln_CodeLang] -[![License][mg_BadgeLicense]][ln_License] *HDDtempNC* is a tool to acquire hard disk drive temperature from *hddtemp*'s network interface. It is *Python* script and requires a working *Python* environment. It depends a configured and working *hddtemp* daemon on the system whose HDD temperatures are required. +## Install + + +### Pre-requisites + +* Python 2.x or 3.x +* Working instance of *HDDtemp* running in daemon mode and listening on a TCP port (*HDDtemp* need not be running on the same host as the one running *HDDtempNC*, however must be reachable via TCP port) + + +## Download + + +### Package + +Get the package from the download linked above. + + +### Git clone + +Clone repository. + +``` +git clone --recurse-submodules \ +https://github.com/viharm/phpAria2rpc.git +``` + +Remember to clone recursively (`--recurse-submodules`) to ensure cloning the submodules. + + +### PyPI + +From version v1.3.0 onwards, *HDDtempNC* is available on *[PyPI](https://pypi.org/)* and can be installed with *pip* (or *pip3*) + + +### Deploy + +Save the downloaded directory structure in your choice of path within your application (plugins, includes, etc.) + + ## Usage ## + *HDDtempNC* can be used either from the command line or by calling it in another script/program ### Command syntax ### + +The command syntax using long semantic arguments is as follows + +``` +hddtempnc.py --disk=/dev/ [ --target= ] [ --port= ] [ --debug ] [ --help ] +``` + +The command syntax using short *POSIX*-style arguments is as follows + ``` -hddtempnc.py --param1=value1 [ --param2=value2 [ --param3 ] ] +hddtempnc.py -d /dev/ [ -t ] [ -p ] [ -g ] [ -h ] ``` Following parameters are available: -* `-d (--disk=)` +| Argument | Alternative argument | Description | Optional | Default | +| --------------------- | --------------------------------- | -------------------------------------------------------------- |:--------:|:-----------:| +| `-g` | `--debug` |Debug to console/stdout | Yes | None | +| `-t 192.168.0.30` | `--target=server.local` |Specify target host (IP address or resolvable host name) | Yes | `localhost` | +| `-p 3378` | `--port=3698` |Specify target host's port | Yes | `7634` | +| `-d /dev/sda` | `--disk=/dev/sda` |Specify disk to interrogate (full device path) | No | None | +| `-h` | `--help` |Show help | Yes | None | - Specify disk to interrogate (full device path, e.g. /dev/sda) - -* `-t (--target=)` - Specify target host to interrogate (optional, default localhost) - -* `-p (--port=)` - Specify target port to interrogate (optional, default 7634) - -* `-g (--debug)` +#### Options - Enable debugging to console/stdout - -* `-h (--help)` +The above command options are explained below. The sequence of parameters is not important. + + +##### Disk + +`-d (--disk=)` + +Specify disk to interrogate by providing full path to the block device + +Example: `/dev/sda` + +Optional: No + +Default value: None + + +##### Host + +`-t (--target=)` + +Specify target host to interrogate. *HDDtemp* must be running on this host (in daemon mode) and listening on a TCP port. + +Examples: `192.168.0.30`, `server.local`, `server.domain.tld` + +Optional: Yes - Show help +Default value: `localhost` + + +##### Port -The sequence of parameters is not important. +`-p (--port=)` + +Specify target port to interrogate. *HDDtemp* must be listening on this port. + +Optional: Yes + +Default value: `7634` + + +##### Debug + +`-g (--debug)` + +Enable debugging to console/stdout + +Optional: Yes + +Default value: None + + +##### Runtime help + +`-h (--help)` + +Show help and exit. + +Optional: Yes + +Default value: None ### Examples ### + Command examples #### Long parameters #### + ``` /usr/bin/python3 hddtempnc.py --disk=/dev/sda` /usr/bin/python3 hddtempnc.py --target=192.168.0.20 --disk=/dev/sdb @@ -59,6 +165,7 @@ Command examples #### Short parameters + ``` /usr/bin/python3 hddtempnc.py -d /dev/sda /usr/bin/python3 hddtempnc.py -t 192.168.0.20 -d /dev/sdb @@ -67,16 +174,38 @@ Command examples ``` -## Download +## Support -The script is available in the [code][ln_ReleaseLatest]. +Feature requests, bugs, issues and other comments can be created at the issues link provided at the top of this page. -## Support -Feature requests, bugs, issues and other comments can be created in [Issues](https://github.com/viharm/HDDtempNC/issues). +# Contribute + +Please feel free to clone/fork and contribute via pull requests. Donations also welcome, simply create an issue by using the link provided at the top of this page. + +Please make contact for more information. + + +# Environments + +Developed on.. + +* *Debian Wheezy* +* *Debian Jessie* +* *Debian Stretch* + +Known to be working on + +* *Debian Wheezy* +* *Debian Jessie* +* *Debian Stretch* +* *FreeBSD* 11.2-RELEASE +* *Windows* 10 +* *Python* 3.7 ## Links ## + * *hddtemp* home http://www.guzu.net/linux/hddtemp.php * *hddtemp* on *[Savannah](http://savannah.gnu.org/)* @@ -91,16 +220,35 @@ Licensed under the modified BSD (3-clause) license. A copy of the license is available... -* in the enclosed [`LICENSE`][ln_License] file. +* in the enclosed [`LICENSE`](LICENCE) file. * at http://opensource.org/licenses/BSD-3-Clause +# Credits + + +#### Codiad + +*Codiad* web based IDE (https://github.com/Codiad/Codiad), used under a MIT-style license. + +Copyright (c) Codiad & Kent Safranski (codiad.com) + + +#### CodeGit + +*CodeGit* *Git* plugin for *Codiad* (https://github.com/Andr3as/Codiad-CodeGit), used under a MIT-style license. + +Copyright (c) Andr3as + + +#### Ungit + +*Ungit* client for *Git* (https://github.com/FredrikNoren/ungit) used under the MIT license + +Copyright (C) Fredrik Norén + + +## GitHub + +Hosted by *GitHub* code repository (github.com). -[mg_BadgeLicense]: https://img.shields.io/github/license/viharm/HDDtempNC.svg?style=flat-square -[mg_BadgeVersion]: https://img.shields.io/github/release/viharm/HDDtempNC.svg?style=flat-square -[mg_BadgeIssues]: https://img.shields.io/github/issues/viharm/HDDtempNC.svg?style=flat-square -[mg_BadgeCodeLang]: https://img.shields.io/badge/language-python-yellowgreen.svg?style=flat-square -[ln_ReleaseLatest]: https://github.com/viharm/HDDtempNC/releases/latest -[ln_License]: https://github.com/viharm/HDDtempNC/blob/master/LICENCE -[ln_Issues]: https://github.com/viharm/HDDtempNC/issues -[ln_CodeLang]: https://www.python.org/ diff --git a/VERSION b/VERSION index b11589b..6a34bc8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1,2 @@ -01.02.02 +1.3.0 +(2018-09-26) diff --git a/hddtempnc.py b/hddtempnc.py index c3e437a..2b0c1f1 100644 --- a/hddtempnc.py +++ b/hddtempnc.py @@ -1,15 +1,15 @@ #!/usr/bin/python ## @package HDDtempNC -# \author Vihar Malviya -# \version 01.02.02 -# \date 2015-06-15 +# \author Viharm +# \version See enclosed VERSION file +# \date See enclosed VERSION file # \brief Storage disk temperature querying tool via TCP. # \details Program to provide numeric string output of HDD temperature # using netcat so non-root user can query HDD temperature # Depends on //hddtemp// running as daemon on known port # (default 7634) on known target host (default localhost) -# \copyright Copyright (C) 2015, Vihar Malviya; under BSD 3-Clause License +# \copyright Copyright (C) 2015~18, Viharm; under BSD 3-Clause License # (see LICENSE or http://opensource.org/licenses/BSD-3-Clause)