Site backup failed: Failed to perform backup: [Errno 104] Connection reset by peer

Hallo Zusammen,

nach dem Update auf CheckMK 2.0.0p1 (CRE) (Ubuntu 18.04) funktioniert das tägliche Backup von CheckMK nicht mehr, wenn das Update manuell gestartet wird funktioniert es.
Die Fehlermeldung lautet wie folgt:
“Site backup failed: Failed to perform backup: [Errno 104] Connection reset by peer”
Vor dem Update auf die Version CheckMK 2.0.0p1 (CRE) benutzten wir die Version CheckMK 1.6.0p17.
Hat jemand eine Idee wie man das Problem lösen kann?

Das lag bei mir an den Berechtigungen für:
/var/lock/mkbackup

Musste die Berechtigungen manuell nachstellen, dass das lock File geschrieben werden kann.

Die Berechtigungen haben wir manuell nachgestellt, trotz allem funktioniert die automatische Sicherung immer noch nicht.
Die gleiche Fehlermeldung erscheint wieder.

Hallo @Philipp.Schaefer,
kannst du bitte prüfen, ob unter ~/var/pnp4nagios/perfdata Daten liegen?
Wenn ihr noch pnp4nagios nutzt, könnte das beim Backup Probleme machen.

Gruß
Anastasios

Hallo @athomaidis
pnp4nagios haben wir nicht im Einsatz, der Pfad existiert nicht.

Gruß
Philipp.Schaefer

wir haben bei uns das selbe Problem (auch CRE), Wenn ich die RRD-Dateien rauslasse, funktioniert es.
Der Ordner ~/var/pnp4nagios/perfdata existiert bei mir, kann ich die Daten einfach löschen oder muss ich vorher noch pnp4nagios deaktivieren?

Du kannst die pnp4nagios Sachen zu den RRDs konvertieren: Messwerte und Graphing - Messwerte in Checkmk schnell und einfach auswerten
Bitte stope erst den cmc, bevor du den convert und delete Befehl ausführst

Was passiert, wenn du das Backup nach sdout machst?
omd -v backup --no-compression SITENAME -

die Option cmk -v --convert-rrds kennt er nicht, er zeigt mir dann nur die Help Seite vom cmk an. Ich vermute das liegt daran, das bei uns die Raw Edition läuft und dort diese (noch?) nicht implementiert wurde.

Ich habe gesehen, das wenn ich die Siteconfig aufmache mit omd config SITENAME gibt es unter “Addons” einen Punkt “PNP4Nagios” das steht auf “on”. als weitere Optionen gibt es:

  • on
  • npcd
  • gearman
  • off

Kann es sein das in der Raw Edition auch mit Version 2.0.0p1 nur die Verwendung von PN4Nagios Dateien möglich ist?

Mit Checkmk 2.0 hat die CRE auch die RRD Graphen

hab den Befehl mal auf unserer Instanz ausgeführt.

die Fehlermeldung war dann wie folgt:

Resuming RRD updates for /opt/omd/sites/monitor1/var/pnp4nagios/perfdata/ASA-GYM-KKG/Interface_offenes_Internet_outucast.rrd
rrdcached command: RESUME /opt/omd/sites/monitor1/var/pnp4nagios/perfdata/ASA-GYM-KKG/Interface_offenes_Internet_outucast.rrd
Failed to perform backup: [Errno 104] Connection reset by peer

kannst du mir nochmal bestätigen, dass der convert Befehl nicht funktioniert?
Ich würde mal intern klären, was wir hier für Möglichkeiten haben.

ja habs grad nochmal probiert. der Befehl muss ja als Siteuser ausgeführt werden oder?

Ich hab hier mal den Konsolenoutput, damit nachvollzogen werden kann was ich gemacht habe:

root@sv-monitoring1:~# omd stop monitor1
Removing Crontab...OK
Stopping xinetd...OK
Stopping redis...killing 2311...OK
Stopping apache...killing 2300................OK
Stopping nagios.......OK
Stopping npcd...OK
Stopping rrdcached...waiting for termination...OK
Stopping mkeventd...killing 2232...OK
Stopping 1 remaining site processes...OK
root@sv-monitoring1:~# su monitor1
OMD[monitor1]:~$ cmk -v --convert-rrds
ERROR: option --convert-rrds not recognized

