This plugin complies with documentation here: https://github.com/joyent/triton-cmon-agent/tree/master/docs#plugins
Place this in /opt/custom/cmon/gz
on all CNs. The script must be executable.
Example output from plugin script:
[root@headnode (vt-coal-1) ~]# /opt/custom/cmon/gz-plugins/zone_count.prom
# HELP plugin_zone_count Zone count by state
# TYPE plugin_zone_count gauge
plugin_zone_count{state="running",zone_state="running"} 27
Example output from cmon:
$ cmon -i -p vt-coal-1 metrics 18a6cf11-45d4-8884-a77c-f44d30663faf | grep zone_count
# HELP plugin_zone_count_metrics_available_boolean Whether plugin_zone_count metrics were available, 0 = false, 1 = true
# TYPE plugin_zone_count_metrics_available_boolean gauge
plugin_zone_count_metrics_available_boolean 1
# HELP plugin_zone_count_metrics_cached_boolean Whether plugin_zone_count metrics came from cache, 0 = false, 1 = true
# TYPE plugin_zone_count_metrics_cached_boolean gauge
plugin_zone_count_metrics_cached_boolean 1
# HELP plugin_zone_count_metrics_timer_seconds How long it took to gather the plugin_zone_count metrics
# TYPE plugin_zone_count_metrics_timer_seconds gauge
plugin_zone_count_metrics_timer_seconds 0.000025107
# HELP plugin_zone_count_plugin_zone_count Zone count by state
# TYPE plugin_zone_count_plugin_zone_count gauge
plugin_zone_count{state="running",zone_state="running"} 27