duplicate email seeing two nagios running

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
zaanen
Posts: 3
Joined: Tue Aug 26, 2014 2:53 am

duplicate email seeing two nagios running

Post by zaanen »

Hi all,

i have a strange problem and i try to figger out what is wrong.
When i stop nagios i see nothing is running. When i restart nagios i see 2 deamons and 4 workers.
This result probably in sending double emails to our contact groups.
We have only 1 contact group.

root@server:~/downloads# /etc/init.d/nagios stop
[ ok ] is running.
Stopping nagios:
root@server:~/downloads# ps -ef | grep nagios
nagios 24759 1 0 Jul29 ? 00:05:41 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
root 25066 24377 0 10:55 pts/0 00:00:00 grep nagios
root@server~/downloads# /etc/init.d/nagios start
[FAIL] is not running ... failed!
Starting nagios:
root@server:~/downloads# ps -ef | grep nagios
nagios 24759 1 0 Jul29 ? 00:05:41 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
nagios 25129 1 0 10:55 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 25130 25129 0 10:55 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 25131 25129 0 10:55 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 25132 25129 0 10:55 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 25133 25129 0 10:55 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 25134 25129 0 10:55 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root 25139 24377 0 10:56 pts/0 00:00:00 grep nagios

we installed first core 2 then core 3 and then core 4 when i start the web interface it starts core 4.

Anny sugestions why we get double emails and what to check?
emislivec
Posts: 52
Joined: Tue Feb 25, 2014 10:06 am

Re: duplicate email seeing two nagios running

Post by emislivec »

zaanen wrote:[ ok ] is running.
Stopping nagios:
and
zaanen wrote:[FAIL] is not running ... failed!
Starting nagios:
look like messages from an old or modified version of the init script. Did you run

Code: Select all

make install-init
when upgrading to Core 4?

Also, the number of 'nagios' processes is normal:
pid 25129 is the main process that starts the others and runs the event loop.
pids 25130 to 25133 are four worker processes started to run checks.
pid 25134 is the command file worker that reads from nagios.cmd.
zaanen wrote:We have only 1 contact group.
zaanen wrote:Anny sugestions why we get double emails and what to check?
Does each member of the contact group get duplicate emails or only certain ones? Are any email addresses listed twice?
zaanen
Posts: 3
Joined: Tue Aug 26, 2014 2:53 am

Re: duplicate email seeing two nagios running

Post by zaanen »

Here is the contacts.cfg it sends everybody double who is listed in [email protected] ; on our server.

oracle.cfg

Code: Select all

define host{
use                             linux-server
host_name                       kewill-oracle
alias                           kewill-oracle
address                         IP-adres
max_check_attempts              5
check_period                    24x7
notification_interval           30
notification_period             24x7
notification_options d,r
contact_groups admins
}

define service {
        use                             generic-service
        host_name                      kewill-oracle
        service_description            hardeschijf data1
        check_period                   24x7
        max_check_attempts             3
        normal_check_interval          5
        retry_check_interval           3
        notification_interval          480
        notification_period            24x7
        contact_groups                admins
        notification_options           w,u,c,r
        check_command                 check_nrpe!check_sdc1
        notifications_enabled          1
        }

define service {
        use                             generic-service
        host_name                      kewill-oracle
        service_description            hardeschijf data2
        check_period                   24x7
        max_check_attempts             3
        normal_check_interval          5
        retry_check_interval           3
        notification_interval          480
        notification_period            24x7
        contact_groups                admins
        notification_options           w,u,c,r
        check_command                 check_nrpe!check_sdd1
        notifications_enabled          1
        }

define service {
        use                             generic-service
        host_name                      kewill-oracle
        service_description            hardeschijf archives
        check_period                   24x7
        max_check_attempts             3
        normal_check_interval          5
        retry_check_interval           3
        notification_interval          480
        notification_period            24x7
        contact_groups                admins
        notification_options           w,u,c,r
        check_command                 check_nrpe!check_arch
        notifications_enabled          1
  }

define service {
        use                             generic-service
        host_name                      kewill-oracle
        service_description            hardeschijf backup
        check_period                   24x7
        max_check_attempts             3
        normal_check_interval          5
        retry_check_interval           3
        notification_interval          480
        notification_period            24x7
        contact_groups                admins
        notification_options           w,u,c,r
        check_command                 check_nrpe!check_backup
        notifications_enabled          1
        }