WAYS TO CALL:
 cmk  --automation [COMMAND...]          Internal helper to invoke Check_MK
                                         actions
 cmk  --backup BACKUPFILE.tar.gz         make backup of configuration and data
 cmk  --check [HOST [IPADDRESS]]         Check all services on the given HOST
 cmk  --check-discovery HOSTNAME         Check for not yet monitored services
 cmk  --cleanup-piggyback                Cleanup outdated piggyback files
 cmk  --create-diagnostics-dump          Create diagnostics dump
 cmk  --discover-marked-hosts            Run discovery for hosts known to have
                                         changed services
 cmk  --flush [HOST1 HOST2...]           Flush all data of some or all hosts
 cmk  --inventory-as-check HOST          Do HW/SW-Inventory, behave like check
                                         plugin
 cmk  --list-tag [TAG1 TAG2...]          List hosts having certain tags
 cmk  --localize [COMMAND]               Do localization operations
 cmk  --notify [MODE]                    Used to send notifications from core
 cmk  --paths                            List all pathnames and directories
 cmk  --restore BACKUPFILE.tar.gz        restore configuration and data
 cmk  --scan-parents [HOST1 HOST2...]    Autoscan parents, create
                                         conf.d/parents.mk
 cmk  --snmpget [OID [HOST1 HOST2...]]   Fetch single OID from one or multiple
                                         hosts
 cmk  --snmptranslate HOST               Do snmptranslate on walk
 cmk  --snmpwalk [HOST1 HOST2...]        Do snmpwalk on one or more hosts
 cmk  --update-dns-cache                 Update IP address lookup cache
 cmk  -D, --dump [H1 H2...]              Dump info about all or some hosts
 cmk  -d, --dump-agent HOSTNAME|ADDRESS  Show raw information from agent
 cmk  -h, --help                         Print this help
 cmk  -I, --discover [[-I] HOST1 HOST2...]Find new services
 cmk  -i, --inventory [HOST1 HOST2...]   Do a HW/SW-Inventory on some ar all
                                         hosts
 cmk  -L, --list-checks                  List all available Check_MK checks
 cmk  -l, --list-hosts [G1 G2...]        Print list of all hosts or members of
                                         host groups
 cmk  -m, --browse-man                   Open interactive manpage browser
 cmk  -M, --man [CHECKTYPE]              Show manpage for check CHECKTYPE
 cmk  -N, --nagios-config [HOST1 HOST2...]Output Nagios configuration
 cmk  -O, --reload                       Create core config + core reload
 cmk  -P, --package [COMMAND]            Do package operations
 cmk  -R, --restart                      Create core config + core restart
 cmk  -U, --update                       Create core config
 cmk  -V, --version                      Print the version of Check_MK
 cmk  -X, --config-check                 Check configuration for invalid vars

OPTIONS:
   --cache             Read info from data source cache files when existant,
                       even when it is outdated. Only contact the data sources
                       when the cache file is absent
   --debug             Let most Python exceptions raise through
   --fake-dns IP       Fake IP addresses of all hosts to be IP. This prevents
                       DNS lookups.
   --no-cache          Never use cached information
   --no-tcp            For -I: Only use cache files. Skip hosts without cache
                       files.
   --profile           Enable profiling mode
   --usewalk           Use snmpwalk stored with --snmpwalk
   -v, --verbose       Enable verbose output (Use twice for more)

NOTES:
  --backup Saves all configuration and runtime data to a gzip compressed tar
    file to the path specified as argument.

  --check Execute all checks on the given HOST. Optionally you can specify a
    second argument, the IPADDRESS. If you don't set this, the configured IP
    address of the HOST is used.

    By default the check results are sent to the core. If you provide the option
    '-n', the results will not be sent to the core and the counters of the check
    will not be stored.

    You can use '-v' to see the results of the checks. Add '-p' to also see the
    performance data of the checks.Can be restricted to certain check types.
    Write '--checks df -I' if you just want to look for new filesystems. Use
    'check_mk -L' for a list of all check types. Use 'tcp' for all TCP based
    checks and 'snmp' for all SNMP based checks.

    Additional options:

     -n, --no-submit        Do not submit results to core, do not save counters
     -p, --perfdata         Also show performance data (use with -v)
     --detect-sections S    Comma separated list of sections. The provided
                            sections (but no more) will be available (skipping
                            SNMP detection)
     --plugins P            Restrict discovery, checking or inventory to these
                            plugins
     --detect-plugins, --checks PSame as '--plugins', but implies a best efford
                            guess for --detect-sections
     --keepalive            Execute in keepalive mode (CEE only)
     --keepalive-fd I       File descriptor to send output to

  --check-discovery Make Check_MK behave as monitoring plugins that checks if an
    inventory would find new or vanished services for the host. If configured to
    do so, this will queue those hosts for automatic discover-marked-hosts

  --create-diagnostics-dump Create a dump containing information for diagnostic
    analysis in the folder var/check_mk/diagnostics.

    Additional options:

     --local-files          Pack a list of installed, unpacked, optional files
                            below $OMD_ROOT/local. This also includes
                            information about installed MKPs.
     --omd-config           Pack content of 'etc/omd/site.conf'
     --checkmk-overview     Pack HW/SW inventory node 'Software > Applications >
                            Checkmk'
     --checkmk-config-files FILE,FILE...Pack configuration files ('*.mk' or
                            '*.conf') from etc/checkmk
     --checkmk-log-files FILE,FILE...Pack log files ('*.log' or '*.state') from
                            var/log

  -D, --dump Dumps out the complete configuration and information about one,
    several or all hosts. It shows all services, hostgroups, contacts and other
    information about that host.

  -d, --dump-agent Shows the raw information received from the given host. For
    regular hosts it shows the agent output plus possible piggyback information.
    Does not work on clusters but only on real hosts.

  --discover-marked-hosts Run actual service discovery on all hosts that are
    known to have new/vanished services due to an earlier run of check-
    discovery. The results of this discovery may be activated automatically if
    configured.

  --flush Deletes all runtime data belonging to a host. This includes the
    inventorized checks, the state of performance counters, cached agent output,
    and logfiles. Precompiled host checks are not deleted.

  -I, --discover Make Check_MK behave as monitoring plugins that checks if an
    inventory would find new or vanished services for the host. If configured to
    do so, this will queue those hosts for automatic discover-marked-hosts

    Can be restricted to certain check types. Write '--checks df -I' if you just
    want to look for new filesystems. Use 'cmk -L' for a list of all check
    types.

    Can also be restricted to only discovering new host labels. Use: '--only-
    host-labels' or '-L'

    -II does the same as -I but deletes all existing checks of the specified
    types and hosts.

    Additional options:

     -I, --discover         Delete existing services before starting discovery
     --detect-sections S    Comma separated list of sections. The provided
                            sections (but no more) will be available (skipping
                            SNMP detection)
     --plugins P            Restrict discovery, checking or inventory to these
                            plugins
     --detect-plugins, --checks PSame as '--plugins', but implies a best efford
                            guess for --detect-sections
     -L, --only-host-labels Restrict discovery to host labels only

  -i, --inventory Does a HW/SW-Inventory for all, one or several hosts. If you
    add the option -f, --force then persisted sections will be used even if they
    are outdated.

    Additional options:

     -f, --force            Use cached agent data even if it's outdated.
     --detect-sections S    Comma separated list of sections. The provided
                            sections (but no more) will be available (skipping
                            SNMP detection)
     --plugins P            Restrict discovery, checking or inventory to these
                            plugins
     --detect-plugins, --checks PSame as '--plugins', but implies a best efford
                            guess for --detect-sections

  --inventory-as-check

    Additional options:

     --hw-changes S         Use monitoring state S for HW changes
     --sw-changes S         Use monitoring state S for SW changes
     --sw-missing S         Use monitoring state S for missing SW packages info
     --inv-fail-status S    Use monitoring state S in case of error

  -l, --list-hosts Called without argument lists all hosts. You may specify one
    or more host groups to restrict the output to hosts that are in at least one
    of those groups.

    Additional options:

     --all-sites            Include hosts of foreign sites
     --include-offline      Include offline hosts

  --list-tag Prints all hosts that have all of the specified tags at once.

  --localize Brings you into localization mode. You can create and/or improve
    the localization of Check_MKs GUI. Call without arguments for a help on
    localization.

  -M, --man Shows documentation about a check type. If /usr/bin/less is
    available it is used as pager. Exit by pressing Q. Use -M without an
    argument to show a list of all manual pages.

  -N, --nagios-config Outputs the Nagios configuration. You may optionally add a
    list of hosts. In that case the configuration is generated only for that
    hosts (useful for debugging).

  --notify

    Additional options:

     --log-to-stdout        Also write log messages to console
     --keepalive            Execute in keepalive mode (CEE only)

  -P, --package Brings you into packager mode. Packages are used to ship
    inofficial extensions of Check_MK. Call without arguments for a help on
    packaging.

  --restore *Erases* the current configuration and data and replaces it with
    that from the backup file.

  --scan-parents Uses traceroute in order to automatically detect hosts's
    parents. It creates the file conf.d/parents.mk which defines gateway hosts
    and parent declarations.

    Additional options:

     --procs N              Start up to N processes in parallel. Defaults to 50.

  --snmpget Does a snmpget on the given OID on one or multiple hosts. In case no
    host is given, all known SNMP hosts are queried.

  --snmptranslate Does not contact the host again, but reuses the hosts walk
    from the directory /omd/sites/monitor1/var/check_mk/snmpwalks. You can add
    further MIBs to the directory /omd/sites/monitor1/local/share/snmp/mibs.

  --snmpwalk Does a complete snmpwalk for the specified hosts both on the
    standard MIB and the enterprises MIB and stores the result in the directory
    '/omd/sites/monitor1/var/check_mk/snmpwalks'. Use the option --oid one or
    several times in order to specify alternative OIDs to walk. You need to
    specify numeric OIDs. If you want to keep the two standard OIDS .1.3.6.1.2.1
    and .1.3.6.1.4.1 then use --extraoid for just adding additional OIDs to
    walk.

    Additional options:

     --extraoid A           Walk also on this OID, in addition to mib-2 and
                            enterprises. You can specify this option multiple
                            times.
     --oid A                Walk on this OID instead of mib-2 and enterprises.
                            You can specify this option multiple times.

  -U, --update Updates the core configuration based on the current Checkmk
    configuration. When using the Nagios core, the precompiled host checks are
    created and the nagios configuration is updated. When using the CheckMK
    Microcore, the core configuration is created and the configuration for the
    Core helper processes is being created.

    The agent bakery is updating the agents.

–convert-rrds gibt es nur in der Enterprise Version
Die RRDs der Raw Edition werden weiterhin wie aufgeführt im Ordner “~/var/pnp4nagios/perfdata” gespeichert.
Nur es gibt kein PNP4Nagios mehr als Webfrontend sondern nur das Modern Graphing System aus der Enterprise Edition.

Das Problem scheint ja hier die rrdcached Befehle zu sein. Diese sollten aber auch im CRE funktionieren. Wüsste jetzt nicht warum das nicht geht.

2 Likes

Ich hab das Problem mit den automatischen Backup auch - bei einer frisch eingerichteten CheckMK Instanz (2.0.0p1). Manuelles Backup auf demselben Pfad funktioniert.

I am getting the Site backup failed: Failed to perform backup: [Errno 104] Connection reset by peer ever since I upgraded to v2.0.0p1 on all my servers.

Even when I try to send the backup to a local /tmp directory it fails within seconds or minutes.

könntest Du eventuell einen Screenshot Deiner Backup Konfiguration posten?
Ich hab das grad mal mit allen Einstellungen probiert, kann das Problem aber nicht reproduzieren

Bildschirmfoto 2021-04-15 um 13.07.18 Bildschirmfoto 2021-04-15 um 13.07.58

Dieselbe Einrichtung hab ich auch für manuell (abgesehen halt dass bei Schedule auf manuell gestellt ist). Manuell funktioniert problemlos immer wieder. Die automatische weder per Sched noch wenn man sie manuell ausführt - derselbe Pfad. Zum Test habe ich die Verschlüsselung mal raus genommen. Geht aber auch nicht. Manuell klappt

Edit
Gerade konnte ich das automatische Backup händisch triggern und es lief durch. Das manuelle Backup kurz danach lief auf “Connection reset by peer”

Besteht der Fehler in der 2.0.0p2 noch?
Es gab da einen Fix, ich bin mir aber nicht sicher, ob er dieses Problem löst

@_rb Habe soeben auf 2.0.0p2 geupdated und der Fehler war immer noch da. Habe aber dann mal auf den Hinweis von @mik die Berechtigungen von /var/lock/mkbackup/mkbackup.lock angepasst und auf 770 gesetzt, danach lief das erste Backup ohne Probleme durch. Owner von der Datei ist der Site-User und Group ist omd. Wie sind denn die erwarteten Permissions von der Datei?
Nachtrag: Nach der Anpassung lief das erste Backup ohne Probleme durch, beim nächsten Anstoßen des Backups über die GUI kommt der Fehler wieder…