Xymon Mailing List Archive search

execute shell command on xymon clients

4 messages in this thread

list Deepak Deore · Mon, 3 Mar 2014 12:59:08 -0800 ·
Hi,

Is it possible to execute command on xymon clients and it will give reply/
results to the server. Other way is to ssh to every server and execute the
command but that is not possible in my environment.

Instead of searching another tool I just want to utilize existing xymon
server-client model to get the data. eg. use xymon client to pull the data
from xymon server and will be used for inventory etc.

Thanks,
Deepak
list Deepak Deore · Tue, 4 Mar 2014 08:53:24 -0800 ·
Has anyone any idea or thoughts on this ?
quoted from Deepak Deore


On Mon, Mar 3, 2014 at 12:59 PM, deepak deore <user-7b03b2a1ee70@xymon.invalid>wrote:
Hi,

Is it possible to execute command on xymon clients and it will give reply/
results to the server. Other way is to ssh to every server and execute the
command but that is not possible in my environment.

Instead of searching another tool I just want to utilize existing xymon
server-client model to get the data. eg. use xymon client to pull the data
from xymon server and will be used for inventory etc.

Thanks,
Deepak
list John Thurston · Tue, 04 Mar 2014 08:05:38 -0900 ·
quoted from Deepak Deore
On 3/4/2014 7:53 AM, deepak deore wrote:
Has anyone any idea or thoughts on this ?


On Mon, Mar 3, 2014 at 12:59 PM, deepak deore <user-7b03b2a1ee70@xymon.invalid>wrote:
Hi,

Is it possible to execute command on xymon clients and it will give reply/
results to the server.
I think what you are looking for are 'tasks' (In Big Brother, these sere 'ext' scripts).

" The tasks.cfg file holds the list of tasks that xymonlaunch runs to perform all of the tasks needed by the Xymon monitor. "

You may add to this list and Xymon will run the tasks at set intervals. You scripts may send messages to the Xymon server as part of their work.

See the man pages for the 'xymon' client syntax:
   http://www.xymon.com/xymon/help/manpages/man1/xymon.1.html

-- 
    Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Enterprise Technology Services
Department of Administration
State of Alaska
list Jeremy Laidman · Sat, 15 Mar 2014 09:28:05 +1100 ·
quoted from Deepak Deore
On 4 March 2014 07:59, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
Is it possible to execute command on xymon clients and it will give reply/
results to the server.
One way to do this is to create a pseudo-file entry in client-local.cfg.
 It gets really ugly if you want to do complicated stuff, but for a simple
check it can be very effective, and painless to roll out.  The purpose of
using backticks in a file clause is to allow dynamic filename generation,
such as when you need to monitor a file but the filename changes over time.
 However, we can (ab)use this feature for our own purposes.  Xymon just
wants the output, but if we generate no output, Xymon will silently ignore
it, and so we can do whatever else we want.  As a bonus, the Xymon client
will have already setup the environment for us to do things like sending a
status report to the Xymon server.

For example:

file:`( echo "client/xymonversion $MACHINE.$OSTYPE"; echo
"[clientversion]"; $XYMON --version ) | $XYMON $XYMSRV @ >/dev/null`

If I assign this to a server in client-local.cfg, it will execute the
commands within backticks, and as there's no final output, Xymon will
ignore it as a filename.  What this does is create a [clientversion]
section in a client message that shows the client version so that it shows
up in the host's "info" page.

The only constraints on what you can do with pseudo-files is that you can't
use colons or backticks.  There are ways to work around these limitations.

J