[Check_mk (deutsch)] Unhandled exception: Failed to send the mail: /usr/sbin/sendmail is missing

Hallo zusammen,

ich habe ein Problem mit Check_mk Enterprise Managed Services 1.6.0p6.

Der Check_mk kann keine Notifications zuschicken. Da kommt immer wieder diese Fehlermeldung:

Unhandled exception: Failed to send the mail: /usr/sbin/sendmail is missing

Der Datei /usr/sbin/sendmail ist aber vorhanden und aus der Kommandozeile kann ich die Emails ohne Probleme zuschicken.

Wie kann ich jetzt das Problem einschränken?

VG,

Jiri

Hallo Jiri,

auch als Siteuser?

Nicht das dies nur dir als Root möglich war.

Starte mal bitte innerhalb deiner Site eine Python Shell und führe die paar Zeilen Code da aus

import subprocess
cmd = [“/usr/sbin/sendmail”]

try:
p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
except OSError:
raise Exception(“Failed to send the mail: /usr/sbin/sendmail is missing”)

Wenn ich das auf einem System mache ohne der entsprechenden Datei kommt eine Fehlermeldung welche so aussieht.

FileNotFoundError: [Errno 2] No such file or directory: ‘/usr/sbin/sendmail’: ‘/usr/sbin/sendmail’

Danach kommt dann noch die Exception oben aus dem Code.

Gruß

Andreas

···

Am Fr., 22. Nov. 2019 um 16:36 Uhr schrieb Jiri Cervenka cervenka@cosmotel.de:

Hallo zusammen,

ich habe ein Problem mit Check_mk Enterprise Managed Services 1.6.0p6.

Der Check_mk kann keine Notifications zuschicken. Da kommt immer wieder diese Fehlermeldung:

Unhandled exception: Failed to send the mail: /usr/sbin/sendmail is missing

Der Datei /usr/sbin/sendmail ist aber vorhanden und aus der Kommandozeile kann ich die Emails ohne Probleme zuschicken.

Wie kann ich jetzt das Problem einschränken?

VG,

Jiri


checkmk-de mailing list

checkmk-de@lists.mathias-kettner.de

Verwaltung & Abmeldung unter

https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-de

Hallo Andreas,

vielen Dank für deine Antwort.

Ich habe folgendes gemacht:

root@checkmk02:/checkmkdata# su checkmk01

OMD[checkmk01]:~$ python

Python 2.7.16 (default, Nov 11 2019, 14:50:00)

[GCC 8.2.0] on linux2

Type “help”, “copyright”, “credits” or “license” for more information.

import subprocess

cmd = [“/usr/sbin/sendmail”]

try:

… p = subprocess.Popen(cmd, stdin=subprocess.PIPE)

… except OSError:

… raise Exception(“Failed to send the mail: /usr/sbin/sendmail is missing”)

sendmail: fatal: checkmk01(998): Recipient addresses must be specified on the command line or via the -t option

OMD[checkmk01]:~$

OMD[checkmk01]:~$ ls -l /usr/sbin/sendmail

-rwxr-xr-x 1 root root 26776 Oct 11 2018 /usr/sbin/sendmail*

OMD[checkmk01]:~$

Anscheinend ist /usr/sbin/sendmail vorhanden, aber in der Weboberfläche bekomme ich immer:

Unhandled exception: Failed to send the mail: /usr/sbin/sendmail is missing

VG,

Jiri

···

Hallo Jiri,

auch als Siteuser?

Nicht das dies nur dir als Root möglich war.

Starte mal bitte innerhalb deiner Site eine Python Shell und führe die paar Zeilen Code da aus

import subprocess
cmd = [“/usr/sbin/sendmail”]

try:
p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
except OSError:
raise Exception(“Failed to send the mail: /usr/sbin/sendmail is missing”)

Wenn ich das auf einem System mache ohne der entsprechenden Datei kommt eine Fehlermeldung welche so aussieht.

FileNotFoundError: [Errno 2] No such file or directory: ‘/usr/sbin/sendmail’: ‘/usr/sbin/sendmail’

Danach kommt dann noch die Exception oben aus dem Code.

Gruß

Andreas

Am Fr., 22. Nov. 2019 um 16:36 Uhr schrieb Jiri Cervenka cervenka@cosmotel.de:

Hallo zusammen,

ich habe ein Problem mit Check_mk Enterprise Managed Services 1.6.0p6.

Der Check_mk kann keine Notifications zuschicken. Da kommt immer wieder diese Fehlermeldung:

Unhandled exception: Failed to send the mail: /usr/sbin/sendmail is missing

Der Datei /usr/sbin/sendmail ist aber vorhanden und aus der Kommandozeile kann ich die Emails ohne Probleme zuschicken.

Wie kann ich jetzt das Problem einschränken?

VG,

Jiri


checkmk-de mailing list
checkmk-de@lists.mathias-kettner.de
Verwaltung & Abmeldung unter
https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-de

Ok das hab ich mir fast gedacht.

Im Original Quelltext werden noch die folgenden Optionen mitgegeben.

Da ist aber kein “-t” dabei wie er bei dir bemängelt.

cmd = [“/usr/sbin/sendmail”]
if from_address:
cmd += [‘-F’, from_address, “-f”, from_address]
cmd += [“-i”, target.encode(“utf-8”)]

Was für ein MTA ist auf deinem Monitoringserver aktiv?

Auf meinem System kommt bei dem kleinen Codefragment aus der ersten Antwort keine Fehlermeldung.

Gruß

Andreas

···

Am Sa., 23. Nov. 2019 um 15:58 Uhr schrieb Jiri Cervenka cervenka@cosmotel.de:

Hallo Andreas,

vielen Dank für deine Antwort.

Ich habe folgendes gemacht:

root@checkmk02:/checkmkdata# su checkmk01

OMD[checkmk01]:~$ python

Python 2.7.16 (default, Nov 11 2019, 14:50:00)

[GCC 8.2.0] on linux2

Type “help”, “copyright”, “credits” or “license” for more information.

import subprocess

cmd = [“/usr/sbin/sendmail”]

try:

… p = subprocess.Popen(cmd, stdin=subprocess.PIPE)

… except OSError:

… raise Exception(“Failed to send the mail: /usr/sbin/sendmail is missing”)

sendmail: fatal: checkmk01(998): Recipient addresses must be specified on the command line or via the -t option

OMD[checkmk01]:~$

OMD[checkmk01]:~$ ls -l /usr/sbin/sendmail

-rwxr-xr-x 1 root root 26776 Oct 11 2018 /usr/sbin/sendmail*

OMD[checkmk01]:~$

Anscheinend ist /usr/sbin/sendmail vorhanden, aber in der Weboberfläche bekomme ich immer:

Unhandled exception: Failed to send the mail: /usr/sbin/sendmail is missing

VG,

Jiri

Von: Andreas Döhler andreas.doehler@gmail.com
Gesendet: Freitag, 22. November 2019 23:23
An: Jiri Cervenka cervenka@cosmotel.de
Cc: checkmk-de@lists.mathias-kettner.de
Betreff: Re: [Check_mk (deutsch)] Unhandled exception: Failed to send the mail: /usr/sbin/sendmail is missing

Hallo Jiri,

auch als Siteuser?

Nicht das dies nur dir als Root möglich war.

Starte mal bitte innerhalb deiner Site eine Python Shell und führe die paar Zeilen Code da aus

import subprocess
cmd = [“/usr/sbin/sendmail”]

try:
p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
except OSError:
raise Exception(“Failed to send the mail: /usr/sbin/sendmail is missing”)

Wenn ich das auf einem System mache ohne der entsprechenden Datei kommt eine Fehlermeldung welche so aussieht.

FileNotFoundError: [Errno 2] No such file or directory: ‘/usr/sbin/sendmail’: ‘/usr/sbin/sendmail’

Danach kommt dann noch die Exception oben aus dem Code.

Gruß

Andreas

Am Fr., 22. Nov. 2019 um 16:36 Uhr schrieb Jiri Cervenka cervenka@cosmotel.de:

Hallo zusammen,

ich habe ein Problem mit Check_mk Enterprise Managed Services 1.6.0p6.

Der Check_mk kann keine Notifications zuschicken. Da kommt immer wieder diese Fehlermeldung:

Unhandled exception: Failed to send the mail: /usr/sbin/sendmail is missing

Der Datei /usr/sbin/sendmail ist aber vorhanden und aus der Kommandozeile kann ich die Emails ohne Probleme zuschicken.

Wie kann ich jetzt das Problem einschränken?

VG,

Jiri


checkmk-de mailing list
checkmk-de@lists.mathias-kettner.de
Verwaltung & Abmeldung unter
https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-de

Hi,

kannst Du in deine Site nochmal mit "su - checkmk1" wechseln und das Experiment wiederholen?
su ohne minus behält deine Benutzervariablen bei, das Minus sorgt dafür das er tatsächlich eine neue shell mit den enviroment variablen des user-accounts startet.

Eventuell auch mal das command checken was er da tatsächlich ausführt.(dafür die letzte zeile mal anpassen)

... except OSError:

... raise Exception("Failed to send the mail: /usr/sbin/sendmail is missing " + cmd)

Das "/usr/sbin/sendmail is missing" ist irreführend, da es vom exception string kommt und nicht die tatsächliche OS-fehlermeldung darstellt.

  exception OSError

  This exception is derived from EnvironmentError. It is raised when a function returns a system-related error (not for illegal argument types or other incidental errors). The errno attribute is a numeric error code from errno, and the strerror attribute is the corresponding string, as would be printed by the C function perror(). See the module errno, which contains names for the error codes defined by the underlying operating system.

Wenn Du dem zu Leibe rücken möchtest.

Dafür die letzten zwei Zeilen.

except OSError as e:
     raise Exception(str(e.errno) + ' ' + str(e.strerror))

Grüße

ps.

        cmd += ['-F', from_address, "-f", from_address]
    cmd += ["-i", target.encode("utf-8")]

hat diese inkonsistente Verwendung von ' und " an dieser Stelle eine Bewandnis?
Ist nicht wichtig für das Problem, aber wo man schon mal drauf schaut. :wink:

···

Am 2019-11-23 16:35, schrieb Andreas Döhler:

Ok das hab ich mir fast gedacht.

Im Original Quelltext werden noch die folgenden Optionen mitgegeben.
Da ist aber kein "-t" dabei wie er bei dir bemängelt.

    cmd = ["/usr/sbin/sendmail"]
    if from_address:
        cmd += ['-F', from_address, "-f", from_address]
    cmd += ["-i", target.encode("utf-8")]

Was für ein MTA ist auf deinem Monitoringserver aktiv?
Auf meinem System kommt bei dem kleinen Codefragment aus der ersten
Antwort keine Fehlermeldung.

Gruß
Andreas

Am Sa., 23. Nov. 2019 um 15:58 Uhr schrieb Jiri Cervenka > <cervenka@cosmotel.de>:

Hallo Andreas,

vielen Dank für deine Antwort.

Ich habe folgendes gemacht:

root@checkmk02:/checkmkdata# su checkmk01

OMD[checkmk01]:~$ python

Python 2.7.16 (default, Nov 11 2019, 14:50:00)

[GCC 8.2.0] on linux2

Type "help", "copyright", "credits" or "license" for more
information.

import subprocess

cmd = ["/usr/sbin/sendmail"]

try:

... p = subprocess.Popen(cmd, stdin=subprocess.PIPE)

... except OSError:

... raise Exception("Failed to send the mail: /usr/sbin/sendmail
is missing")

...

sendmail: fatal: checkmk01(998): Recipient addresses must be
specified on the command line or via the -t option

OMD[checkmk01]:~$

OMD[checkmk01]:~$ ls -l /usr/sbin/sendmail

-rwxr-xr-x 1 root root 26776 Oct 11 2018 /usr/sbin/sendmail*

OMD[checkmk01]:~$

Anscheinend ist /usr/sbin/sendmail vorhanden, aber in der
Weboberfläche bekomme ich immer:

Unhandled exception: Failed to send the mail: /usr/sbin/sendmail is
missing

VG,

Jiri

VON: Andreas Döhler <andreas.doehler@gmail.com>
GESENDET: Freitag, 22. November 2019 23:23
AN: Jiri Cervenka <cervenka@cosmotel.de>
CC: checkmk-de@lists.mathias-kettner.de
BETREFF: Re: [Check_mk (deutsch)] Unhandled exception: Failed to
send the mail: /usr/sbin/sendmail is missing

Hallo Jiri,

auch als Siteuser?

Nicht das dies nur dir als Root möglich war.

Starte mal bitte innerhalb deiner Site eine Python Shell und führe
die paar Zeilen Code da aus

import subprocess
cmd = ["/usr/sbin/sendmail"]

try:
p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
except OSError:
raise Exception("Failed to send the mail: /usr/sbin/sendmail is
missing")

Wenn ich das auf einem System mache ohne der entsprechenden Datei
kommt eine Fehlermeldung welche so aussieht.

FileNotFoundError: [Errno 2] No such file or directory:
'/usr/sbin/sendmail': '/usr/sbin/sendmail'

Danach kommt dann noch die Exception oben aus dem Code.

Gruß

Andreas

Am Fr., 22. Nov. 2019 um 16:36 Uhr schrieb Jiri Cervenka >> <cervenka@cosmotel.de>:

Hallo zusammen,

ich habe ein Problem mit Check_mk Enterprise Managed Services
1.6.0p6.

Der Check_mk kann keine Notifications zuschicken. Da kommt immer
wieder diese Fehlermeldung:

Unhandled exception: Failed to send the mail: /usr/sbin/sendmail
is missing

Der Datei /usr/sbin/sendmail ist aber vorhanden und aus der
Kommandozeile kann ich die Emails ohne Probleme zuschicken.

Wie kann ich jetzt das Problem einschränken?

VG,

Jiri

_______________________________________________
checkmk-de mailing list
checkmk-de@lists.mathias-kettner.de
Verwaltung & Abmeldung unter

https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-de

_______________________________________________
checkmk-de mailing list
checkmk-de@lists.mathias-kettner.de
Verwaltung & Abmeldung unter
https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-de

Hallo Daniel,

Jiri hat den Fehler schon gefunden, Antwort ging aus versehen nur direkt an mich.

Auf der einen Slave Instanz von Ihm hat wirklich Postfix gefehlt.

Gruß

Andreas

PS: new location for all CheckMK questions and requests - https://forum.checkmk.com

···

Am Do., 28. Nov. 2019 um 03:05 Uhr schrieb Daniel Schlifka schlifka@geekpit.org:

Hi,

kannst Du in deine Site nochmal mit “su - checkmk1” wechseln und das

Experiment wiederholen?

su ohne minus behält deine Benutzervariablen bei, das Minus sorgt dafür

das er tatsächlich eine neue shell mit den enviroment variablen des

user-accounts startet.

Eventuell auch mal das command checken was er da tatsächlich

ausführt.(dafür die letzte zeile mal anpassen)

… except OSError:

… raise Exception("Failed to send the mail: /usr/sbin/sendmail

is missing " + cmd)

Das “/usr/sbin/sendmail is missing” ist irreführend, da es vom exception

string kommt und nicht die tatsächliche OS-fehlermeldung darstellt.

exception OSError

This exception is derived from EnvironmentError. It is raised when a

function returns a system-related error (not for illegal argument types

or other incidental errors). The errno attribute is a numeric error code

from errno, and the strerror attribute is the corresponding string, as

would be printed by the C function perror(). See the module errno, which

contains names for the error codes defined by the underlying operating

system.

Wenn Du dem zu Leibe rücken möchtest.

Dafür die letzten zwei Zeilen.

except OSError as e:

 raise Exception(str(e.errno) + ' ' + str(e.strerror))

Grüße

ps.

    cmd += ['-F', from_address, "-f", from_address]
cmd += ["-i", target.encode("utf-8")]

hat diese inkonsistente Verwendung von ’ und " an dieser Stelle eine

Bewandnis?

Ist nicht wichtig für das Problem, aber wo man schon mal drauf schaut.

:wink:

Am 2019-11-23 16:35, schrieb Andreas Döhler:

Ok das hab ich mir fast gedacht.

Im Original Quelltext werden noch die folgenden Optionen mitgegeben.

Da ist aber kein “-t” dabei wie er bei dir bemängelt.

cmd = ["/usr/sbin/sendmail"]
if from_address:
    cmd += ['-F', from_address, "-f", from_address]
cmd += ["-i", target.encode("utf-8")]

Was für ein MTA ist auf deinem Monitoringserver aktiv?

Auf meinem System kommt bei dem kleinen Codefragment aus der ersten

Antwort keine Fehlermeldung.

Gruß

Andreas

Am Sa., 23. Nov. 2019 um 15:58 Uhr schrieb Jiri Cervenka > > > cervenka@cosmotel.de:

Hallo Andreas,

vielen Dank für deine Antwort.

Ich habe folgendes gemacht:

root@checkmk02:/checkmkdata# su checkmk01

OMD[checkmk01]:~$ python

Python 2.7.16 (default, Nov 11 2019, 14:50:00)

[GCC 8.2.0] on linux2

Type “help”, “copyright”, “credits” or “license” for more

information.

import subprocess

cmd = [“/usr/sbin/sendmail”]

try:

… p = subprocess.Popen(cmd, stdin=subprocess.PIPE)

… except OSError:

… raise Exception("Failed to send the mail: /usr/sbin/sendmail

is missing")

sendmail: fatal: checkmk01(998): Recipient addresses must be

specified on the command line or via the -t option

OMD[checkmk01]:~$

OMD[checkmk01]:~$ ls -l /usr/sbin/sendmail

-rwxr-xr-x 1 root root 26776 Oct 11 2018 /usr/sbin/sendmail*

OMD[checkmk01]:~$

Anscheinend ist /usr/sbin/sendmail vorhanden, aber in der

Weboberfläche bekomme ich immer:

Unhandled exception: Failed to send the mail: /usr/sbin/sendmail is

missing

VG,

Jiri

VON: Andreas Döhler andreas.doehler@gmail.com

GESENDET: Freitag, 22. November 2019 23:23

AN: Jiri Cervenka cervenka@cosmotel.de

CC: checkmk-de@lists.mathias-kettner.de

BETREFF: Re: [Check_mk (deutsch)] Unhandled exception: Failed to

send the mail: /usr/sbin/sendmail is missing

Hallo Jiri,

auch als Siteuser?

Nicht das dies nur dir als Root möglich war.

Starte mal bitte innerhalb deiner Site eine Python Shell und führe

die paar Zeilen Code da aus

import subprocess

cmd = [“/usr/sbin/sendmail”]

try:

p = subprocess.Popen(cmd, stdin=subprocess.PIPE)

except OSError:

raise Exception("Failed to send the mail: /usr/sbin/sendmail is

missing")

Wenn ich das auf einem System mache ohne der entsprechenden Datei

kommt eine Fehlermeldung welche so aussieht.

FileNotFoundError: [Errno 2] No such file or directory:

‘/usr/sbin/sendmail’: ‘/usr/sbin/sendmail’

Danach kommt dann noch die Exception oben aus dem Code.

Gruß

Andreas

Am Fr., 22. Nov. 2019 um 16:36 Uhr schrieb Jiri Cervenka > > >> cervenka@cosmotel.de:

Hallo zusammen,

ich habe ein Problem mit Check_mk Enterprise Managed Services

1.6.0p6.

Der Check_mk kann keine Notifications zuschicken. Da kommt immer

wieder diese Fehlermeldung:

Unhandled exception: Failed to send the mail: /usr/sbin/sendmail

is missing

Der Datei /usr/sbin/sendmail ist aber vorhanden und aus der

Kommandozeile kann ich die Emails ohne Probleme zuschicken.

Wie kann ich jetzt das Problem einschränken?

VG,

Jiri


checkmk-de mailing list

checkmk-de@lists.mathias-kettner.de

Verwaltung & Abmeldung unter

https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-de


checkmk-de mailing list

checkmk-de@lists.mathias-kettner.de

Verwaltung & Abmeldung unter

https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-de


checkmk-de mailing list

checkmk-de@lists.mathias-kettner.de

Verwaltung & Abmeldung unter

https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-de

This topic was automatically closed after 58 days. New replies are no longer allowed.