用于管理Netscaler的Nitro API工具。

netscaler-tool的Python项目详细描述


系统要求

  • python>;=2.6和python<;3
  • python模块位于requirements.txt中

Netscaler要求

  • 已知与NS9.3和NS10.1一起使用
  • 具有适当访问权限的系统用户帐户
  • 根据您的用例,您可能只需要一个系统用户 具有只读权限

安装

来自Pypi

注释

  • 别忘了modify/etc/netscalertool.conf 安装后

    sudo pip install netscaler-tool
    sudo mkdir -p /var/log/netscaler-tool
    sudo touch /var/log/netscaler-tool/netscaler-tool.log
    sudo chown <user>:<group> /var/log/netscaler-tool/netscaler-tool.log
    sudo chmod <mode> /var/log/netscaler-tool/netscaler-tool.log
    sudo wget -O /etc/netscalertool.conf  https://github.com/tagged/netscaler-tool/blob/master/netscalertool.conf.example
    

从转速

注释

  • 请用您希望使用的版本替换<;tag>;
  • 转速将产生:
    1. 需要修改的示例/etc/netscalertool.conf
    2. 目录/var/log/netscaler tool。由你来创造 /var/log/netscaler tool/netscaler tool.log使用正确的 权限
  1. 下载特定于tar.gz版本的repo
    • https://github.com/tagged/netscaler-tool/releases/tag/v<tag>.tar.gz
  2. 使用包含的RPM规范(python netscalertool.spec)文件和新的 下载tar.gz文件以构建RPM
    1. tar xzvf netscaler-tool-\<tag\>.tar.gznetscaler-tool-\<tag\>/python-netscalertool.spec
    2. http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment

来源

  1. git克隆https://github.com/tagged/netscaler-tool.git
  2. CD Netscaler工具
  3. sudo python setup.py安装
  4. sudo mkdir-p/var/log/netscaler工具
  5. sudo touch/var/log/netscaler tool/netscaler-tool.log
  6. sudo chown<;用户>;:<;组>;/var/log/netscaler tool/netscaler-tool.log
  7. sudo chmod<;mode>;/var/log/netscaler tool/netscaler-tool.log
  8. sudo cp netscalertool.conf.example/etc/netscalertool.conf
  9. 修改/etc/netscalertool.conf

配置

  1. user更新为netscaler系统用户
  2. 为netscaler系统用户更新passwd
  3. (可选)
    • 用要更新的vserver列表更新manage\u vserver 管理
    • 使用返回换行符的脚本更新外部节点。 允许管理的节点的单独列表。如果不是 set,所有节点都是可管理的

用法

netscaler工具实际上只是netscalerapi.py的一个包装器。如果 你想自己写工具,但不必担心 与netscaler nitro api交互时,可以使用netscalerapi.py。

netscaler工具可以随时使用-h或-help可选参数:

./netscalertool.py --help
usage: netscalertool.py [-h] [--user USER] [--passwd PASSWD] [--nodns]
                        [--debug] [--dryrun]
                        NETSCALER {show,stat,compare,enable,disable,bounce}
                        ...

positional arguments:
  NETSCALER             IP or name of NetScaler.
  {show,stat,compare,enable,disable,bounce}
    show                sub-command for showing objects
    stat                sub-command for showing object stats
    compare             sub-command for comparing objects
    enable              sub-command for enable objects
    disable             sub-command for disabling objects
    bounce              sub-command for bouncing objects

optional arguments:
  -h, --help            show this help message and exit
  --user USER           NetScaler user account.
  --passwd PASSWD       Password for user. Default is to fetch from
                        /etc/netscalertool.conf
  --nodns               Won't try to resolve any NetScaler objects
  --debug               Shows what's going on
  --dryrun              Dryrun

./netscalertool.py 192.168.1.10 show --help
usage: netscalertool.py NETSCALER show [-h]

                                       {lb-vservers,lb-vserver,cs-vservers,server,servers,services,primary-node,ssl-certs,saved-config,running-config,system}
                                   ...

positional arguments:
  {lb-vservers,lb-vserver,cs-vservers,server,servers,services,primary-node,ssl-certs,saved-config,running-config,system}
    lb-vservers         Shows all lb vservers
    lb-vserver          Shows stat(s) of a specified lb vserver
    cs-vservers         Shows all cs vservers
    server              Shows server info
    servers             Shows all servers
    services            Shows all services
    primary-node        Shows which of the two nodes is primary
    ssl-certs           Shows ssl certs and days until expiring
    saved-config        Shows saved ns config
    running-config      Shows running ns config
    system              Shows system counters

optional arguments:
  -h, --help            show this help message and exit

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
ApachePOI如何通过java从excel文件中删除空白列?   linux到后台Java服务应用程序的简单发送/接收接口   java ActionBarPullToRefresh什么都没发生   java从millis获取错误的整数天   java相同的代码在两个不同的包上表现不同   java将每个新的char元素写入一个文件(如果被覆盖)   mysql如何在Java中通过外键链接的多个表中插入数据   java环境下mysql网络文件访问   java当使用构建器模式时,为什么我不应该重用builderobject来访问对象配置?   java jQueryServlet post异常失败   java应该使用什么逻辑来创建像《愤怒的小鸟》中那样的锁屏   java Android:在不滑动的情况下更改ViewPager中的片段   java在使用我的程序逻辑时获得空输出