用于管理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第三方库


热门话题
java Runtime exec不执行以下命令。原因可能是什么?   java使用JavaParser使用getExtendedType查找继承   XML文件Android出现java错误(解析XML时出错:格式不正确(无效令牌))   java正则表达式ReplaceAll不起作用   使用JCodeModel的java预写代码   用hibernate实现java国家/地区表示   java如何获得JR中的剩余线程?   在Java中,如何循环遍历字符串并检查它是否包含哈希映射中的键?   java启动配置没有看到来自其他捆绑包的类   在Java中找不到spring源代码   由customCursorAdapter在片段中加载列表时发生java NullPointerException   数据库体系结构中的安卓 Java类   java这个矩阵乘法代码是如何工作的?   cassandra Cassnadra Java驱动程序2.1对象映射器。检查冻结类型时出错   显示admob广告的java问题