访问nut服务器的python抽象类。
nut2的Python项目详细描述
这是对python库PyNUT的api彻底检查,它允许与nut通信 (Network UPS Tools)服务器。
note:这是一个非正式的项目,不受支持,或者 由Network UPS Tools developers背书
要求
模块本身只需要Python(已知可以在2.6到2.6版本中使用 3.4条)如果要运行测试,请执行pip install -rrequirements-testing.txt
用法
示例:
from nut2 import PyNUTClient client = PyNUTClient() client.help() client.list_ups() client.list_vars("My_UPS")
请注意,本模块已完全故意损坏 与PyNUT 1.X向后兼容
有关更多使用信息,请参阅内联文档。
安装
只需使用pip:
pip install nut2
胡桃
以下信息是从原始pynut自述文件复制的:
This directory contains various NUT Client related Python scripts, written by David Goncalves, and released under GPL v3.
- “module”: this directory contains PyNUT.py, which is a Python abstraction class to access NUT server(s). You can use it in Python programs to access NUT’s upsd data server in a simple way, without having to know the NUT protocol.
To import it on Python programs you have to use the following (case sensitive) : ‘import PyNUT’
This module provides a ‘PyNUTClient’ class that can be used to connect and get data from an upsd data server.
To install the PyNUT module on Debian/Ubuntu, copy it to: /usr/share/python-support/python-pynut/
This directory also contains test_nutclient.py, which is a PyNUT test program. For this to be fully functional, you will need to adapt the login, password and upsname to fit your configuration.