Xymon Mailing List Archive search

Graphing terminal server connection issue

5 messages in this thread

list Steve B · Mon, 23 Nov 2015 16:00:07 +0100 ·
Hi all,

I am having an issue with graphing a powershell script that announces how
many connections we have to RDS farm environment.

The html output (which contains the info I want to graph) is as such:

</style> </head><body> <h2>Terminal Server Status</h2><br><b>Total users:
23<br>Active Sessions: 19 <br>Disconnected Sessions: 4</b><br><br><table
class="NormalTable"><colgroup><col /><col /><col /><col /><col /><col
/></colgroup><tr><th>Username</th><th>Session Name</th><th>Session
ID</th><th>State</th><th>Idle Time (hh:mm)</th><th>Login
etc.......................

This is all on same line and there is a lot more info about the table and
CSS. Is CSS ok with rrd graphing and Xymon?

In xymonserver.cfg, I have termusers=ncv and termusers listed in GRAPHS=
At the end of the file (just to simplify as it wasn't working) I have

NCV_termusers="ActiveSessions:GAUGE,*:NONE"

In graphs.cfg (but there is no rrd file as yet) I have:

[termusers]
        TITLE Terminal Server Users
        YAXIS Users
        DEF:active=termusers.rrd:ActiveSessions:AVERAGE
        DEF:disc=termusers.rrd:DisconnectedSessions:AVERAGE
        LINE2:active#00CCCC:Active Users
        LINE2:disc#FF0000:Disconnected Users
        COMMENT:\n
        GPRINT:active:LAST:Active Users        \: %5.1lf%s (cur)
        GPRINT:active:MAX: \: %5.1lf%s (max)
        GPRINT:active:MIN: \: %5.1lf%s (min)
        GPRINT:active:AVERAGE: \: %5.1lf%s (avg)\n
        GPRINT:disc:LAST:Disconnected Users  \: %5.1lf%s (cur)
        GPRINT:disc:MAX: \: %5.1lf%s (max)
        GPRINT:disc:MIN: \: %5.1lf%s (min)
        GPRINT:disc:AVERAGE: \: %5.1lf%s (avg)\n

But it won't create the rrd file and I am pretty sure this is because of
the output, there is something in there that creates an issue.

1) any tips on how to diagnose this type of problem more efficiently?
2) anyone had a similar issue when graphing from POWERSHELL or similar to
mine?

The old termusers scripts (possibly from Xymonton) used to graph properly
but when my colleague made the PowerShell version, the graphing never
worked.

Thanks!
list Jeremy Laidman · Mon, 23 Nov 2015 22:56:08 +0000 ·
Steve
quoted from Steve B

On Tue, Nov 24, 2015 at 2:00 AM Steve B <user-df463d3c0721@xymon.invalid> wrote:
This is all on same line and there is a lot more info about the table and
CSS. Is CSS ok with rrd graphing and Xymon?
I think this is the problem.  The NCV parsing code expects the A:B (or A=B)
terms to be separated by newlines.  Essentially it reads in each line,
looks for the first A:B and then skips to the next line.

I don't think CSS is a problem.

J
list Jeremy Laidman · Mon, 23 Nov 2015 23:03:51 +0000 ·
On Tue, Nov 24, 2015 at 9:56 AM Jeremy Laidman <user-71895fb2e44c@xymon.invalid>
wrote:
I don't think CSS is a problem.
Although HTML markup before the NCV term will possibly lead to problems.
The man page says:

"Note that each "NAME : value" must be on a line by itself. If you have a
custom script generating the status- or data-message that is fed into the
NCV handler, make sure it inserts a newline before each of the data-items
you want to track"

J
list Steve B · Tue, 24 Nov 2015 15:03:35 +0100 ·
Thanks Jeremy, much appreciated. Have discussed with my colleague and he
will be tweaking his script accordingly.  Sure it will work after that!

Cheers

Steve

On Tue, Nov 24, 2015 at 12:03 AM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid>
quoted from Jeremy Laidman
wrote:
On Tue, Nov 24, 2015 at 9:56 AM Jeremy Laidman <user-71895fb2e44c@xymon.invalid>
wrote:
I don't think CSS is a problem.
Although HTML markup before the NCV term will possibly lead to problems.
The man page says:

"Note that each "NAME : value" must be on a line by itself. If you have a
custom script generating the status- or data-message that is fed into the
NCV handler, make sure it inserts a newline before each of the data-items
you want to track"

J
list Japheth Cleaver · Tue, 24 Nov 2015 11:23:41 -0800 ·
quoted from Steve B
On Tue, November 24, 2015 6:03 am, Steve B wrote:
Thanks Jeremy, much appreciated. Have discussed with my colleague and he
will be tweaking his script accordingly.  Sure it will work after that!

Cheers

Steve

On Tue, Nov 24, 2015 at 12:03 AM, Jeremy Laidman
<user-71895fb2e44c@xymon.invalid>
wrote:
On Tue, Nov 24, 2015 at 9:56 AM Jeremy Laidman
<user-71895fb2e44c@xymon.invalid>
wrote:
I don't think CSS is a problem.
Although HTML markup before the NCV term will possibly lead to problems.
The man page says:

"Note that each "NAME : value" must be on a line by itself. If you have
a
custom script generating the status- or data-message that is fed into
the
NCV handler, make sure it inserts a newline before each of the
data-items
you want to track"

J

Depending on the nature of the script, if there's a lot of explanatory
HTML there to help humans read things, I've found it's easier to have all
that up front, and then list the few things I want to NCV-analyze down on
their own at the bottom.

At scale, you'd want to use the ncv_skipstart/skipend functionality that
was put in in 4.3.22, or list the NCV data at the start and everything
else below, but basically, don't be afraid to list the data components
twice if it gets too messy :)

https://xymon.com/help/manpages/man8/xymond_rrd.8.html#lbAH

HTH,
-jc