Hi all.
I have a little question . . . . Can I do the following?
./check_by_ssh -t XX -H localhost -l <user> -p <port> -C "cd $ARGS1$ ; ./check_cpu_stats.sh -w <WARN> -c <CRIT>"
If i do this from a command line it works fine but If I do frm commands.cfg Nagios only use -C 'cd $ARGS1$ because ";" is a comment char.
Is it possible? Can I tell nagios that ";" is a part of -C command?
Regards.
Luis
check_by_ssh -C problem
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_by_ssh -C problem
First, it should be $ARG1$ not $ARGS1$
I'm not positive, but you may be able to escape it with \
But also, there should be no need to change directory with this command, you could just do
I'm not positive, but you may be able to escape it with \
Code: Select all
./check_by_ssh -t XX -H localhost -l <user> -p <port> -C "cd $ARG1$ \; ./check_cpu_stats.sh -w <WARN> -c <CRIT>"Code: Select all
./check_by_ssh -t XX -H localhost -l <user> -p <port> -C "$ARG1$/check_cpu_stats.sh -w <WARN> -c <CRIT>"Re: check_by_ssh -C problem
I just tired to escape with "\" but it doesn't work.
Tanks Scott.
Regards.
Tanks Scott.
Regards.
Re: check_by_ssh -C problem
And I tried with multiple -C too, but only executes the first command:
check_by_ssh -t 90 -H localhost -l <user> -p 3331 -s c1:c2:c3 -C "date" -C "uptime" -C "whoami"
Tue Apr 17 08:14:36 CUT 2012
Is there anything wrong?
Thanks.
check_by_ssh -t 90 -H localhost -l <user> -p 3331 -s c1:c2:c3 -C "date" -C "uptime" -C "whoami"
Tue Apr 17 08:14:36 CUT 2012
Is there anything wrong?
Thanks.
Re: check_by_ssh -C problem
Hi.
Ijust resolved my problem.
defining $USERX$=; in resource.cfg file . . . .
then . . . .
./check_by_ssh -t XX -H localhost -l <user> -p <port> -C "cd $ARGS1$ $USERX$ ./check_cpu_stats.sh -w <WARN> -c <CRIT>"
Tks.
Ijust resolved my problem.
defining $USERX$=; in resource.cfg file . . . .
then . . . .
./check_by_ssh -t XX -H localhost -l <user> -p <port> -C "cd $ARGS1$ $USERX$ ./check_cpu_stats.sh -w <WARN> -c <CRIT>"
Tks.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_by_ssh -C problem
That's a unique way to do it. glad you got it resolved