NAGIOS XI check Number of file threads
-
junqian1992
- Posts: 41
- Joined: Wed Nov 15, 2017 4:57 am
NAGIOS XI check Number of file threads
Hi,
how to monitor the Number of file threads in the nagios XI?
command : ps -eLf | awk '{sum += $6}END{print "Threads:\t" sum}' , how to configure on the nagios XI services?
Thank you.
how to monitor the Number of file threads in the nagios XI?
command : ps -eLf | awk '{sum += $6}END{print "Threads:\t" sum}' , how to configure on the nagios XI services?
Thank you.
Regards,
JQ
JQ
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: NAGIOS XI check Number of file threads
Hello, @junqian1992.
You can just create a plugin based on this command. On your Nagios server navigate to /usr/local/nagios/libexec/ and create a new file called check_threads.sh. Paste the code into the file:
Save and exit.
Run the following command to give the permissions to your plugin:
After that you can create a command in XI. Go to the Configure/Core Configuration Manager, then commands, then "Add New":
Click on Save. Then Apply COnfiguration.
Now, go to the Core COnfiguration Manager again, click on services, and then Add New. In check_command field choose the command that you have just created. Fill out other required fileds. In manage Hosts, you may select localhost. Click on Save, then Apply configuration.
That should do it. Here's a reference just in case:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
You can just create a plugin based on this command. On your Nagios server navigate to /usr/local/nagios/libexec/ and create a new file called check_threads.sh. Paste the code into the file:
Code: Select all
ps -eLf | awk '{sum += $6}END{print "Threads:\t" sum}'Run the following command to give the permissions to your plugin:
Code: Select all
chmod +x check_threads.shNow, go to the Core COnfiguration Manager again, click on services, and then Add New. In check_command field choose the command that you have just created. Fill out other required fileds. In manage Hosts, you may select localhost. Click on Save, then Apply configuration.
That should do it. Here's a reference just in case:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
junqian1992
- Posts: 41
- Joined: Wed Nov 15, 2017 4:57 am
Re: NAGIOS XI check Number of file threads
Hi npolovenko,
Yes, this configuration i was do it before, but the result is showing the current nagios server file threads, whatever i change to the server which i want to monitor also showing the nagios server status, not the server i specific one.
Yes, this configuration i was do it before, but the result is showing the current nagios server file threads, whatever i change to the server which i want to monitor also showing the nagios server status, not the server i specific one.
You do not have the required permissions to view the files attached to this post.
Regards,
JQ
JQ
-
kyang
Re: NAGIOS XI check Number of file threads
Are you using this script to check another server? Is that correct?
What's in your script? Could you post it?
Did you script it to pass a -H argument?
If you haven't scripted it to connect to another server and execute, it's best to do so through an agent like (NRPE or NCPA) or by SSH. If you want to check another server for the number of file threads.
Let us know!
What's in your script? Could you post it?
Did you script it to pass a -H argument?
If you haven't scripted it to connect to another server and execute, it's best to do so through an agent like (NRPE or NCPA) or by SSH. If you want to check another server for the number of file threads.
Let us know!
-
junqian1992
- Posts: 41
- Joined: Wed Nov 15, 2017 4:57 am
Re: NAGIOS XI check Number of file threads
hi kyang,
script check_threads.sh as below:
#!/bin/bash
ps -eLf | awk '{sum += $6}END{print "Threads:\t" sum}'
Did you script it to pass a -H argument?
ans: i need to add -H argument in the script ? how to i add ? can provide me some example?
script check_threads.sh as below:
#!/bin/bash
ps -eLf | awk '{sum += $6}END{print "Threads:\t" sum}'
Did you script it to pass a -H argument?
ans: i need to add -H argument in the script ? how to i add ? can provide me some example?
You do not have the required permissions to view the files attached to this post.
Regards,
JQ
JQ
Re: NAGIOS XI check Number of file threads
If you want to run that script from the Nagios XI machine and have it check the file threads on a completely different machine, you'll need some sort of transport method. It would indicate a massive security problem on the destination machine if one could execute arbitrary commands on it with no additional configuration.
NRPE, NCPA, or simple SSH checks should work. Here's documentation on all of those things:
NRPE:
https://assets.nagios.com/downloads/nag ... _Agent.pdf
https://support.nagios.com/kb/article/n ... d-612.html
NCPA:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://www.nagios.org/ncpa/help.php#ap ... ng-plugins
check_by_ssh:
https://assets.nagios.com/downloads/nag ... ng_SSH.pdf
NRPE, NCPA, or simple SSH checks should work. Here's documentation on all of those things:
NRPE:
https://assets.nagios.com/downloads/nag ... _Agent.pdf
https://support.nagios.com/kb/article/n ... d-612.html
NCPA:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://www.nagios.org/ncpa/help.php#ap ... ng-plugins
check_by_ssh:
https://assets.nagios.com/downloads/nag ... ng_SSH.pdf
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
kyang
Re: NAGIOS XI check Number of file threads
Thanks @mcapra!
junqian1992, please take a look at the suggestions for running your plugin on another remote machine.
junqian1992, please take a look at the suggestions for running your plugin on another remote machine.
-
junqian1992
- Posts: 41
- Joined: Wed Nov 15, 2017 4:57 am
Re: NAGIOS XI check Number of file threads
Thanks mcapra and kyang.
I found out what i miss configuration.
it is working now, i added the command[check_threads]=/usr/local/nagios/libexec/check_threads.sh in the /usr/local/nagios/etc/nrpe/common.cfg it can work now. Thank you very much.
I found out what i miss configuration.
it is working now, i added the command[check_threads]=/usr/local/nagios/libexec/check_threads.sh in the /usr/local/nagios/etc/nrpe/common.cfg it can work now. Thank you very much.
Regards,
JQ
JQ
-
kyang
Re: NAGIOS XI check Number of file threads
Sounds good!
Glad it's working, are we okay to close this thread?
Or did you have any more questions?
Glad it's working, are we okay to close this thread?
Or did you have any more questions?
-
junqian1992
- Posts: 41
- Joined: Wed Nov 15, 2017 4:57 am
Re: NAGIOS XI check Number of file threads
Hi Kyang,
You can close this ticket.
Thank you very much.
You can close this ticket.
Thank you very much.
Regards,
JQ
JQ