Monitor Cache read hits
Monitor Cache read hits
Hello,
I'm trying to deploy a plugin using doc - https://assets.nagios.com/downloads/nag ... ios-XI.pdf
and getting error: NRPE: Command 'check_FSCacheReadsv1' not defined
define service {
host_name 10.242.48.183
service_description check_FSCacheReadsv1
display_name check_FSCacheReadsv1
check_command check_FSCacheReadsv1!!!!!!!!
max_check_attempts 2
check_interval 5
retry_interval 5
active_checks_enabled 1
passive_checks_enabled 0
check_period 24x7
event_handler check_none
event_handler_enabled 0
notification_period 24x7
register 1
}
Could you please help me with this?
I'm trying to deploy a plugin using doc - https://assets.nagios.com/downloads/nag ... ios-XI.pdf
and getting error: NRPE: Command 'check_FSCacheReadsv1' not defined
define service {
host_name 10.242.48.183
service_description check_FSCacheReadsv1
display_name check_FSCacheReadsv1
check_command check_FSCacheReadsv1!!!!!!!!
max_check_attempts 2
check_interval 5
retry_interval 5
active_checks_enabled 1
passive_checks_enabled 0
check_period 24x7
event_handler check_none
event_handler_enabled 0
notification_period 24x7
register 1
}
Could you please help me with this?
Re: Monitor Cache read hits
What is the plugin that you are trying to deploy? Can you provide us with a URL link to it?I'm trying to deploy a plugin using doc - https://assets.nagios.com/downloads/nag ... ios-XI.pdf
In the "check_FSCacheReadsv1" service definition, you have:
Can you show us the command definition of "check_FSCacheReadsv1"?check_command check_FSCacheReadsv1
In addition to this, show us the actual check run from the command line, along with the output of it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Monitor Cache read hits
Thanks for the reply lmiltchev!!
I wrote a shell script and trying to deploy as a plugin. I've attached the script to the email
Client machine is Ubuntu server 14.04.
I wrote a shell script and trying to deploy as a plugin. I've attached the script to the email
Client machine is Ubuntu server 14.04.
You do not have the required permissions to view the files attached to this post.
Re: Monitor Cache read hits
Attaching the screenshot of the script output.
Thanks in advance!!
Thanks in advance!!
You do not have the required permissions to view the files attached to this post.
Re: Monitor Cache read hits
You need to add a line to your /usr/local/nagios/etc/nrpe.cfg so that NRPE has a definition for the command. -
Then, restart NRPE (either service xinetd restart or service nrpe restart). Once this is done, you should be able to run your command through NRPE from the Nagios machine.
Code: Select all
command[check_FSCacheReadsv1]=/usr/local/nagios/libexec/check_FSCacheReadsv1.sh
Former Nagios Employee
Re: Monitor Cache read hits
Thanks for the reply Kennedy!
I've defined the command earlier from GUI (Core config manager -> Commands -> $USER1$/check_FSCacheReadsv1.sh and $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_FSCacheReadsv1) and applied the changes. However that doesn't reflect in nrpe.cfg.
I've added the command at the client side nrpe.cfg and restarted xinetd service as suggested. Then, I see an error message : NRPE: Unable to read output
It appeared to be a permissions issue as per few google results. so I added the line 'nagios ALL=(ALL) NOPASSWD:/usr/sbin/lsof,/usr/local/nagios/libexec/check_FSCacheReadsv1.sh' at /etc/sudoers on client machine and restarted xinetd service. But it doesn't solve the problem or change the error message from 'NRPE: Unable to read output'.
I've defined the command earlier from GUI (Core config manager -> Commands -> $USER1$/check_FSCacheReadsv1.sh and $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_FSCacheReadsv1) and applied the changes. However that doesn't reflect in nrpe.cfg.
I've added the command at the client side nrpe.cfg and restarted xinetd service as suggested. Then, I see an error message : NRPE: Unable to read output
It appeared to be a permissions issue as per few google results. so I added the line 'nagios ALL=(ALL) NOPASSWD:/usr/sbin/lsof,/usr/local/nagios/libexec/check_FSCacheReadsv1.sh' at /etc/sudoers on client machine and restarted xinetd service. But it doesn't solve the problem or change the error message from 'NRPE: Unable to read output'.
Re: Monitor Cache read hits
What are the permissions of /usr/local/nagios/libexec/check_FSCacheReadsv1.sh?
From the remote machine, can you execute the command as the nagios user? (not through NRPE) Both your screenshots are only as the root user.
From the remote machine, can you execute the command as the nagios user? (not through NRPE) Both your screenshots are only as the root user.
Former Nagios Employee
Re: Monitor Cache read hits
I've changed the file ownership to 'nagios' user.
Output -
and then tried executing a command from nagios server. Here is the output -
Output -
Code: Select all
root@v183:~# ls -l /usr/local/nagios/libexec/check_FSCacheReadsv1.sh
-rwxr-xr-x 1 nagios nagios 601 Apr 20 09:13 /usr/local/nagios/libexec/check_FSCacheReadsv1.sh
Code: Select all
[root@localhost libexec]# ./check_nrpe -H 192.168.48.183 -c check_FSCacheReadsv1
NRPE: Unable to read output
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Monitor Cache read hits
On the remote system, can you run the script as the nagios user:
Can you please run these commands on the remote system and show us the output:
Code: Select all
su nagios
/usr/local/nagios/libexec/check_FSCacheReadsv1.shCode: Select all
ps -C xinetd
ps -C nrpeAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Monitor Cache read hits
Thanks for the inputs Box293!
Ran /usr/local/nagios/libexec/check_FSCacheReadsv1.sh with user 'nagios'. The script doesn't work as expected.
I'm using fscli commands in the script and that needs root privileges. So, I added nagios ALL=(ALL) ALL in /etc/sudoers on the client system. However, that doesn't allow me to run fscli commands.
Output for fscli
Output for ps -C xinetd
Ran /usr/local/nagios/libexec/check_FSCacheReadsv1.sh with user 'nagios'. The script doesn't work as expected.
I'm using fscli commands in the script and that needs root privileges. So, I added nagios ALL=(ALL) ALL in /etc/sudoers on the client system. However, that doesn't allow me to run fscli commands.
Output for fscli
Code: Select all
nagios@v183:/root$ fscli
fscli command requires superuser (root) privileges.
Code: Select all
root@v183:~# ps -C xinetd
PID TTY TIME CMD
1848 ? 00:00:00 xinetd