|
| 1 | +netsclaler-tool |
| 2 | +=============== |
| 3 | + |
| 4 | +System Requirements |
| 5 | +------------------- |
| 6 | + |
| 7 | +- Python >= 2.6 and Python < 3 |
| 8 | +- Python modules are in requirements.txt |
| 9 | + |
| 10 | +NetScaler Requirements |
| 11 | +---------------------- |
| 12 | + |
| 13 | +- Known to work with NS9.3 and NS10.1 |
| 14 | +- System user account that has appropriate access |
| 15 | +- Depending on your use case, you might only need a system user that |
| 16 | + has read-only permissions |
| 17 | + |
| 18 | +Installation |
| 19 | +------------ |
| 20 | + |
| 21 | +From PyPI |
| 22 | +~~~~~~~~~ |
| 23 | + |
| 24 | +**Notes** |
| 25 | + |
| 26 | +- Don't forget to `modify <#configure>`__ **/etc/netscalertool.conf** |
| 27 | + after installation |
| 28 | + |
| 29 | + :: |
| 30 | + |
| 31 | + sudo pip install netscaler-tool |
| 32 | + sudo mkdir -p /var/log/netscaler-tool |
| 33 | + sudo touch /var/log/netscaler-tool/netscaler-tool.log |
| 34 | + sudo chown <user>:<group> /var/log/netscaler-tool/netscaler-tool.log |
| 35 | + sudo chmod <mode> /var/log/netscaler-tool/netscaler-tool.log |
| 36 | + sudo wget -O /etc/netscalertool.conf https://github.com/tagged/netscaler-tool/blob/master/netscalertool.conf.example |
| 37 | + |
| 38 | +From RPM |
| 39 | +~~~~~~~~ |
| 40 | + |
| 41 | +**Notes** |
| 42 | + |
| 43 | +- Please replace **<tag>** with the version you wish to use |
| 44 | +- The rpm will create: |
| 45 | + |
| 46 | + 1. A sample **/etc/netscalertool.conf** that needs to be modified |
| 47 | + 2. Directory **/var/log/netscaler-tool**. It is up to you to create |
| 48 | + **/var/log/netscaler-tool/netscaler-tool.log** with the correct |
| 49 | + permissions |
| 50 | + |
| 51 | +1. Download tar.gz specific version of the repo |
| 52 | + |
| 53 | + - ``https://github.com/tagged/netscaler-tool/releases/tag/v<tag>.tar.gz`` |
| 54 | + |
| 55 | +2. Use included rpm spec (python-netscalertool.spec) file and newly |
| 56 | + downloaded tar.gz file to build a rpm |
| 57 | + |
| 58 | + 1. ``tar xzvf netscaler-tool-\<tag\>.tar.gz netscaler-tool-\<tag\>/python-netscalertool.spec`` |
| 59 | + 2. http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment |
| 60 | + |
| 61 | +From Source |
| 62 | +~~~~~~~~~~~ |
| 63 | + |
| 64 | +1. git clone https://github.com/tagged/netscaler-tool.git |
| 65 | +2. cd netscaler-tool |
| 66 | +3. sudo python setup.py install |
| 67 | +4. sudo mkdir -p /var/log/netscaler-tool |
| 68 | +5. sudo touch /var/log/netscaler-tool/netscaler-tool.log |
| 69 | +6. sudo chown <user>:<group> /var/log/netscaler-tool/netscaler-tool.log |
| 70 | +7. sudo chmod <mode> /var/log/netscaler-tool/netscaler-tool.log |
| 71 | +8. sudo cp netscalertool.conf.example /etc/netscalertool.conf |
| 72 | +9. Modify /etc/netscalertool.conf |
| 73 | + |
| 74 | +Configuration |
| 75 | +------------- |
| 76 | + |
| 77 | + Modify **/etc/netscalertool.conf** |
| 78 | + |
| 79 | +1. Update **user** to a NetScaler system user |
| 80 | +2. Update **passwd** for the NetScaler system user |
| 81 | +3. (Optional) |
| 82 | + |
| 83 | + - Update **manage\_vservers** with a list of vserver you want to |
| 84 | + manage |
| 85 | + - Update **external\_nodes** with a script that returns a newline |
| 86 | + separated list of nodes that are allowed to be managed. If not |
| 87 | + set, all nodes are manageable |
| 88 | + |
| 89 | +Usage |
| 90 | +----- |
| 91 | + |
| 92 | +The netscaler-tool is really just a wrapper around netscalerapi.py. If |
| 93 | +you would like to write your own tool, but not have to worry about |
| 94 | +interacting with the NetScaler Nitro API, you can use netscalerapi.py. |
| 95 | + |
| 96 | +The netscaler-tool can take -h or --help optional argument at anytime: |
| 97 | + |
| 98 | +:: |
| 99 | + |
| 100 | + ./netscalertool.py --help |
| 101 | + usage: netscalertool.py [-h] [--user USER] [--passwd PASSWD] [--nodns] |
| 102 | + [--debug] [--dryrun] |
| 103 | + NETSCALER {show,stat,compare,enable,disable,bounce} |
| 104 | + ... |
| 105 | + |
| 106 | + positional arguments: |
| 107 | + NETSCALER IP or name of NetScaler. |
| 108 | + {show,stat,compare,enable,disable,bounce} |
| 109 | + show sub-command for showing objects |
| 110 | + stat sub-command for showing object stats |
| 111 | + compare sub-command for comparing objects |
| 112 | + enable sub-command for enable objects |
| 113 | + disable sub-command for disabling objects |
| 114 | + bounce sub-command for bouncing objects |
| 115 | + |
| 116 | + optional arguments: |
| 117 | + -h, --help show this help message and exit |
| 118 | + --user USER NetScaler user account. |
| 119 | + --passwd PASSWD Password for user. Default is to fetch from |
| 120 | + /etc/netscalertool.conf |
| 121 | + --nodns Won't try to resolve any NetScaler objects |
| 122 | + --debug Shows what's going on |
| 123 | + --dryrun Dryrun |
| 124 | + |
| 125 | + ./netscalertool.py 192.168.1.10 show --help |
| 126 | + usage: netscalertool.py NETSCALER show [-h] |
| 127 | + |
| 128 | + {lb-vservers,lb-vserver,cs-vservers,server,servers,services,primary-node,ssl-certs,saved-config,running-config,system} |
| 129 | + ... |
| 130 | + |
| 131 | + positional arguments: |
| 132 | + {lb-vservers,lb-vserver,cs-vservers,server,servers,services,primary-node,ssl-certs,saved-config,running-config,system} |
| 133 | + lb-vservers Shows all lb vservers |
| 134 | + lb-vserver Shows stat(s) of a specified lb vserver |
| 135 | + cs-vservers Shows all cs vservers |
| 136 | + server Shows server info |
| 137 | + servers Shows all servers |
| 138 | + services Shows all services |
| 139 | + primary-node Shows which of the two nodes is primary |
| 140 | + ssl-certs Shows ssl certs and days until expiring |
| 141 | + saved-config Shows saved ns config |
| 142 | + running-config Shows running ns config |
| 143 | + system Shows system counters |
| 144 | + |
| 145 | + optional arguments: |
| 146 | + -h, --help show this help message and exit |
| 147 | + |
0 commit comments