Xymon Mailing List Archive search

Sending client data without client installed

6 messages in this thread

list Raymond Lee · Tue, 30 Oct 2012 16:22:06 -0400 ·
Greetings,

I have a Cisco ACS appliance that runs a CentOS-based OS.  I cannot install
the Xymon client on it, but I can ssh to it from our Xymon server and run
"show tech-support" to get the output of a long list of commands that
include df -k, ps -aux, netstat -an, etc., and save the output to a file.

The output has section headers, so it's easy to parse out each of the
command outputs that I'm interested in with a Perl script.  I was thinking
to have the same Perl script look at each of the command outputs and apply
some logic to them to determine what color their status should be and then
do a ' bb localhost "status hostname.disk COLOR <additional text>" '.  Same
idea for hostname.procs, hostname.ports, etc.

But this would essentially be like rewriting the Xymon client.  Since I
already have the outputs of df -k, ps -aux, netstat -an, etc., can I just
send them to the Xymon server and have it magically know what to do with
them to populate the disk, procs, and ports columns?

I've already seen the tip at
http://www.xymon.com/xymon/help/xymon-tips.html#noinstall , but that
doesn't apply to my scenario.  I also looked into using devmon, but the
MIBs that Cisco ACS supports don't give me the data I'm looking for.

Thanks,
Ray
list Henrik Størner · Tue, 30 Oct 2012 23:03:34 +0100 ·
quoted from Raymond Lee
On 30-10-2012 21:22, Raymond Lee wrote:
I have a Cisco ACS appliance that runs a CentOS-based OS.  I cannot
install the Xymon client on it, but I can ssh to it from our Xymon
server and run "show tech-support" to get the output of a long list of
commands that include df -k, ps -aux, netstat -an, etc., and save the
output to a file.
[...] can I
just send them to the Xymon server and have it magically know what to do
with them to populate the disk, procs, and ports columns?
If you modify the data you have to that the command outputs have the headers that Xymon expects - the "[df]", "[ps]" etc section markers, see the "client data" from one of your other servers - then there is a fair chance that it might work.

In other words, if you can make your data look like what e.g. a Linux client would send, then it should work with Xymon.

The way to send the data off to Xymon would then be

    xymon 10.0.0.1 "@" < datafile

and your datafile would have to begin with a line

    client myhostname.linux cisco_acs

The "linux" part means that it will be interpreted by the Linux client handler; "cisco_acs" defines the configuration "class" that you can optionally use in the analysis.cfg to write common rules for all of your ACS systems.

The worst that can happen is that you won't see any statuses on your Xymon webpage; then we'll have to dig into the xymond/client/linux.c code to see how it is interpreted.


Regards,
Henrik
list Raymond Lee · Wed, 31 Oct 2012 12:01:08 -0400 ·
quoted from Henrik Størner
On Tue, Oct 30, 2012 at 6:03 PM, Henrik Størner <user-ce4a2c883f75@xymon.invalid> wrote:
On 30-10-2012 21:22, Raymond Lee wrote:
I have a Cisco ACS appliance that runs a CentOS-based OS.  I cannot
install the Xymon client on it, but I can ssh to it from our Xymon
server and run "show tech-support" to get the output of a long list of
commands that include df -k, ps -aux, netstat -an, etc., and save the
output to a file.
[...] can I

just send them to the Xymon server and have it magically know what to do
with them to populate the disk, procs, and ports columns?
If you modify the data you have to that the command outputs have the
headers that Xymon expects - the "[df]", "[ps]" etc section markers, see
the "client data" from one of your other servers - then there is a fair
chance that it might work.

In other words, if you can make your data look like what e.g. a Linux
client would send, then it should work with Xymon.
Yup, I was already going down that route while parsing the output from the
Cisco ACS command.
quoted from Henrik Størner

The way to send the data off to Xymon would then be

   xymon 10.0.0.1 "@" < datafile

and your datafile would have to begin with a line

   client myhostname.linux cisco_acs

The "linux" part means that it will be interpreted by the Linux client
handler; "cisco_acs" defines the configuration "class" that you can
optionally use in the analysis.cfg to write common rules for all of your
ACS systems.

The worst that can happen is that you won't see any statuses on your Xymon
webpage; then we'll have to dig into the xymond/client/linux.c code to see
how it is interpreted.
Wow, this worked perfectly!  I can see the columns on the webpage now.
Thanks, Henrik!


-Ray

Regards,
Henrik

______________________________**
Xymon at xymon.com<
list Andy Smith · Wed, 31 Oct 2012 18:58:06 +0000 ·
quoted from Raymond Lee
Raymond Lee wrote:
On Tue, Oct 30, 2012 at 6:03 PM, Henrik Størner <user-ce4a2c883f75@xymon.invalid <mailto:user-ce4a2c883f75@xymon.invalid>> wrote:

    On 30-10-2012 21:22, Raymond Lee wrote:

        I have a Cisco ACS appliance that runs a CentOS-based OS.  I cannot
        install the Xymon client on it, but I can ssh to it from our Xymon
        server and run "show tech-support" to get the output of a long
        list of
        commands that include df -k, ps -aux, netstat -an, etc., and
        save the
        output to a file.
        [...] can I

        just send them to the Xymon server and have it magically know
        what to do
        with them to populate the disk, procs, and ports columns?


    If you modify the data you have to that the command outputs have the
    headers that Xymon expects - the "[df]", "[ps]" etc section markers,
    see the "client data" from one of your other servers - then there is
    a fair chance that it might work.

    In other words, if you can make your data look like what e.g. a
    Linux client would send, then it should work with Xymon.


Yup, I was already going down that route while parsing the output from the Cisco ACS command.

 
    The way to send the data off to Xymon would then be

       xymon 10.0.0.1 "@" < datafile

    and your datafile would have to begin with a line

       client myhostname.linux cisco_acs

    The "linux" part means that it will be interpreted by the Linux
    client handler; "cisco_acs" defines the configuration "class" that
    you can optionally use in the analysis.cfg to write common rules for
    all of your ACS systems.

    The worst that can happen is that you won't see any statuses on your
    Xymon webpage; then we'll have to dig into the xymond/client/linux.c
    code to see how it is interpreted.


Wow, this worked perfectly!  I can see the columns on the webpage now.  Thanks, Henrik!


-Ray

 
    Regards,
    Henrik

    <

Maybe too late now, but I have had good success with this for various linux based appliances :-

http://tools.rebel-it.com.au/xymon-rclient/
-- 
Andy
list Jeremy Laidman · Fri, 9 Nov 2012 10:29:52 +1100 ·
quoted from Andy Smith
On 1 November 2012 05:58, Andy Smith <user-982f5f6d4d28@xymon.invalid> wrote:
Raymond Lee wrote:
Maybe too late now, but I have had good success with this for various
linux based appliances :-

http://tools.rebel-it.com.au/**xymon-rclient/<http://tools.rebel-it.com.au/xymon-rclient/>;

(and now listed on Xymonton)

Great to hear this is getting some use.

In theory, this should work with a suitable client script in client/bin
called something like xymonclient-cisco_acs.sh, probably based on the
xymonclient-linux.sh.

But if you only have one type of appliance, a custom script like Henrik
suggested (and Raymond implemented) is a much simpler solution.

Raymond, it would be good to see your final solution to this.

J
list Raymond Lee · Fri, 9 Nov 2012 14:39:11 -0500 ·
quoted from Jeremy Laidman
On Thu, Nov 8, 2012 at 6:29 PM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid> wrote:
On 1 November 2012 05:58, Andy Smith <user-982f5f6d4d28@xymon.invalid> wrote:
Raymond Lee wrote:
Maybe too late now, but I have had good success with this for various linux based appliances :-

http://tools.rebel-it.com.au/xymon-rclient/

(and now listed on Xymonton)

Great to hear this is getting some use.

In theory, this should work with a suitable client script in client/bin called something like xymonclient-cisco_acs.sh, probably based on the xymonclient-linux.sh.

But if you only have one type of appliance, a custom script like Henrik suggested (and Raymond implemented) is a much simpler solution.

Raymond, it would be good to see your final solution to this.

I won't go into too much detail about my scripts, but I did just what
Henrik suggested:


Step 1:  I use Expect to ssh to the Cisco ACS appliance and grab the
output of the "show tech-support" command.

Step 2:  The output from the above command contains sections that show
'df -k', 'uname -a', 'ifconfig -a', 'netstat -an', etc., so I parse it
with Perl and build a file that looks something like this:

client myhostname.linux cisco_acs
[date]
Fri Nov  9 13:03:53 CST 2012
[uname]
(output of 'uname -a')
[osversion]
CentOS release 4.7 (Final)
[uptime]
(output of 'uptime')
[df]
(output of 'df -k')
[mount]
(output of 'mount')
[free]
(output of 'free')
[ifconfig]
(output of 'ifconfig -a')
[route]
(output of 'netstat -rn')
[ports]
(output of 'netstat -an')
[ifstat]
(output of 'ifconfig -a')
[ps]
(output of 'ps -ef')
[msgs:/var/log/messages]
(last 100 lines of /var/log/messages)


Basically, you want to build a file that looks like the page you see
when you go to https://yourxymonserver/xymon-cgi/svcstatus.sh?CLIENT=clienthostname.
 You don't necessarily need to include every [section] header if
they're not available to you...just fill out whatever you have or
whatever you're interested in.


Step 3:  on the Xymon server, I feed it that client data file from
above with the command 'xymon localhost "@" < clientdatafile'


That's it!  Xymon magic happens from there, and you should start
seeing columns being updated on your Xymon web page.


- Ray

J