![](/_next/image/?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Ftcnn7ae6%2Fproduction%2F9027df288a33aab4d7dac516e447e992c8fd61f1-975x500.png&w=3840&q=75)
How to monitor Citrix NetScaler using SquaredUp
We're pleased to present another guest blog from rising star of the SCOM community and all round good guy, Jasper Van Damme.
Jasper's been busy publishing loads of great, new content on his blog including a step-by-step guide on how you can supplement your SCOM data with insights into the performance of your Citrix NetScalers by using SquaredUp's WebAPI tile.
We've provided a copy of Jasper's awesome work below, but if you'd like to read the original or take a look through Jasper's other posts, you can access his blog directly here.
If you'd like some additional insight into what other systems and tools customers are integrating into SquaredUp via WebAPI, we recommend checking out the following thread on our Community Answers platform.
Enjoy!
Extending monitoring with SquaredUp Web API – A Citrix NetScaler example
By Jasper Van Damme
Today I will talk about an interesting use case for Citrix NetScaler monitoring with the SquaredUp Web API tile. Keep in mind that this is only used for visualization purposes, as the Web API tile will not alert on anything. I am using the Web API tile to supplement the NetScaler management pack with additional data.
![](/_next/image/?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Ftcnn7ae6%2Fproduction%2F46509ac4fb9e888f5d548384d658a58e21087cba-1100x490.png%3Fq%3D100%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
The example I’m showing today is fairly straight forward, I had a few Citrix NetScaler counters missing in SCOM, which are available through the NetScaler API.
I wanted to see the current connections and data throughput for each load balanced service. As NetScaler licensing is based on throughput, it is interesting to know which load balanced service is consuming most bandwidth.
Keep in mind that you’ll need the Citrix NetScaler Management Pack (which was previously owned by Comtrade) if you want a virtual server specific statistic perspective. But, depending on how you set it up, this is not a requirement.
I have tested and implemented this with Netscaler v11.0 and up.
Configuration
To get API data in SquaredUp, the first thing you’ll have to do is create a read-only user in NetScaler. I’m not going to cover this as this process is fairly straight forward.
Once the user is created, we can create a new Web API Provider in SquaredUp.
Creating the provider
- Go to Settings
- Select Web API
- Click Add new provider (this can be done for each NetScaler environment you have)
- Fill in the Service Name
- Base URL is: https://<yournetscaleraddress>/nitro/v1/
- Ignore valid SSL: ON, unless you do have a valid certificate for this
- Add the following default headers:
- x-nitro-user - <username that you created earlier>
- x-nitro-pass - <password that you created earlier>
- content-type application/vnd.com.citrix.netscaler.login+json
- Finally, click Add Provider
![](/_next/image/?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Ftcnn7ae6%2Fproduction%2F8b58a2331d8be4e24e770e250b147e5552b5718e-719x477.png%3Fq%3D100%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
Visualizing the NetScaler API data
Once the provider is added, let's create a dashboard!
- Start by clicking the plus (+) icon at the top
- Select Web API tile
- Select the provider we created earlier
In this case, I want statistics for all my virtual servers created on the NetScaler.
- The API documentation says you can do this by adding /stat/lbvserver
- Leave headers and data empty
- In reponse data, fill in lbvserver as key path
The API returns JSON data in this case, and the values we need are contained in lbvserver. If you want to show statistics for other types of objects, an overview can be found here.
- Once the key is filled in it should show all the available data
- In Grid Columns we can hide certain columns and rename titles if required
After fiddling with the columns and giving the column headers a more friendly name, it looks like this:
![](/_next/image/?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Ftcnn7ae6%2Fproduction%2F98dacc6506bc8b7232694158c3adb157b7772a42-879x171.png%3Fq%3D100%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
Show data using the scalar view
Let's add CPU Usage:
- Select the same provider as previous
- This time fill in stat/systemcpu
- Go to Response Data and add systemcpu.0.percpuuse
This reflects the first value that is returned for percpuuse
- Select the Font Size and Unit (in this case %)
The end result loos like this:
![](/_next/image/?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Ftcnn7ae6%2Fproduction%2F643c953d8f44d1c44d4259a12340fa29a9d393d5-838x228.png%3Fq%3D100%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
Creating a perspective for each load balanced virtual server
The last thing I want to cover is creating a perspective for each load balanced virtual server in SquaredUp. This does not require the Comtrade Citrix NetScaler MP!
- Create a dashboard containing your Load Balancers - start by using the column icon
- Add a new status tile
- Choose advanced scope -> Citrix NetScaler Appliance
![](/_next/image/?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Ftcnn7ae6%2Fproduction%2F07476cf3b92e71cc95bf49c6c0fb56af25c19d18-694x365.png%3Fq%3D100%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
The end result should be a list containing all your monitored NetScaler appliances - something like this;
![](/_next/image/?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Ftcnn7ae6%2Fproduction%2Fd05d78b4feb4f88f9f5a694551f171159593d5a3-383x208.png%3Fq%3D100%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
- Add another State Tile with this scope;
![](/_next/image/?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Ftcnn7ae6%2Fproduction%2F5999237190b1af3808cfe8a1be253194b400fa2b-822x602.png%3Fq%3D100%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
- In the right hand column we'll add an Alert tile using the same advanced scope
- This should result in a very simple dashboard
![](/_next/image/?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Ftcnn7ae6%2Fproduction%2F5a07b5a39db303ac9605d64de7c39979a886fb57-1100x311.png%3Fq%3D100%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
Configuring the perspective
- Click on the state of one of the Load Balanced virtual servers
- Create a perspective by clicking the plus (+) icon
- I'll call this perspective 'API Statistics'
- The rest can remain default
- Click Done
Now create two columns in the perspective. I'll walk you through creating this perspective:
![](/_next/image/?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Ftcnn7ae6%2Fproduction%2F2f266898c1cd6e021427fff7e269deae66ae1ad2-1100x375.png%3Fq%3D100%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
To achieve this result, we'll create seven Web API (Scalar) tiles. You can download the configurations required to get this data here.
Once configured and published, you should see this data for each virtual server.
The {{displayName}} value will make sure that the statistics are changed based on the virtual server you drilldown into. The ‘0’ in the response data represents the first value of the API response.
Summary
Hopefully that gives you an idea of the usefulness of the Web API tile. Remember you can combine SCOM data and Web API data as well, like this:
![](/_next/image/?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Ftcnn7ae6%2Fproduction%2Ffe8289de03897d346123d06c81aae642ed44f048-1100x482.png%3Fq%3D100%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
Obviously this is merely scratching the surface of what is possible with the NetScaler API, I just thought I’d share my insights with a few possibilities.
Best regards,
Jasper