TS - Trying to combine graph and information on same ICON

d.tom.schmitt at L-3com.com d.tom.schmitt at L-3com.com
Mon Jun 14 22:15:23 CEST 2010


I have been trying to update data information and also create a graph
under the same ICON.

I have changed the colons ':' to html colons also and even that does not
do it.  : = : per an earlier email.

 

I have to split them into an icon called 'logins' for graphing and an
icon called 'who' for the 'who -u' output.

If I try to do them both to the same ICON, the graphing stops but the
data continues to be updated and displayed.

I currently have 3 logins going on the server:

                 

Here are the logins:

                 

 

What I want to do is get both under the same ICON name.  Do I need to do
something like 'data' instead of 'status' on the 'bb' line?

I placed both the data pair and the who info in the same 'status' call
to 'bb' and the graph stops.  The graph does not go away, 

the data points stop being accepted.

As long as I send the data to one icon and the graph pairs to another,
it works.

I am running 4.3.0-0.beta2 on CentOS.

                

Here is the simple script using 'who -u' as the data source:

# cat logins.sh

#!/bin/sh

#ident "@(#)logins.sh Ver. 1.0 Tom Schmitt  2010"

#-----------------------------------------------------------------------
--------

# Under GPL 2010 by Tom Schmitt   dtschmitt at gmail.com  801.446.5645

#-------------------------------------------------------

# From the HELP --> Custom Graphs in Xymon

# Installed by Tom Schmitt for test purposes

#-------------------------------------------------------

# Creates a graph of the number of logins under:  logins

# Lists those logged in under:  who

#-------------------------------------------------------

 

#-----------------------------------------------------------

# Setup these files:

#-----------------------------------------------------------

# Store this script at:

#       /home/xymon/client/ext as logins.sh

#       Make it executable:

#           cd /home/xymon/client/ext

#           chmod 755 logins

#-----------------------------------------------------------

# EDIT /home/xymon/client/etc/clientlaunch.cfg

# and add these lines:

#    # Tom Schmitt testing from Xymon HELP --> Custom Graphs

#    [loginsinfo]

#            ENVFILE /home/xymon/client/etc/hobbitclient.cfg

#            CMD /home/xymon/client/ext/logins.sh

#            INTERVAL 5m

#-----------------------------------------------------------

# EDIT /home/xymon/server/etc/hobbitserver.cfg

# and add/edit these lines:

#       TEST2RRD=" <at-the-end>,logins=ncv"

#       NCV_logins="logins:GAUGE"

#-----------------------------------------------------------

# EDIT /home/xymon/server/etc/hobbitgraph.cfg

# and add these lines:

#-----------------------------------------------------------

#       # Tom Schmitt Xymon HELP --> Custom Graphs

#       [logins]

#               TITLE Active Logins

#               YAXIS Logins

#               DEF:in=logins.rrd:logins:AVERAGE

#                       # Colors the area under the value

#               AREA:in#00CC00:Number of Logins

#                       # Or the next line for a LINE graph

#               LINE2:in#00CC00:Number of Logins

#               COMMENT:     Number of Active Logins\n

#       # End of Tom Schmitt Xymon HELP --> Custom Graphs

#-----------------------------------------------------------

# EDIT /home/xymon/server/etc/hobbitlaunch.cfg

# and verify these lines at the end of the file:

#       [hobbitclient]

#               ENVFILE /home/xymon/client/etc/hobbitclient.cfg

#               NEEDS hobbitd

#               CMD /home/xymon/client/bin/hobbitclient.sh

#               LOGFILE $BBSERVERLOGS/hobbitclient.log

#               INTERVAL 5m

#-----------------------------------------------------------

BB=/home/xymon/server/bin/bb    # Location of 'bb'

BBDISP=127.0.0.1                # Local display

MACHINE="monitorp.csw.l-3com.com"

 

LOGINS=`who -u | wc -l | awk '{print $1}'`

 

#-----------------------------------------------------

# Send the value pair for graphing under icon 'logins'

#-----------------------------------------------------

$BB $BBDISP "status $MACHINE.logins green

 

logins : $LOGINS

"

 

# Get the 'who -u' info and change all colons to:

#       : for an html colon

# Edit the colons ':' to be html colons ':'

# You don't want the data to look like value pairs:

#     (name : value) or (name = value) to Xymon

who -u >/tmp/logins.tom

sed -i 's/:/\&\#58\;/' /tmp/logins.tom

 

#--------------------------------------------------

# Send the list of those logged in under icon 'who'

#--------------------------------------------------

$BB $BBDISP "status $MACHINE.who green `date`

 

`cat /tmp/logins.tom`

"

 

rm /tmp/logins.tom 2>/dev/null

 

exit 0

[root at monitorp ext]#

 

 

The file with the colons changed looks like this:

 

                [root at monitorp ext]# cat /tmp/logins.temp 

root     pts/2        2010-06-14 07:32 01:10       13133
(dschmitt.csw.l-3com.com)

root     pts/3        2010-06-14 11:54   .         15324
(dschmitt.csw.l-3com.com)

root     pts/4        2010-06-14 12:32 00:51        1438
(dschmitt.csw.l-3com.com)

 

 

 

Thanks,

 

Tom Schmitt

Senior IT Staff - R&D

L-3 Communication Systems West

640 North 2200 West

P.O. Box 16850

Salt Lake City, UT  84116

Phone (801) 594-3030

Cell      (801) 231-7230

eFax    (413) 480-6873

D.Tom.Schmitt at L-3Com.com

           \\\\||////

             \ ~  ~ /  

             | @  @ |   

--oOo---(_)---oOo--

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20100614/93f7d33d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 3671 bytes
Desc: image002.jpg
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20100614/93f7d33d/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 8590 bytes
Desc: image004.jpg
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20100614/93f7d33d/attachment-0001.jpg>


More information about the Xymon mailing list