DISPLAYGROUP fails in analysis.cfg
list Dave "doughnut" Fogarty
I have a xymon server running "Debian GNU/Linux 9 (stretch)" with xymon
4.3.28-2. I'm having bad luck getting DISPLAYGROUP to work in
analysis.cfg. It seems to only match on the first 7 characters.
I also see this problem on "Debian GNU/Linux 8 (jessie)" with xymon 4.3.17-6+deb8u1.
Below, I've shown that the display group is set, and that the analysis.cfg
file is being parsed correctly by xymon, yet the the svcstatus page only
shows the shortest of the DISPLAYGROUP enabled lines.
root at misc-ten105-test:/etc/xymon# egrep -H Testnet.Database.Servers hosts.cfg
hosts.cfg:group Testnet Database Servers
root at misc-ten105-test:/etc/xymon# cat analysis.d/davetest.cfg
HOST=* EXCLASS=linux
PROC davetest-nonlinux 1 150 yellow
PROC davetest-Testnet.Database.Servers 1 150 yellow DISPLAYGROUP=%(Testnet.Database.Servers)
PROC davetest-Database 1 150 yellow DISPLAYGROUP=%(Database)
PROC davetest-Databas 1 150 yellow DISPLAYGROUP=%(Databas)
PROC davetest-Testnet.Database 1 150 yellow DISPLAYGROUP=%(Testnet.Database)
PROC davetest-Testnet.Data 1 150 yellow DISPLAYGROUP=%(Testnet.Data)
PROC davetest-Testnet.D 1 150 yellow DISPLAYGROUP=%(Testnet.D)
PROC davetest-Testnet. 1 150 yellow DISPLAYGROUP=%(Testnet.)
PROC davetest-Testnet 1 150 yellow DISPLAYGROUP=%(Testnet)
PROC davetest-Testne 1 150 yellow DISPLAYGROUP=%(Testne)
root at misc-ten105-test:/etc/xymon# sudo -u xymon xymoncmd xymond_client --dump-config | grep davetest
[...]
PROC davetest-nonlinux 1 150 yellow HOST=* EXCLASS=linux (line: 375)
PROC davetest-Testnet.Database.Servers 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.Database.Servers) EXCLASS=linux (line: 377)
PROC davetest-Database 1 150 yellow HOST=* DISPLAYGROUP=%(Database) EXCLASS=linux (line: 378)
PROC davetest-Databas 1 150 yellow HOST=* DISPLAYGROUP=%(Databas) EXCLASS=linux (line: 379)
PROC davetest-Testnet.Database 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.Database) EXCLASS=linux (line: 380)
PROC davetest-Testnet.Data 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.Data) EXCLASS=linux (line: 381)
PROC davetest-Testnet.D 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.D) EXCLASS=linux (line: 382)
PROC davetest-Testnet. 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.) EXCLASS=linux (line: 383)
PROC davetest-Testnet 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet) EXCLASS=linux (line: 384)
PROC davetest-Testne 1 150 yellow HOST=* DISPLAYGROUP=%(Testne) EXCLASS=linux (line: 385)
root at misc-ten105-test:/etc/xymon# lynx -dump -nolist 'http://localhost/xymon-cgi/svcstatus.sh?HOST=balin2012.collegenet.testnet&SERVICE=procs';
[...]
Xymon
balin2012.mydomain.testnet - procs
Wed Jul 11 13:29:40 2018
HISTORY
Wed Jul 11 13:29:40 2018 - Processes NOT ok
yellow davetest-nonlinux (found 0, req. between 1 and 150)
yellow davetest-Testnet (found 0, req. between 1 and 150)
yellow davetest-Testne (found 0, req. between 1 and 150)
Status unchanged in 8 days, 21 hours, 22 minutes
Status message received from 10.101.1.35
Client data available
list Jeremy Laidman
Dave A strange problem indeed. I've scanned the relevant parts of the code, and it all checks out, according to my amateur knowledge of C. What you're trying to do should work just fine. I wonder if it's just a coincidence that your group name starts with a 7-letter word. Probably. Perhaps you could have xymond_client run in debug mode (adding "--debug" in tasks.cfg), and see if it shows any clues in the log. FYI, another check the process status, without using the web interface (lynx/curl/wget) is to use the xymon command: $ xymoncmd $ XYMON $XYMONCMD "query balin2012.mydomain.testnet.procs" yellow Wed Jul 11 13:29:40 2018 - Processes NOT ok ... (etc) J On 12 July 2018 at 06:42, Dave "doughnut" Fogarty <user-138a88324cb7@xymon.invalid>
▸
wrote:
I have a xymon server running "Debian GNU/Linux 9 (stretch)" with xymon
4.3.28-2. I'm having bad luck getting DISPLAYGROUP to work in
analysis.cfg. It seems to only match on the first 7 characters.
I also see this problem on "Debian GNU/Linux 8 (jessie)" with xymon
4.3.17-6+deb8u1.
Below, I've shown that the display group is set, and that the analysis.cfg
file is being parsed correctly by xymon, yet the the svcstatus page only
shows the shortest of the DISPLAYGROUP enabled lines.
root at misc-ten105-test:/etc/xymon# egrep -H Testnet.Database.Servers
hosts.cfg hosts.cfg:group Testnet Database Servers
root at misc-ten105-test:/etc/xymon# cat analysis.d/davetest.cfg HOST=*
EXCLASS=linux
PROC davetest-nonlinux 1 150 yellow
PROC davetest-Testnet.Database.Servers 1 150 yellow
DISPLAYGROUP=%(Testnet.Database.Servers)
PROC davetest-Database 1 150 yellow DISPLAYGROUP=%(Database)
PROC davetest-Databas 1 150 yellow DISPLAYGROUP=%(Databas)
PROC davetest-Testnet.Database 1 150 yellow
DISPLAYGROUP=%(Testnet.Database)
PROC davetest-Testnet.Data 1 150 yellow
DISPLAYGROUP=%(Testnet.Data)
PROC davetest-Testnet.D 1 150 yellow DISPLAYGROUP=%(Testnet.D)
PROC davetest-Testnet. 1 150 yellow DISPLAYGROUP=%(Testnet.)
PROC davetest-Testnet 1 150 yellow DISPLAYGROUP=%(Testnet)
PROC davetest-Testne 1 150 yellow DISPLAYGROUP=%(Testne)
root at misc-ten105-test:/etc/xymon# sudo -u xymon xymoncmd xymond_client
--dump-config | grep davetest
[...]
PROC davetest-nonlinux 1 150 yellow HOST=* EXCLASS=linux (line: 375)
PROC davetest-Testnet.Database.Servers 1 150 yellow HOST=*
DISPLAYGROUP=%(Testnet.Database.Servers) EXCLASS=linux (line: 377)
PROC davetest-Database 1 150 yellow HOST=* DISPLAYGROUP=%(Database)
EXCLASS=linux (line: 378)
PROC davetest-Databas 1 150 yellow HOST=* DISPLAYGROUP=%(Databas)
EXCLASS=linux (line: 379)
PROC davetest-Testnet.Database 1 150 yellow HOST=*
DISPLAYGROUP=%(Testnet.Database) EXCLASS=linux (line: 380)
PROC davetest-Testnet.Data 1 150 yellow HOST=*
DISPLAYGROUP=%(Testnet.Data) EXCLASS=linux (line: 381)
PROC davetest-Testnet.D 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.D)
EXCLASS=linux (line: 382)
PROC davetest-Testnet. 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.)
EXCLASS=linux (line: 383)
PROC davetest-Testnet 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet)
EXCLASS=linux (line: 384)
PROC davetest-Testne 1 150 yellow HOST=* DISPLAYGROUP=%(Testne)
EXCLASS=linux (line: 385)
root at misc-ten105-test:/etc/xymon# lynx -dump -nolist 'http://localhost/xymon-cgi/svcstatus.sh?HOST=balin2012.coll egenet.testnet&SERVICE=procs'
▸
[...]
Xymon
balin2012.mydomain.testnet - procs
Wed Jul 11 13:29:40 2018
HISTORY
Wed Jul 11 13:29:40 2018 - Processes NOT ok
yellow davetest-nonlinux (found 0, req. between 1 and 150)
yellow davetest-Testnet (found 0, req. between 1 and 150)
yellow davetest-Testne (found 0, req. between 1 and 150)
Status unchanged in 8 days, 21 hours, 22 minutes
Status message received from 10.101.1.35
Client data available
list Dave "doughnut" Fogarty
Looks like I just found my answer in the source code. This is actually broken due to someone counting the number of characters incorrectly for a strncasecmp in client_config.c. It's done correctly later in the same code. This should be "13" and "15" where it's "12" and "14".
$ grep -n DISPLAYGROUP= client_config.c 466: (strncasecmp(token, "DISPLAYGROUP=", 12) == 0) ||
467: (strncasecmp(token, "EXDISPLAYGROUP=", 14) == 0) ||
667: else if (strncasecmp(tok, "DISPLAYGROUP=", 13) == 0) {
673: else if (strncasecmp(tok, "EXDISPLAYGROUP=", 15) == 0) {
...
Dave
▸
On Wed, 11 Jul 2018, Dave "doughnut" Fogarty wrote:
I have a xymon server running "Debian GNU/Linux 9 (stretch)" with xymon 4.3.28-2. I'm having bad luck getting DISPLAYGROUP to work in analysis.cfg. It seems to only match on the first 7 characters.
I also see this problem on "Debian GNU/Linux 8 (jessie)" with xymon 4.3.17-6+deb8u1.
Below, I've shown that the display group is set, and that the analysis.cfg file is being parsed correctly by xymon, yet the the svcstatus page only shows the shortest of the DISPLAYGROUP enabled lines.
root at misc-ten105-test:/etc/xymon# egrep -H Testnet.Database.Servers hosts.cfg hosts.cfg:group Testnet Database Servers
root at misc-ten105-test:/etc/xymon# cat analysis.d/davetest.cfg HOST=* EXCLASS=linux
PROC davetest-nonlinux 1 150 yellow
PROC davetest-Testnet.Database.Servers 1 150 yellow DISPLAYGROUP=%(Testnet.Database.Servers)
PROC davetest-Database 1 150 yellow DISPLAYGROUP=%(Database)
PROC davetest-Databas 1 150 yellow DISPLAYGROUP=%(Databas)
PROC davetest-Testnet.Database 1 150 yellow DISPLAYGROUP=%(Testnet.Database)
PROC davetest-Testnet.Data 1 150 yellow DISPLAYGROUP=%(Testnet.Data)
PROC davetest-Testnet.D 1 150 yellow DISPLAYGROUP=%(Testnet.D)
PROC davetest-Testnet. 1 150 yellow DISPLAYGROUP=%(Testnet.)
PROC davetest-Testnet 1 150 yellow DISPLAYGROUP=%(Testnet)
PROC davetest-Testne 1 150 yellow DISPLAYGROUP=%(Testne)
root at misc-ten105-test:/etc/xymon# sudo -u xymon xymoncmd xymond_client --dump-config | grep davetest
[...]
PROC davetest-nonlinux 1 150 yellow HOST=* EXCLASS=linux (line: 375)
PROC davetest-Testnet.Database.Servers 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.Database.Servers) EXCLASS=linux (line: 377)
PROC davetest-Database 1 150 yellow HOST=* DISPLAYGROUP=%(Database) EXCLASS=linux (line: 378)
PROC davetest-Databas 1 150 yellow HOST=* DISPLAYGROUP=%(Databas) EXCLASS=linux (line: 379)
PROC davetest-Testnet.Database 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.Database) EXCLASS=linux (line: 380)
PROC davetest-Testnet.Data 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.Data) EXCLASS=linux (line: 381)
PROC davetest-Testnet.D 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.D) EXCLASS=linux (line: 382)
PROC davetest-Testnet. 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet.) EXCLASS=linux (line: 383)
PROC davetest-Testnet 1 150 yellow HOST=* DISPLAYGROUP=%(Testnet) EXCLASS=linux (line: 384)
PROC davetest-Testne 1 150 yellow HOST=* DISPLAYGROUP=%(Testne) EXCLASS=linux (line: 385)
root at misc-ten105-test:/etc/xymon# lynx -dump -nolist 'http://localhost/xymon-cgi/svcstatus.sh?HOST=balin2012.collegenet.testnet&SERVICE=procs';
[...]
Xymon
balin2012.mydomain.testnet - procs
Wed Jul 11 13:29:40 2018
HISTORY
Wed Jul 11 13:29:40 2018 - Processes NOT ok
yellow davetest-nonlinux (found 0, req. between 1 and 150)
yellow davetest-Testnet (found 0, req. between 1 and 150)
yellow davetest-Testne (found 0, req. between 1 and 150)
Status unchanged in 8 days, 21 hours, 22 minutes
Status message received from 10.101.1.35
Client data available
list Jeremy Laidman
On Fri, 1 Feb 2019 at 10:48, Dave "doughnut" Fogarty <user-138a88324cb7@xymon.invalid>
▸
wrote:
Looks like I just found my answer in the source code. This is actually
broken due to someone counting the number of characters incorrectly for a
strncasecmp in client_config.c. It's done correctly later in the same
code. This should be "13" and "15" where it's "12" and "14".
$ grep -n DISPLAYGROUP= client_config.c
466: (strncasecmp(token, "DISPLAYGROUP=", 12) == 0) ||
467: (strncasecmp(token, "EXDISPLAYGROUP=", 14) == 0) ||
667: else if (strncasecmp(tok, "DISPLAYGROUP=", 13) ==
0) {
673: else if (strncasecmp(tok, "EXDISPLAYGROUP=", 15)
== 0) {
Very nice detective work, Dave. Have you re-compiled with adjustments and re-tested? J
list Dave "doughnut" Fogarty
▸
On Fri, 1 Feb 2019, Jeremy Laidman wrote:
Very nice detective work, Dave. Have you re-compiled with adjustments and re-tested?
Nope. We're running ours from Debian packages, so I'm several steps removed from that level of testing. I was hoping someone would be able to confirm more easily. If not, I'll work on it as time allows.
list Xymon
Hello
problem not solved.
I configured this setup:
hosts.cfg:
page Company some fantasy company
include /tmp/room1.cfg
include /tmp/room2.cfg
group house
include /tmp/room1.cfg
analysis.cfg:
DISPLAYGROUP=house
PROC %eecd 1 1
But it doesn’t matter what I do, all hosts are messured with “%eecd 1 1”, not just group “house”, also the hosts in /tmp/room2.cfg are affected.
So I can say DISPLAYGROUP is not working at all in analysis.cfg
In reality 300 hosts are affected.
Btw. same thing with subparent.
Also I know in version 4.3.18 in the Changelog they write something is solved with DISPLAYGROUP and analysed..but no clue if it is related to this issue:
"- xymond_client: Fix DISPLAYGROUP handling in analysis.cfg rules"
We are currently on version 4.3.28
Anyone knows about this ?
Tom