Summary
This article describes how to manage NetScaler 6.1 using Simple Network Management Protocol (SNMP) with Cacti.
Requirements
NetScaler running at software version 6.1 and a working installation of Cacti under a UNIX-based (UNIX, LINUX, or BSD) platform.
Background
Cacti is a freeware program under the terms of the General Public License (GPL). It is a network graphing solution utilizing RRDTool’s data storage and graphing functionality.
Procedure
NetScaler configuration steps:
Because you are managing the NetScaler through SNMP, you must configure an SNMP community and an SNMP manager on the NetScaler. The following commands show how to add an SNMP community and manager:
add snmp community complexcommunity ALL
This command adds an SNMP community called complexcommunity with all permissions.
add snmp manager 10.0.0.1
This command allows a system with an IP address of 10.0.0.1 to execute SNMP queries on this NetScaler. Replace 10.0.0.1 with the IP address of the system that you have installed Cacti on.
Cacti configuration steps:
1. Assuming you have a working installation of Cacti, refer to http://cacti.net/documentation.php for installation procedures.
2. Click the link at the top of this page to download ns61_cacti_template.zip. The following files are contained inside this .zip file:
• cacti_host_template_netscaler_v6_1.xml (host template)
• netscaler_v6_1_interface_statistics.xml (data query definition)
• netscaler_v6_1_service_statistics.xml (data query definition)
• netscaler_v6_1_vserver_statistics.xml (data query definition)
3. Copy the three data query definition .xml files to the following path:
<path_cacti>/resource/snmp_queries
Where <path_cacti> is the directory Cacti is installed in.
4. If you want to put the data query definition in another path, copy the three files to the path you want. Search through the host template file and replace all <path_cacti>/resource/snmp_queries references with your preferred path. That string should occur three times.
5. Import the host template file (cacti_host_template_netscaler_v6_1.xml) through the Import Templates function. Click the Import Templates link on the left menu bar, click Browse, and select the host template file. Click save. The following screen shot shows the Import Templates interface:

6. After clicking the save button, the import results are shown. There should be 20 new data templates, 20 new graph templates, three new data queries, and one host template imported successfully. The following screen shot is an example of the import results screen (output is truncated for simplicity):

7. Before you can create a graph for a particular NetScaler, you must add the NetScaler information into Cacti, such as the IP address and SNMP community. To add a NetScaler into Cacti, click Devices on the menu and then click Add. Refer to the following screen shot:

8. Refer to the following guidelines when adding the NetScaler information:
• Description: A meaningful description of the NetScaler.
• Hostname: Enter the hostname that can be resolved to the NetScaler IP (NSIP). You can enter the NSIP if you do not have a name server for domain name resolution.
• Host Template: Select NetScaler v6.1.
• SNMP Community: Enter the community that you have configured in Step 1 of the NetScaler configuration steps.
• SNMP Version: Select Version 2. Click the create button after entering all the required information. Refer to the following screen shot:

9. You should receive a “Save Successful” message after adding the device. Click the Devices option on the menu; the newly added NetScaler shows up there. By clicking that device, three sections called Devices, Associated Graph Templates, and Associated Data Queries appear on the screen. There is a column called Status under Associated Data Queries. The status should be showing as Success. If this is not the case, you may have to troubleshoot why Cacti cannot contact the NetScaler through SNMP.
10. To create graphs for the NetScaler, click Devices on the menu and then click the device description. On the edit device screen, click *Create Graphs for this Host. Refer to the following screen shot as a reference:

11. On the create new graph screen, there are four sections (Graph Templates, Data Query [NetScaler v6.1 Interface Statistics], Data Query [NetScaler v6.1 Service statistics], Data Query [NetScaler v6.1 Vserver Statistics]).
12. For the Graph Templates section, there are eight templates. Select the templates you want to use to create a graph. The following screen shot shows a user creating two graphs (CPU usage and Total HTTP req/s):

13. After selecting the desired template to graph, scroll down to the bottom and click create.
14. After clicking create, you must select the color for the legend. Select the color you want (or just use the default) and click create again. The graphs are created.
15. To create a graph based on a data query template, you must repeat Step 10 (that is, click *Create Graphs for this Host on the edit device screen).
16. In this example, you are going to create graphs for the service. On the create new graphs screen, locate the Data Query [NetScaler v6.1 Service statistics] section and click the service you want to create the graph for. After that, select the desired graph type on the Select a graph type drop-down menu. The following screen shot shows how to create a graph of the number of active connections on a service called web-07:

17. Click the create button to finish creating the graph(s).
18. Creating graphs for other data query templates is similar to Steps 15-17. Repeat those steps until you have created all the graphs you need.
19. Click Graph Management on the menu. All created graphs are shown there. After clicking on a particular graph title, the corresponding graph is displayed. The graph does not show up immediately after the creation; it usually takes two or three polling intervals (the default polling interval is five minutes) to show up.
20. By clicking Graph Trees on the menu, you can arrange the created graphs on the graph tree. Consult the Cacti documentation for details.
More Information
• There is no guarantee that importing the provided template does not affect any of the existing templates/graphs on Cacti. As a result, Citrix strongly recommends making a backup of the Cacti configuration and database before importing the NetScaler template.
• The template included in this article comes with counters/values that interest most administrators. Administrators can add any counters available from the NetScaler SNMP MIB if necessary.
• The template is designed for NetScaler software version 6.1 only. Any other versions of NetScaler software may not work with this template. Check the Citrix Knowledge Center to ensure compatibility if you are using another software version.
• The template was created and tested under Cacti version 0.8.6i.
The following screen shots are three sample graphs created by the template:

Daily total HTTP requests per second

Weekly CPU utilization

Weekly current active connections of a service