contacts.cfg

Code: Select all

# Just one contact defined by default - the Nagios admin (that's you)
# This contact definition inherits a lot of default values from the 'generic-contact'
# template which is defined elsewhere.

define contact{
        contact_name                    nagiosadmin             ; Short name of user
        use                             generic-contact         ; Inherit default values from generic-contact template (defined above)
        alias                           Nagios Admin            ; Full name of user
        host_notifications_enabled 1
        service_notifications_enabled 1
        service_notification_period 24x7
        host_notification_period 24x7
        service_notification_options w,u,c,r
        host_notification_options d,u,r
        service_notification_commands notify-service-by-email
        host_notification_commands notify-host-by-email
        email                           [email protected]     ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
        }

define contact{
        contact_name                    axel             ; Short name of user
        use                             generic-contact         ; Inherit default values from generic-contact template (defined above)
        alias                           axel           ; Full name of user
        host_notifications_enabled 1
        service_notifications_enabled 1
        service_notification_period 24x7
        host_notification_period 24x7
        service_notification_options w,u,c,r
        host_notification_options d,u,r
        service_notification_commands notify-service-by-email
        host_notification_commands notify-host-by-email
        email                           [email protected] ;
}

define contact{
        contact_name                    server-meldingen             ; Short name of user
        use                             generic-contact         ; Inherit default values from generic-contact template (defined above)
        alias                           server-meldingen forwarder           ; Full name of user
        host_notifications_enabled 1
        service_notifications_enabled 1
        service_notification_period 24x7
        host_notification_period 24x7
        service_notification_options w,u,c,r
        host_notification_options d,u,r
        service_notification_commands notify-service-by-email
        host_notification_commands notify-host-by-email
        email                           [email protected] ;
}


###############################################################################
###############################################################################
#
# CONTACT GROUPS
#
###############################################################################
###############################################################################
 
 # We only have one contact in this simple configuration file, so there is
 # no need to create more than one contact group.
 
 define contactgroup{
        contactgroup_name       admins
        alias                   Nagios Administrators
        members                 server-meldingen
        }
I copied something from another nagios question in the hope to fix the problem because i saw the -d double running.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: duplicate email seeing two nagios running

Post by slansing »

Do you see double notifications under Reports > Notifications? If so, can you share a screenshot of them? If not, it may be duplicated on your mail server's end for some reason, or between the two.
zaanen
Posts: 3
Joined: Tue Aug 26, 2014 2:53 am

Re: duplicate email seeing two nagios running

Post by zaanen »

I don't see duplicates at reports notifications.

in sendmail i do see duplicates.

Sep 1 02:19:54 minimus sendmail[12976]: s810Jswb012976: from=nagios, size=333, class=0, nrcpts=1, msgid=<[email protected]>, relay=nagios@localhost
Sep 1 02:19:54 server sm-mta[12978]: s810JsPE012978: from=<[email protected]>, size=618, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Sep 1 02:22:01 server sm-mta[12978]: s810JsPE012978: to=<[email protected]>, ctladdr=<[email protected]> (111/117), delay=00:02:07, xdelay=00:02:07, mailer=esmtp, pri=30618, relay=comms.domain.nl. [192.168.15.36], dsn=2.0.0, stat=Sent ( <[email protected]> Queued mail for delivery)
Sep 1 02:24:54 server sendmail[13048]: s810Osft013048: from=nagios, size=320, class=0, nrcpts=1, msgid=<[email protected]>, relay=nagios@localhost
Sep 1 02:24:54 server sm-mta[13049]: s810Os1w013049: from=<[email protected]>, size=605, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Sep 1 02:27:01 server sm-mta[13049]: s810Os1w013049: to=<[email protected]>, ctladdr=<[email protected]> (111/117), delay=00:02:07, xdelay=00:02:07, mailer=esmtp, pri=30605, relay=comms.domain.nl. [192.168.15.36], dsn=2.0.0, stat=Sent ( <[email protected]> Queued mail for delivery)
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: duplicate email seeing two nagios running

Post by sreinhardt »

I might be missing it, but that does not look like duplicates to me, seems that its just multiple log entries about the same message relaying through different relays. Also if you are not seeing these in the nagios notifications log, it is likely sendmail or the end mailserver somehow duplicating them, again this log would seem to support that, unless the duplicate relay logs are really where and how it is causing multiples.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked