I installed Nagios Core and NCPA on a Mac. Implemented a few checks via custom plugins to understand how to use it. I am trying to understand the following:
1. Protocol that Nagios server actually use to communicate with NCPA agent and how exactly does NCPA return the result back to Nagios. Does it ssh into Nagios server and writes a file that server processes?
2. From application monitoring standpoint how can it be leveraged? Is it just to monitor that application is up and running (I read its not just for that it can do more but couldn't find any place where I could see how its actually implemented) or is there a restful API as well that we invoke from with in our application to send custom notification to Nagios server. I understand it might require some configuration at Nagios server end as well.
3. I came across Pager Duty and Sematext articles i.e [PagerDuty Integration][1] and [SemaText Nagios Alert Integration][2] where they have integrated their solution with Nagios I am trying to do something similar. Adding integration support for Nagios so that a user can utilise our applications UI to configure alerts/notification. For e.g. if a condition is met then alert or notify Nagios server to show a notification on its dashboard.
4. Can we generate an alert from within a spark streaming application based on a variable e.g. if its value is above a threshold or some condition is met send an alert to Nagios Server to display as notification on Nagios Dashboard. I came across a link where we can monitor status of a spark application but didn't find anything for something within a spark application.
[1]: https://www.pagerduty.com/docs/guides/n ... ion-guide/
[2]: https://sematext.com/docs/integration/a ... #in-nagios
How exactly Nagios server communicates with remote nodes
-
gauravsetia07
- Posts: 2
- Joined: Thu Apr 16, 2020 7:00 pm
Re: How exactly Nagios server communicates with remote nodes
With an active check Nagios will use HTTPS to communicate with the NCPA agent. In a passive setup NCPA will send dat the the Core server using NRDP:
https://www.nagios.org/ncpa/help/2.1/active.html
https://www.nagios.org/ncpa/help/2.1/passive.html
There are a lot of checks that are part of the NCPA agent by default, but you can also use it to run other third party scripts/plugins.
Check out the NCPA API by pointing your browser to https://ncpa-ip:5693. And https://support.nagios.com/kb/article/n ... a-722.html covers how to scripts with NCPA.
Integrating Nagios with other applications for notifications usually just boils down to configuring Core to execute a script that does what you want. Check out https://assets.nagios.com/downloads/nag ... tions.html.
Checking an application again comes down to using the right script. I always suggest looking at exchange.nagios.com first to see if a plugin may already be available for what you want. Failing that I then check with my favorite search engine. Github is a good resource as well. There is also the option of writing your own script. As long as it returns data in the proper format and an exit code, it should work with Core. Dev guidelines can be found at http://nagios-plugins.org/doc/guidelines.html.
https://www.nagios.org/ncpa/help/2.1/active.html
https://www.nagios.org/ncpa/help/2.1/passive.html
There are a lot of checks that are part of the NCPA agent by default, but you can also use it to run other third party scripts/plugins.
Check out the NCPA API by pointing your browser to https://ncpa-ip:5693. And https://support.nagios.com/kb/article/n ... a-722.html covers how to scripts with NCPA.
Integrating Nagios with other applications for notifications usually just boils down to configuring Core to execute a script that does what you want. Check out https://assets.nagios.com/downloads/nag ... tions.html.
Checking an application again comes down to using the right script. I always suggest looking at exchange.nagios.com first to see if a plugin may already be available for what you want. Failing that I then check with my favorite search engine. Github is a good resource as well. There is also the option of writing your own script. As long as it returns data in the proper format and an exit code, it should work with Core. Dev guidelines can be found at http://nagios-plugins.org/doc/guidelines.html.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
gauravsetia07
- Posts: 2
- Joined: Thu Apr 16, 2020 7:00 pm
Re: How exactly Nagios server communicates with remote nodes
Thanks for your response @cdienger.
So if I am understanding it correctly (please correct if I am wrong):
1. There's no REST API/endpoint service exposed for pushing alert or notification directly to Nagios Dashboard.
2. For pushing or generating an alert from within a Spark Application, I have to come up with a script that would run and return the result.
Also, it makes me wonder how have sematext or pagerduty implemented capability to push notification on Nagios Dashboard. One probable way I could think of is taking connection inputs from user on their application UI and in the background running some logic/script that basically return the code and message to nagios server based on configuration user provided of their Nagios server.
So if I am understanding it correctly (please correct if I am wrong):
1. There's no REST API/endpoint service exposed for pushing alert or notification directly to Nagios Dashboard.
2. For pushing or generating an alert from within a Spark Application, I have to come up with a script that would run and return the result.
Also, it makes me wonder how have sematext or pagerduty implemented capability to push notification on Nagios Dashboard. One probable way I could think of is taking connection inputs from user on their application UI and in the background running some logic/script that basically return the code and message to nagios server based on configuration user provided of their Nagios server.