Nagios plugin to monitor Node Js application

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
kaushalshriyan
Posts: 119
Joined: Fri May 22, 2015 7:12 am

Nagios plugin to monitor Node Js application

Post by kaushalshriyan »

Hi,

I am running node application on CentOS Linux release 7.2.1511 (Core). I am using Nagios core 4.2.0. Are they any nagios plugins to monitor node js application? For example how do i monitor subscription-node/server.js as per the below ps aux | grep node command output.

Code: Select all

root     27666  0.0  0.4 885100 32956 ?        Ssl  Nov21   0:36 /usr/bin/node /usr/lib/node_modules/forever/bin/monitor server.js
root     27674  0.1  0.4 917360 32488 ?        Sl   Nov21   1:33 /usr/bin/node /opt/subscription-node/server.js
root     27684  0.7  1.0 1238616 84620 ?       Sl   Nov21   7:02 /usr/bin/node ./bin/www
root     27689  0.7  0.8 1235532 65716 ?       Sl   Nov21   7:26 /usr/bin/node ./bin/www
root     27691  0.7  1.0 1236360 80564 ?       Sl   Nov21   7:04 /usr/bin/node ./bin/www
root     27696  0.8  0.7 1236100 58932 ?       Sl   Nov21   7:56 /usr/bin/node ./bin/www
root     28184  0.2  0.4 884852 33824 ?        Ssl  Nov21   1:56 /usr/bin/node /usr/lib/node_modules/forever/bin/monitor server.js
Any help will be highly appreciable.

Regards,

Kaushal
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Nagios plugin to monitor Node Js application

Post by npolovenko »

Hello, @kaushalshriyan. If you only want to check for a node process that runs with /opt/subscription-node/server.js argument, you could use a check_procs plugin with Nagios Core:

Code: Select all

./check_procs -C node -a '/opt/subscription-node/server.js'
This will show you whether this process is running or not.

Are you running node JS on Nagios core server, or on a separate server? If separate, then you'd need to install an agent on the NodeJS server, like NRPE.

Also, you can run a simple http/https check from the Nagios Core. Say if your Node Js server is up there should be a reachable webpage, but if Nagios finds out that the webpage is down it can send you an alert.

Do you think this could work for you? Is there anything else you'd want to monitor on a Node JS server? You can of course monitor Ram/CPU and hard drive usage on a Linux machine that hosts NodeJS. This will tell you whether the system has sufficient resources or if it is overloading and needs some optimizations.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked