Duplicate only perfdata to other gearman server

51 views
Skip to first unread message

bjornf

unread,
Aug 10, 2017, 12:16:54 PM8/10/17
to mod_gearman
Hi,

Is it possible that mod-gearman module can send only and all perfdata to two different Gearman servers or perhaps an additional queue on the same Gearman server?

I want to have two different servers graphing. 

I see the "dupserver" directive but unsure what happens to all non perfdata then. 

Regards, Bjorn

Sven Nierlein

unread,
Aug 10, 2017, 2:29:57 PM8/10/17
to mod_g...@googlegroups.com, bjornf
You could load the module twice with a different configuration file.
> --
> You received this message because you are subscribed to the Google Groups "mod_gearman" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mod_gearman...@googlegroups.com <mailto:mod_gearman...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Message has been deleted

bjornf

unread,
Aug 10, 2017, 4:24:58 PM8/10/17
to mod_gearman, bjorn.f...@gmail.com
Interesting option. Do you believe it has any(bigger) performance drawback?

You mean something like this in naemon.cfg:

broker_module=/usr/lib64/mod_gearman/mod_gearman_naemon.o server=x.x.x.x:4730 perfdata=yes eventhandler=yes services=yes hosts=yes config=/etc/mod_gearman/module.conf

broker_module=/usr/lib64/mod_gearman/mod_gearman_naemon.o server=y.y.y.y:4730 perfdata=yes eventhandler=no services=no hosts=no config=/etc/mod_gearman/module2.conf

Then in "/etc/mod_gearman/module2.conf" only deal with perfdata?

services=no
hosts=no
do_hostchecks=no
perfdata=yes

?

Not quite sure what takes precedence, arguments to mod_gearman_naemon.o or the module.conf file. 

When testing above, no perfdata seems to end up in Gearman server y.y.y.y.  Can really the same exact module be loaded twice?

Regards, Bjorn
Message has been deleted

Sven Nierlein

unread,
Aug 11, 2017, 5:44:43 AM8/11/17
to mod_g...@googlegroups.com, bjornf
On 11/08/17 9:20, bjornf wrote:
> Btw, the dupserver directive is not of use here?

No, that option is not meant to be for performance data.

Sven Nierlein

unread,
Aug 11, 2017, 5:48:54 AM8/11/17
to mod_g...@googlegroups.com, bjornf
On 10/08/17 22:24, bjornf wrote:
> Interesting option. Do you believe it has any(bigger) performance drawback?

No, this should have very little performance impact.


> You mean something like this in naemon.cfg:
>
> broker_module=/usr/lib64/mod_gearman/mod_gearman_naemon.o server=x.x.x.x:4730 perfdata=yes eventhandler=yes services=yes hosts=yes config=/etc/mod_gearman/module.conf
>
> broker_module=/usr/lib64/mod_gearman/mod_gearman_naemon.o server=y.y.y.y:4730 perfdata=yes eventhandler=no services=no hosts=no config=/etc/mod_gearman/module2.conf
>
> Then in "/etc/mod_gearman/module2.conf" only deal with perfdata?
>
> services=no
> hosts=no
> do_hostchecks=no
> perfdata=yes
>
> ?
>
> Not quite sure what takes precedence, arguments to mod_gearman_naemon.o or the module.conf file.

You can set all options from the broker_module line as well as in a config file. In fact, the config=... options can be read as an "include". So the precedence is from left to right with the last option overrides the previous setting. A config= option is optional, you can set everything directly if you want.


> When testing above, no perfdata seems to end up in Gearman server y.y.y.y. Can really the same exact module be loaded twice?

Yes, the same module can be loaded as often as you want. We have the exact same setup running for some customers.

Cheers,
Sven

bjornf

unread,
Aug 11, 2017, 3:05:49 PM8/11/17
to mod_gearman, bjorn.f...@gmail.com
Unable to get any perfdata into 2nd Gearman-server.  You mind sharing the broker and module conf for when you have it working?

Seems if I put the perfdata only mod-gearman first in naemon.cfg it breaks for the other. If I put it after it gets nothing. 

Name        : naemon
Arch        : x86_64
Version     : 1.0.6

Name        : mod_gearman
Arch        : x86_64
Version     : 3.0.1

Regards, Bjorn

bjornf

unread,
Aug 12, 2017, 5:20:56 AM8/12/17
to mod_gearman, bjorn.f...@gmail.com
Seems mod-gearman module does not even connect to gearmand.

broker_module=/usr/lib64/mod_gearman/mod_gearman_naemon.o server=127.0.0.1:4730 perfdata=yes eventhandler=no services=no hosts=no key=xxxxx debug=4 do_hostchecks=no logfile=/var/log/mod_gearman2/mod_gearman_neb-perfdata.log result_workers=0 perfdata_mode=1 perfdata_send_all=yes result_queue= use_uniq_jobs=off

/var/log/mod_gearman2/mod_gearman_neb-perfdata.log:
[2017-08-12 11:14:46][23447][DEBUG] --------------------------------
[2017-08-12 11:14:46][23447][DEBUG] configuration:
[2017-08-12 11:14:46][23447][DEBUG] log level:                       4
[2017-08-12 11:14:46][23447][DEBUG] log mode:                        file (1)
[2017-08-12 11:14:46][23447][DEBUG] queue by cust var:               no
[2017-08-12 11:14:46][23447][DEBUG] debug result:                    no
[2017-08-12 11:14:46][23447][DEBUG] result_worker:                   0
[2017-08-12 11:14:46][23447][DEBUG] do_hostchecks:                   no
[2017-08-12 11:14:46][23447][DEBUG] route_eventhandler_like_checks:  no
[2017-08-12 11:14:46][23447][DEBUG] result_queue:
[2017-08-12 11:14:46][23447][DEBUG]
[2017-08-12 11:14:46][23447][DEBUG] server:                          127.0.0.1:4730
[2017-08-12 11:14:46][23447][DEBUG]
[2017-08-12 11:14:46][23447][DEBUG]
[2017-08-12 11:14:46][23447][DEBUG] perfdata:                        yes
[2017-08-12 11:14:46][23447][DEBUG] perfdata mode:                   overwrite
[2017-08-12 11:14:46][23447][DEBUG] hosts:                           no
[2017-08-12 11:14:46][23447][DEBUG] services:                        no
[2017-08-12 11:14:46][23447][DEBUG] eventhandler:                    no
[2017-08-12 11:14:46][23447][DEBUG]
[2017-08-12 11:14:46][23447][DEBUG] encryption:                      yes
[2017-08-12 11:14:46][23447][DEBUG] keyfile:                         no
[2017-08-12 11:14:46][23447][DEBUG] encryption key:                  set
[2017-08-12 11:14:46][23447][DEBUG] accept clear result:             no
[2017-08-12 11:14:46][23447][DEBUG] transport mode:                  aes-256+base64
[2017-08-12 11:14:46][23447][DEBUG] use uniq jobs:                   no
[2017-08-12 11:14:46][23447][DEBUG] --------------------------------
[2017-08-12 11:14:46][23447][TRACE] create_client()
[2017-08-12 11:14:46][23447][DEBUG] finished initializing

I see no connection in gearmand.log, not in netstat output either. 

Sven Nierlein

unread,
Aug 12, 2017, 5:26:22 AM8/12/17
to mod_g...@googlegroups.com, bjornf
On 12/08/17 11:20, bjornf wrote:
> Seems mod-gearman module does not even connect to gearmand.

This is the latest mod-gearman release, right?
There is a perfdata_send_all=yes config option, which sends performance data
regardless of the process_performance_data setting of the host/service.

bjornf

unread,
Aug 12, 2017, 12:59:03 PM8/12/17
to mod_gearman, bjorn.f...@gmail.com
I was on 3.0.1 but upgraded now to 3.0.4. Still the same thing.

If the perfdata-only mod_gearman module is loaded 2nd. It does nothing. Or at least does not connect to gearmand.

If I load it first, before the "normal" mod_gearman module it breaks everything. Trying to execute checks and I get these errors on plugin output:

(No output on stdout) stderr: execvp(/opt/nagios/libexec/check_icmp-mod, ...) failed. errno is 2: No such file or directory

broker_module=/usr/lib64/mod_gearman/mod_gearman_naemon.o server=127.0.0.1:4730 perfdata=yes eventhandler=no services=no hosts=no key=xxxxxx debug=4 do_hostchecks=no logfile=/var/log/mod_gearman2/mod_gearman_neb-perfdata.log result_workers=0 perfdata_mode=1 perfdata_send_all=yes result_queue= use_uniq_jobs=off

broker_module=/usr/lib64/mod_gearman/mod_gearman_naemon.o server=192.168.5.12:4730 perfdata=yes eventhandler=yes services=yes hosts=yes config=/etc/mod_gearman/module.conf

Any essential setting I'm missing!?

Regards, Bjorn

bjornf

unread,
Aug 15, 2017, 9:45:47 AM8/15/17
to mod_gearman, bjorn.f...@gmail.com
Hi Sven,

Sorry to bother you(again) but still can't get this to work. Only the mod-gearman module loaded first gets/fetches the perfdata. 

I saw this from 3.x release notes:

- support multiple perfdata queues 

What does this really mean? How is that configured?

Regards, Bjorn

bjornf

unread,
Aug 15, 2017, 10:20:48 AM8/15/17
to mod_gearman, bjorn.f...@gmail.com
I'll answer myself, in case someone is interested.

I found that changing in module.conf:

perfdata=yes

to:

perfdata=perfdata,perfdata2

This creates two queues on the same gearmand server, perfdata and perfdata2 which both gets all perfdata. I really did not need a separate gearmand server, just two different perfdata queues pulled by two different servers/programs. So, this seems to work for me. 
Reply all
Reply to author
Forward
0 new messages