How does snmp_exporter collect netscaler device indicators?
1. Prepare the go locale (the installation process is ignored, I have the gopath in / home/gocode)
Export GOPATH=/home/gocode/
Cd / home/gocode/src/github.com/prometheus
Git clone https://github.com/prometheus/snmp_exporter.git
Cd snmp_exporter
Cd generator/
Go build
Make mibs
Then, change to the mibs directory
Cd mibs/
Download N MIB files (all txt files) from the https://docs.citrix.com/en-us/netscaler-sd-wan/9-3/standard-mib-support.html page here and download them to the mibs directory using wget
Then, start editing the generator.yml file:
After vim generator.yml modification, the contents of the modified file are as follows:
Modules:
Ns:
Walk:
-1.3.6.1.4.1.5951.4.1
Version: 2
Max_repetitions: 25
Retries: 3
Timeout: 10s
Auth:
Community: genghis
When finished, perform the following compilation to generate the appropriate snmp.yml file
Export MIBDIRS=mibs
. / generator generate
When you're done, you'll see a snmp.yml file in the current directory, which looks something like this:
Start:
. / snmp_exporter-- config.file= "snmp.yml"-- web.listen-address= ": 9988" then check by yourself to see if any netscaler data has been collected
Then, add the relevant target to the prometheus, something like this:
-job_name: 'netscaler_1_snmp'
Static_configs:
-targets:
-2.3.4.5
Metrics_path: / snmp
Scrape_interval: 60s
Scrape_timeout: 30s
Params:
Module: [ns]
Relabel_configs:
-source_labels: [_ _ address__]
Target_label: _ _ param_target
-source_labels: [_ _ param_target]
Target_label: instance
-target_label: _ _ address__
Replacement: 1.2.3.4:9988
After the final data is collected, we go to grafana to draw: