Nagios Notifications with mod_gearman

52 views
Skip to first unread message

Kobus Bensch

unread,
Jun 25, 2020, 4:48:41 AM6/25/20
to mod_gearman
Good morning

The stats: Host Information  Nagios® Core™ 4.4.5

mod_gearman: v0.33

all running on a CentOS 7 box with postfix, patched to the latest.

I have recently set this up and everything is working fine except for notifications. After digging around for some time I disabled this line in the nagios.cfg file: broker_module=/usr/lib64/mod_gearman/mod_gearman_nagios4.o config=/etc/mod_gearman/worker.conf

and et voila, notifications works as expected. Now, my question is, what config do i need to add to the mod_gearman module to enable sending of notifications?

here is my mod_gearman module config as I have searched around extensively but just can find what I need to add: debug=1

logfile=/var/log/mod_gearman/mod_gearman.log

server=10.12.57.228:4730

server=127.0.0.1:4730

eventhandler=yes

notifications=yes

services=yes hosts=yes

do_hostchecks=yes

route_eventhandler_like_checks=no

encryption=yes key=ytNdffaertgrthtyityreaerwqeqwrwerttryd30donPn0v6lK7kfMUp0G0He0N7

use_uniq_jobs=on

localhostgroups=

localservicegroups=

result_workers=1

perfdata=yes

perfdata_send_all=yes

perfdata_mode=1

orphan_host_checks=yes

orphan_service_checks=yes

orphan_return=2

accept_clear_results=no

Any help would be really great.

Thank you

Kobus

Kobus Bensch

unread,
Jun 25, 2020, 4:50:37 AM6/25/20
to mod_gearman
This is the current status:
gearadmin --status
worker_harro-ap-southeast-1-001    0    0    1
hostgroup_harro-ap-southeast-1-001    0    0    20
worker_harro-us-east-1-014    0    0    1
hostgroup_harro-us-east-1-012    0    0    20
worker_harro-us-east-1-012    0    0    1
hostgroup_harro-us-east-1-014    0    0    20
worker_harro-eu-west-1-008    0    0    1
worker_harro-eu-west-1-001    0    0    1
worker_harro-eu-north-1-001    0    0    1
worker_harro-eu-west-2-001    0    0    1
worker_harro-stg-eu-west-2-001    0    0    1
hostgroup_harro-eu-west-1-008    0    0    20
hostgroup_harro-eu-north-1-001    0    0    20
hostgroup_harro-eu-west-1-001    0    0    20
hostgroup_harro-stg-eu-west-2-001    0    0    20
eventhandler    0    0    160
notification    0    0    160
hostgroup_harro-eu-west-2-001    0    0    20
dummy    0    0    170
host    128    0    0
service    803    0    0
check_results    0    0    2

Sven Nierlein

unread,
Jun 25, 2020, 5:04:50 AM6/25/20
to mod_g...@googlegroups.com, Kobus Bensch
Seems like you don't have any worker running the notifications queue. Check your workers config.

Cheers,
Sven
> server=10.12.57.228:4730 <http://10.12.57.228:4730>
>
> server=127.0.0.1:4730 <http://127.0.0.1:4730>
>
> eventhandler=yes
>
> notifications=yes
>
> services=yes hosts=yes
>
> do_hostchecks=yes
>
> route_eventhandler_like_checks=no
>
> encryption=yes key=ytNdffaertgrthtyityreaerwqeqwrwerttryd30donPn0v6lK7kfMUp0G0He0N7
>
> use_uniq_jobs=on
>
> localhostgroups=
>
> localservicegroups=
>
> result_workers=1
>
> perfdata=yes
>
> perfdata_send_all=yes
>
> perfdata_mode=1
>
> orphan_host_checks=yes
>
> orphan_service_checks=yes
>
> orphan_return=2
>
> accept_clear_results=no
>
> Any help would be really great.
>
> Thank you
>
> Kobus
>
> --
> 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>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mod_gearman/43619c7e-d25d-4349-9991-8dec28fb35fcn%40googlegroups.com <https://groups.google.com/d/msgid/mod_gearman/43619c7e-d25d-4349-9991-8dec28fb35fcn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Kobus Bensch

unread,
Jun 25, 2020, 5:14:08 AM6/25/20
to mod_gearman
Thank you Sven
I have just searched for the config directives I need, but I am missing something and I cant find what it is. Here is my worker config:
worker.conf
identifier=harro-eu-north-1-001

debug=0

logfile=/var/log/mod_gearman/mod_gearman_worker.log

server=10.10.10.10:4730

eventhandler=yes
notifications=yes
services=no
hosts=no

hostgroups=harro-eu-north-1-001
#servicegroups=name1,name2,name3

encryption=yes
key=123G0He0N7
job_timeout=60
min-worker=20
max-worker=60
idle-timeout=30
max-jobs=1000
max-age=60
spawn-rate=2
fork_on_exec=yes
load_limit1=0
load_limit5=0
load_limit15=0
show_error_output=yes

timeout_return=2

enable_embedded_perl=off
use_embedded_perl_implicitly=off
use_perl_cache=on
p1_file=/usr/share/mod_gearman/mod_gearman_p1.pl

# gearman_connection_timeout=-1

restrict_path=/usr/lib64/nagios/plugins/

#restrict_command_characters=$&();<>`"'|

# workaround for rc 25 bug
# duplicate jobs from gearmand result in exit code 25 of plugins
# because they are executed twice and get killed because of using
# the same ressource.
# Sending results (when exit code is 25 ) will be skipped with this
# enabled.
workaround_rc_25=off

Sven Nierlein

unread,
Jun 25, 2020, 5:15:34 AM6/25/20
to mod_g...@googlegroups.com, Kobus Bensch

Kobus Bensch

unread,
Jun 25, 2020, 5:29:03 AM6/25/20
to Sven Nierlein, mod_g...@googlegroups.com
It is, but I have the same issue with all of the workers sending to this
nagios server. None of the notifications are sent out.
--

Kobus Bensch - Senior Systems Engineer
Yospace - The Dynamic Ad Insertion Company
Church House, 18-20 Church Street, Staines TW18 4EP
Switchboard: +44 1784 466388 Ext. 217 | Fax: +44 1784 466387
Technical Support: +44 1784 818312 - sup...@yospace.com
http://www.yospace.com

Kobus Bensch

unread,
Jun 25, 2020, 5:40:01 AM6/25/20
to mod_gearman
Question:
If i set the notifications on worker and module to no, will that mean that nagios will just send notifications as normal?

Sven Nierlein

unread,
Jun 25, 2020, 5:42:09 AM6/25/20
to mod_g...@googlegroups.com, Kobus Bensch
On 25.06.20 11:40, Kobus Bensch wrote:
> Question:
> If i set the notifications on worker and module to no, will that mean that nagios will just send notifications as normal?

Exactly

Kobus Bensch

unread,
Jun 25, 2020, 6:00:39 AM6/25/20
to Sven Nierlein, mod_g...@googlegroups.com
Hi

Still no alerts. I have disabled notifications for the 8 workers and on
the nagios module gearman and still no alerts. Do i need to change
anything else?

Kobus Bensch

unread,
Jun 25, 2020, 6:03:35 AM6/25/20
to Sven Nierlein, mod_g...@googlegroups.com
Also, the other thing I am now seeing is that the notification queue
jobs waiting is rising.

On 25/06/2020 10:42, Sven Nierlein wrote:

Kobus Bensch

unread,
Jun 25, 2020, 6:11:44 AM6/25/20
to Sven Nierlein, mod_g...@googlegroups.com
Me again. I got it sorted. I been looking at it so long that I missed a
very simple but significant typo. your suggestion got me onto that. thanks

On 25/06/2020 10:42, Sven Nierlein wrote:

Sven Nierlein

unread,
Jun 25, 2020, 6:13:00 AM6/25/20
to Kobus Bensch, mod_g...@googlegroups.com
On 25.06.20 12:11, Kobus Bensch wrote:
> Me again. I got it sorted. I been looking at it so long that I missed a very simple but significant typo. your suggestion got me onto that. thanks

Great :-)

Kobus Bensch

unread,
Jun 25, 2020, 6:23:59 AM6/25/20
to mod_gearman
It seems that i still need to leave the notifications=no and not yes in all of the worker and module configs. Is that right?

Sven Nierlein

unread,
Jun 25, 2020, 6:36:48 AM6/25/20
to mod_g...@googlegroups.com, Kobus Bensch
Disabling notifications in the module itself would be sufficient.
> --
> 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>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mod_gearman/415532c9-68b5-4c7a-8590-6867ffa1bab2n%40googlegroups.com <https://groups.google.com/d/msgid/mod_gearman/415532c9-68b5-4c7a-8590-6867ffa1bab2n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages