Netdata Community

How to monitor if a specific program(NX-Witness) is running?

Dear,

I’ve been trying to monitor wheter a program(NX-Witness)is active.

The intention is to get an alert when NX-Witness goes offline.
I already tried it myself but I can’t figure it out :confused:
image


Maybe one of you guys can help me out?

Kind regards,

Gino

Try something like this

alarm: check_if_NX-Witness_is_running
   on: apps.uptime
 calc: $celery
units: seconds
every: 10s
 warn: $this == nan || $this <= 30

Please check if you have the celery variable in the chart using the http://localhost:19999/api/v1/alarm_variables?chart=apps.uptime API call.

Thanks for your quick response.

Now I have this:


I get an error but also when the program is running :confused:
Do you know how to adjust the config you send me to only get notified when the program is not running?

Kind regards,

Gino

I don’t see celery in the http://localhost:19999/api/v1/alarm_variables?chart=apps.uptime :confused:
Do I have to add this and if so, how can I do this?

Kind regards,

Gino

Have you checked the API call I sent you? Please show your "chart_variables":.

Just open it in your browser.

{
“chart”: “apps.uptime”,
“chart_name”: “apps.uptime”,
“chart_context”: “apps.uptime”,
“chart_variables”: {
“X”: 109589.00000,
“cron_raw”: 10746.00000,
“NX_Witness_last_collected_t”: 1622122413.00000,
“charts.d.plugin_last_collected_t”: 1622122413.00000,
“NX_Witness_raw”: 5105.00000,
“kernel_last_collected_t”: 1622122413.00000,
“nms_raw”: 197052.00000,
“python.d.plugin_last_collected_t”: 1622122137.00000,
“ssh_last_collected_t”: 1622122413.00000,
“nfs”: 197097.00000,
“nms”: 197052.00000,
“dhcp_raw”: 197061.00000,
“ssh”: 83329.00000,
“cron_last_collected_t”: 1622122413.00000,
“red”: null,
“X_raw”: 109589.00000,
“X_last_collected_t”: 1622122413.00000,
“kernel”: 197097.00000,
“tc_qos_helper”: 278.00000,
“apps.plugin_last_collected_t”: 1622122413.00000,
“netdata_raw”: 280.00000,
“nms_last_collected_t”: 1622122413.00000,
“nfs_last_collected_t”: 1622122413.00000,
“nfs_raw”: 197097.00000,
“dhcp”: 197061.00000,
“go.d.plugin_last_collected_t”: 1622122413.00000,
“netdata”: 280.00000,
“charts.d.plugin”: 278.00000,
“update_every”: 1.00000,
“go.d.plugin”: 278.00000,
“check_if_NX_Witness_is_running”: null,
“node.d.plugin_last_collected_t”: 1622122138.00000,
“system_last_collected_t”: 1622122413.00000,
“other”: 197097.00000,
“apps.plugin”: 278.00000,
“apps.plugin_raw”: 278.00000,
“dhcp_last_collected_t”: 1622122413.00000,
“netdata_last_collected_t”: 1622122413.00000,
“ssh_raw”: 83329.00000,
“go.d.plugin_raw”: 278.00000,
“other_raw”: 197097.00000,
“tc_qos_helper_last_collected_t”: 1622122413.00000,
“system_raw”: 197068.00000,
“node.d.plugin”: null,
“python.d.plugin_raw”: 2.00000,
“NX_Witness”: 5105.00000,
“other_last_collected_t”: 1622122413.00000,
“kernel_raw”: 197097.00000,
“node.d.plugin_raw”: 3.00000,
“python.d.plugin”: null,
“last_collected_t”: 1622122413.00000,
“system”: 197068.00000,
“charts.d.plugin_raw”: 278.00000,
“green”: null,
“collected_total_raw”: 1392633.00000,
“tc_qos_helper_raw”: 278.00000,
“cron”: 10746.00000
},

{
“chart”: “apps.uptime”,
“chart_name”: “apps.uptime”,
“chart_context”: “apps.uptime”,
“chart_variables”: {
“X”: 109589.00000,
“cron_raw”: 10746.00000,
“NX_Witness_last_collected_t”: 1622122413.00000,
“charts.d.plugin_last_collected_t”: 1622122413.00000,
“NX_Witness_raw”: 5105.00000,
“kernel_last_collected_t”: 1622122413.00000,
“nms_raw”: 197052.00000,
“python.d.plugin_last_collected_t”: 1622122137.00000,
“ssh_last_collected_t”: 1622122413.00000,
“nfs”: 197097.00000,
“nms”: 197052.00000,
“dhcp_raw”: 197061.00000,
“ssh”: 83329.00000,
“cron_last_collected_t”: 1622122413.00000,
“red”: null,
“X_raw”: 109589.00000,
“X_last_collected_t”: 1622122413.00000,
“kernel”: 197097.00000,
“tc_qos_helper”: 278.00000,
“apps.plugin_last_collected_t”: 1622122413.00000,
“netdata_raw”: 280.00000,
“nms_last_collected_t”: 1622122413.00000,
“nfs_last_collected_t”: 1622122413.00000,
“nfs_raw”: 197097.00000,
“dhcp”: 197061.00000,
“go.d.plugin_last_collected_t”: 1622122413.00000,
“netdata”: 280.00000,
“charts.d.plugin”: 278.00000,
“update_every”: 1.00000,
“go.d.plugin”: 278.00000,
“check_if_NX_Witness_is_running”: null,
“node.d.plugin_last_collected_t”: 1622122138.00000,
“system_last_collected_t”: 1622122413.00000,
“other”: 197097.00000,
“apps.plugin”: 278.00000,
“apps.plugin_raw”: 278.00000,
“dhcp_last_collected_t”: 1622122413.00000,
“netdata_last_collected_t”: 1622122413.00000,
“ssh_raw”: 83329.00000,
“go.d.plugin_raw”: 278.00000,
“other_raw”: 197097.00000,
“tc_qos_helper_last_collected_t”: 1622122413.00000,
“system_raw”: 197068.00000,
“node.d.plugin”: null,
“python.d.plugin_raw”: 2.00000,
“NX_Witness”: 5105.00000,
“other_last_collected_t”: 1622122413.00000,
“kernel_raw”: 197097.00000,
“node.d.plugin_raw”: 3.00000,
“python.d.plugin”: null,
“last_collected_t”: 1622122413.00000,
“system”: 197068.00000,
“charts.d.plugin_raw”: 278.00000,
“green”: null,
“collected_total_raw”: 1392633.00000,
“tc_qos_helper_raw”: 278.00000,
“cron”: 10746.00000
},

{
	"chart": "apps.uptime",
	"chart_name": "apps.uptime",
	"chart_context": "apps.uptime",
	"chart_variables": {
		"X": 109589.00000,
		"cron_raw": 10746.00000,
		"NX_Witness_last_collected_t": 1622122413.00000,
		"charts.d.plugin_last_collected_t": 1622122413.00000,
		"NX_Witness_raw": 5105.00000,
		"kernel_last_collected_t": 1622122413.00000,
		"nms_raw": 197052.00000,
		"python.d.plugin_last_collected_t": 1622122137.00000,
		"ssh_last_collected_t": 1622122413.00000,
		"nfs": 197097.00000,
		"nms": 197052.00000,
		"dhcp_raw": 197061.00000,
		"ssh": 83329.00000,
		"cron_last_collected_t": 1622122413.00000,
		"red": null,
		"X_raw": 109589.00000,
		"X_last_collected_t": 1622122413.00000,
		"kernel": 197097.00000,
		"tc_qos_helper": 278.00000,
		"apps.plugin_last_collected_t": 1622122413.00000,
		"netdata_raw": 280.00000,
		"nms_last_collected_t": 1622122413.00000,
		"nfs_last_collected_t": 1622122413.00000,
		"nfs_raw": 197097.00000,
		"dhcp": 197061.00000,
		"go.d.plugin_last_collected_t": 1622122413.00000,
		"netdata": 280.00000,
		"charts.d.plugin": 278.00000,
		"update_every": 1.00000,
		"go.d.plugin": 278.00000,
		"check_if_NX_Witness_is_running": null,
		"node.d.plugin_last_collected_t": 1622122138.00000,
		"system_last_collected_t": 1622122413.00000,
		"other": 197097.00000,
		"apps.plugin": 278.00000,
		"apps.plugin_raw": 278.00000,
		"dhcp_last_collected_t": 1622122413.00000,
		"netdata_last_collected_t": 1622122413.00000,
		"ssh_raw": 83329.00000,
		"go.d.plugin_raw": 278.00000,
		"other_raw": 197097.00000,
		"tc_qos_helper_last_collected_t": 1622122413.00000,
		"system_raw": 197068.00000,
		"node.d.plugin": null,
		"python.d.plugin_raw": 2.00000,
		"NX_Witness": 5105.00000,
		"other_last_collected_t": 1622122413.00000,
		"kernel_raw": 197097.00000,
		"node.d.plugin_raw": 3.00000,
		"python.d.plugin": null,
		"last_collected_t": 1622122413.00000,
		"system": 197068.00000,
		"charts.d.plugin_raw": 278.00000,
		"green": null,
		"collected_total_raw": 1392633.00000,
		"tc_qos_helper_raw": 278.00000,
		"cron": 10746.00000
	},

@Gino_Schreuders

When responding, use three backticks (```) before and after the code you were about to send.

I believe you should use

calc: $NX_Witness

You don’t have any variables/dimensions with the name celery and I don’t understand why you were trying to use that name.

To be fair Vlad, you did have celery in the example :sweat_smile:

Look at the picture in the original post :wink: