I modified a simple ruby plugin and am trying to get it to run on my redis server (not using npre to monitor remote hosts yet).
The command is in the redis plugins directory:
ubuntu#ip-172-30-0-79:/usr/local/nagios/etc$ ls -al /usr/lib/nagios/plugins/check_redis
-rwxr-xr-x 1 nagios nagios 4718 Apr 25 18:54 /usr/lib/nagios/plugins/check_redis
And my commands.cfg
define command {
command_name check_redis_hash
command_line /usr/lib/nagios/plugins/check_redis -H $HOSTADDRESS$ -p $ARG1$ -K $ARG2$ -o $ARG3$ -j $ARG4$
}
But I'm getting this in my log
[1429989009] Warning: Return code of 127 for check of service 'check that redis is up and a specific hash returns' on host 'redis_slave_two' was out of bounds. Make sure the plugin you're trying to run actually exists.
Do I need to do anything else to ensure the plugin works correctly?
Of course it would turn out to be something easy, I was missing the ' symbols around the arguments, adding these resolved the problem.
Related
I have a scenario where I need to copy production database to my dev database on daily basis. Both are different servers. What I have thought of writing a cronjob that will do the stuff. I have written a php script. I am connecting to remote production server via sshpass, taking its dump and then populating that dump.
exec("sshpass -p 'mypassword' ssh root#IP_ADDRESS:PORT");
exec("mysqldump -u root -p DB > production_dump.sql");
exec("mysql -u root -p test < production_dump.sql");
But at first line it throws error of stating
ssh: Could not resolve hostname IP_ADDRESS:PORT: Name or service not known
I have tried given solution on internet but non of them worked. Can any on please explain what I am doing wrong?
Your command is failing because it's not formatted right. You need to use one of the following formats:
sshpass -p 'mypassword' ssh root#IP_ADDRESS PORT
sshpass -p 'mypassword' ssh root#IP_ADDRESS -p PORT
sshpass -p 'mypassword' ssh ssh://root#IP_ADDRESS:PORT
However, I'm not sure if the rest of the script will work, especially if it starts asking for a password. A bash script would be the way to go.
bin/solr start -e techproducts -m 5g -Duser.timezone=US/Eastern -Xdebug -Xrunjdwp:server=y,suspend=n,transport=dt_socket,address=8000
ERROR: -Xdebug is not supported by this script
when i am running solr6.6 on debug mode, its giving me error.
can someone tell me how to run solr on debug mode?
This exact use case is given in the examples in the script:
./solr start -c -m 1g -z localhost:2181 -a \"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044\""
-a Additional parameters to pass to the JVM when starting Solr, such as to setup
Java debug options. For example, to enable a Java debugger to attach to the Solr JVM
you could pass: -a \"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983\"
In most cases, you should wrap the additional parameters in double quotes.
Firstly, sorry for my english.
I try to configure a probe in nagios for monitor log files and notify me when Nagios find string like "Exception" or "Error".
I use Nagios with Centreon.
So, when I execute my command :
$USER1$/check_log -F path/for/log.files -q /Exception/
Nagios return : "Log check error: Log file path/for/log.files does not exist!"
When i check in my server the path, the files exists, all (root, group and other) can read the file. So the problem doesn't seem to come of rights management.
The client for supervisor is a CentOS. I have already install nrpe client, and configure allowed host etc ...
I looked everywhere for someone who had the same error but find nothing.
If someone can help me, it would be so nice !
If you need further informations for help me, please, don't hesitate, i'm not sur that i'm explain in good way my problem.
Regards.
On Nagios server side, you must define something like this:
define service {
service_description service_name
host_name your_remote_hostname
use your_template
check_command ext_check!check_log!-f path/for/log.files -g /Exception/
}
In commands.cfg or in similar file on Nagios server:
define command{
command_name ext_check
command_line $USER1$/check_nrpe -t 30 -H $HOSTADDRESS$ -p 5666 -c $ARG1$ -a $ARG2$
}
On client/monitored host you must edit nrpe.cfg file:
command[check_log]=/opt/nagios/plugins/check_log $ARG1$
after that, you must restart nrpe service and reload Nagios configuration.
I am looking for a little help in configuring NAGIOS for NRPE. I am quite new at Linux and seem to be having some trouble getting this working.
I am running Ubuntu 11.10 with the Nagios 3.3.1 core and Nagios plugins 1.4.15 running nrpe2.13
Currently I am trying to get the Nagios Exchange plugin check_be.exe to work with Nagios. I followed the check_be.txt for the setup on my nagios server and windows backup exec server.
Currently if I run
root#PERSES:/usr/local/nagios/libexec# ./check_nrpe -H 192.168.1.10 -t200 -c check_be
I will get
Job: Daily Backup, Success, Date:17/4/2012
From Nagios all I get is no output returned from plugin.
Windows.cfg has the following entry
# Service for Backup Exec agent
define service {
use template-backupexec
service_description BackupExec - Daily DAT backup ; specific display name, if you need
host_name cmbssrv.cmbs.local
}
Templates.cfg has this entry – I have tried to modify it to avoid the socket timeout
define service{
name template-backupexec
use generic-service
service_description BackupExec Job Check ; default display name in Nagios
check_command check_nrpe! -t 240 -c check_be ; same name as in the nsclient++ nsc.ini command defini$
normal_check_interval 60 ; your check intervals here
retry_check_interval 60
register 0 ; this is a template
}
Commands.cfg:
# 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDESS$ -p 5666 -v $ARG1$
}
Any ideas would be greatly appreciated
This looks wrong
check_command check_nrpe! -t 240 -c check_be
I think those extra arguments need to be in the define command block.
Also change the name of the check_command. You may confuse the check_nrpe executable command (runs in terminal) with your check_command of the same name (which is unknown to the terminal shell).
Here's a working example much like what you are doing.
On the main nagios machine:
define command {
command_name check_nrpe_cart
command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -p 6565 -c $ARG1$
}
define service{
use clientcritical
host_name cartbox
service_description email
normal_check_interval 15
check_command check_nrpe_cart!check_postfix
}
On cartbox in /etc/nagios/nrpe_local.cfg
command[check_postfix]=/usr/lib/nagios/plugins/check_procs -w 1:1 -c 1:1 -C master
You should read pdf from the following link you will get maximum posible answer
for NRPE NAGIOS comunication problem.
http://assets.nagios.com/downloads/nagiosxi/docs/NRPE_Troubleshooting_and_Common_Solutions.pdf
I want to download only .htm or .html files from my server. I'm trying to use ncftpget and even wget but only with limited success.
with ncftpget I can download the whole tree structure no problem but can't seem to specify which files I want, it's either all or nothing.
If I specify the file type like this, it only looks in the top folder:
ncftpget -R -u myuser -p mypass ftp://ftp.myserver.com/public_html/*.htm ./local_folder
If I do this, it downloads the whole site and not just .htm files:
ncftpget -R -u myuser -p mypass ftp://ftp.myserver.com/public_html/ ./local_folder *.htm
Can I use ncftp to do this, or is there another tool I should be using?
You can do it with wget
wget -r -np -A "*.htm*" ftp://site/dir
or:
wget -m -np -A "*.htm*" ftp://user:pass#host/dir
However, as per Types of Files:
Note that these two options do not affect the downloading of HTML files (as determined by a .htm or .html filename prefix). This behavior may not be desirable for all users, and may be changed for future versions of Wget.
Does ncftpget understand dir globs?
Try
ncftpget -R -u myuser -p mypass ftp://ftp.myserver.com/public_html/**/*.htm ./local_folder
** means any number of directories.
The wget command understands standing unix file globbing syntax.
wget -r -np --ftp-user=username --ftp-password=password "ftp://example.com/path/to/dir/*.htm"
Conversely, you can use the -A option, which accepts a comma-separated list of file name suffixes or patterns to accept.
wget -A '*.htm'
The -R option is the opposite of -A, so you can use it to specify patterns NOT to fetch.
Caveat: Make sure to quote patterns! Otherwise, your shell may expand the glob itself, leading to unexpected results.
Also! See the "Using wget to recursively download whole FTP directories" question on Server Fault.