From werner.flamme at ufz.de Tue Mar 12 12:24:02 2024 From: werner.flamme at ufz.de (Werner Flamme) Date: Tue, 12 Mar 2024 12:24:02 +0100 Subject: question to check_disk In-Reply-To: References: Message-ID: Am 2024-02-21 um 18:06 schrieb Astrid Kuhr: > Hello! > > I am using check_disk > (check_disk v2.3.1 (monitoring-plugins 2.3.1)) > for some filesystems. > > But for one filesystem of this, the perfdata > has strong values inside. > > As example: > > df -h > /dev/mapper/raid-home????????????????? 4,0T??? 3,4T? 553G?? 87% /home > /dev/mapper/raid-other???????????????? 197G??? 155G?? 41G?? 80% /other > > /usr/lib/nagios/plugins/check_disk -w 12% -c 10%? --unit GB -p /home > DISK OK - free space: /home 552 GB (13% inode=97%);| > /home=3474GB;3547;3627;0;4031 > > /usr/lib/nagios/plugins/check_disk -w 12% -c 10%? --unit GB -p /other > DISK OK - free space: /usr/local/cfx 40 GB (20% inode=88%);| > /other=154GB;172;176;0;196 > > But if I look into NagiosGrid I will find this for /home: > > Status Information:??? DISK OK - free space: /home 1 GB (90% inode=99%): > Performance Data:??? /home=0GB;0;0;0;1 > > Which I do not understand, because it does not fit to the data, which > the command at console has as output. > > For the filesystem /other it is similar to command: > > Status Information:??? DISK OK - free space: /other 40 GB (20% inode=88%): > Performance Data:??? /other=154GB;166;176;0;196 > > Is it possible, that Nagios can not do with terrabyte disks? > > Nagios is Nagios Core 4.4.7 from Suse Leap 15.5. > > Thanx. > > Regards, Astrid Hello Astrid, nagios does not know anything about the filesystem size. It just executes a command, normally using a plugin, and uses the returned text output and return values (aka "errorlevel"). Can it be that nagios executes a check_nrpe command that triggers something other on the monitored host than you execute yourself manually? I had this several times, because some plugins store their default config in /etc/nrpe.d and thus nrpe commands may be defined multiple times. You can never be sure which of the definitions are used. So I have nrpe checking in /etc/nrpe.ufz.d instead of the standard /etc/nrpe.d, which often gets infested when updates roll in ;) You can execute "grep -rn check_disk /etc/nrpe.d/*" to check this. And make sure that you change all commands in /etc/nrpe.cfg to comments. HTH, Werner -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5918 bytes Desc: Kryptografische S/MIME-Signatur URL: From werner.flamme at ufz.de Tue Mar 12 14:38:20 2024 From: werner.flamme at ufz.de (Werner Flamme) Date: Tue, 12 Mar 2024 14:38:20 +0100 Subject: question to check_disk In-Reply-To: <34acef06-c1ec-75c3-0b2e-211ee054c041@fz-juelich.de> References: <34acef06-c1ec-75c3-0b2e-211ee054c041@fz-juelich.de> Message-ID: Meine Fragen: - Der Nagios l?uft lokal, also checkt lokale Filesysteme? - wie ist die Definition des Check-Befehls? Normalerweise steht da ja ein "check_command $USER1$/check_disk" - wenn die Definition anders ist, wie? ein Befehl, der in commands.cfg definiert ist? Doch nrpe? Wie gesagt, Nagios k?mmert sich kein bisschen um Filesysteme und seine Gr??en. Nagios f?hrt einen Befehl (hier: check_disk) aus und zeigt dann an, was der Befehl zur?ck gibt. Wenn es falsche Ergebnisse gibt, liegt es nicht an Nagios selbst, sondern am benutzten Befehl. Das kenne ich - wie gesagt -, wenn der Check nicht lokal l?uft, sondern per nrpe aufgerufen wird. Wenn es zwischen Deinem manuellen Check und Nagios' Anzeige einen Unterschied gibt, verfolge den Weg, den Nagios zum Check benutzt. An irgend einer Stelle wird der falsche Befehl genutzt. Schlimmstenfalls mit indirektem Debugging (auf dem ?berwachten Host ausf?hren): a) (Befehl geht hier ?ber 2 Zeilen) mv /usr/lib/nagios/plugins/check_disk \ /usr/lib/nagios/plugins/mycheck_disk b) (mehrzeilig, aber ein Befehl) cat >/usr/lib/nagios/plugins/check_disk<> /tmp/check_disk.log echo "\$@" >> /tmp/check_disk.log /usr/lib/nagios/plugins/mycheck_disk \$@ EOT c) chmod +x /usr/lib/nagios/plugins/check_disk Die Nagios-Konfiguration bleibt nat?rlich unver?ndert, so dass sie brav check_disk benutzt, sonst haben die erw?hnten Schritte keinen Sinn.. Du erh?ltst dann die tats?chlichen Aufrufparameter von check_disk in der Logdatei. Und die d?rften sich von den manuell eingesetzten unterscheiden. Dann musst Du nur noch suchen, wo diese Parameter in der Nagios-Config erw?hnt werden. Die Sache mit nrpe ist irgendwann bei 15.3 (glaube ich, oder 15.2) aufgetreten, ohne erkennbare Warnung haben die Plugins dort ihre Check-Commands abgekippt und meine Ergebnisse zufallsorientiert ermittelt. Und die Nagios-Config als solche war auch seit Jahren unver?ndert (ich mache das seit 2005, SUSE seit 2003 beruflich). Im grep-Befehl kannst Du nat?rlich statt "/etc/nrpe.d/*" Dein eigenes Verzeichnis nehmen. Es wird rekursiv durchlaufen. Du kannst den Befehl auch auf "/etc/nagios/*" anwenden, vielleicht ist es doch da kaputt. HDH, Werner Am 2024-03-12 um 13:47 schrieb Astrid Kuhr: > Hallo! > > Besten Dank fuer die Antwort. > Ich schreib dann mal auf deutsch. > > Ich verwende das Nagios in nahezu unveraenderter Konfiguration > schon seit vielen vielen Jahren.> > Ich vermute mal, dass diese Ungereimheit jetzt mit einem Update > (von Nagios?) zusammenhaengt. > > Im ersten Bild ein Ausschnitt von meinem /home Filesystem Anfang 2022, > es sind ca. 3,4 TB belegt. Das gibt das Nagios ja auch korrekt wieder. > > Anfang 2023 passt es auch noch. > > Aber im letzten halben Jahr von 2023 ist dann was "passiert", > dass den Wert im Nagios zu Null gehen laesst. > Siehe 3. Bild. > > Bei einem anderen Filesystem, was auch in der aehnlichen TB Region > belegt ist, passiert dieses nicht. > > Siehe Bild 4. > > (Wie koennte ich dem Nagios fuer mein /home Filesystem sagen, dass es mir > es bitte auch in GB anzeigen soll, wie es es bei dem anderen Filesystem > tut?) > > Bei einem 3. Filesystem, was sich nur im GB Bereich belegt bewegt, da > stimmt auch die Grafik, aber die min/max Werte in der Beschriftung sind > auch krude... > > Der grep Befehl wird bei mir so nicht klappen, weil ich da eine > eigene Struktur hab. > > Und wie gesagt, meine Nagiosinstallation laeuft ueber viele viele > Jahre schon unveraendert und diese Filesystemungereimtheit ist > erst "jetzt" irgendwann aufgetreten. > > Gruss, Astrid > > Werner Flamme wrote: >> Am 2024-02-21 um 18:06 schrieb Astrid Kuhr: >>> Hello! >>> >>> I am using check_disk >>> (check_disk v2.3.1 (monitoring-plugins 2.3.1)) >>> for some filesystems. >>> >>> But for one filesystem of this, the perfdata >>> has strong values inside. >>> >>> As example: >>> >>> df -h >>> /dev/mapper/raid-home????????????????? 4,0T??? 3,4T? 553G?? 87% /home >>> /dev/mapper/raid-other???????????????? 197G??? 155G?? 41G?? 80% /other >>> >>> /usr/lib/nagios/plugins/check_disk -w 12% -c 10%? --unit GB -p /home >>> DISK OK - free space: /home 552 GB (13% inode=97%);| >>> /home=3474GB;3547;3627;0;4031 >>> >>> /usr/lib/nagios/plugins/check_disk -w 12% -c 10%? --unit GB -p /other >>> DISK OK - free space: /usr/local/cfx 40 GB (20% inode=88%);| >>> /other=154GB;172;176;0;196 >>> >>> But if I look into NagiosGrid I will find this for /home: >>> >>> Status Information:??? DISK OK - free space: /home 1 GB (90% inode=99%): >>> Performance Data:??? /home=0GB;0;0;0;1 >>> >>> Which I do not understand, because it does not fit to the data, which >>> the command at console has as output. >>> >>> For the filesystem /other it is similar to command: >>> >>> Status Information:??? DISK OK - free space: /other 40 GB (20% >>> inode=88%): >>> Performance Data:??? /other=154GB;166;176;0;196 >>> >>> Is it possible, that Nagios can not do with terrabyte disks? >>> >>> Nagios is Nagios Core 4.4.7 from Suse Leap 15.5. >>> >>> Thanx. >>> >>> Regards, Astrid >> >> Hello Astrid, >> >> nagios does not know anything about the filesystem size. It just >> executes a command, normally using a plugin, and uses the returned text >> output and return values (aka "errorlevel"). >> >> Can it be that nagios executes a check_nrpe command that triggers >> something other on the monitored host than you execute yourself >> manually? I had this several times, because some plugins store their >> default config in /etc/nrpe.d and thus nrpe commands may be defined >> multiple times. You can never be sure which of the definitions are used. >> So I have nrpe checking in /etc/nrpe.ufz.d instead of the standard >> /etc/nrpe.d, which often gets infested when updates roll in ;) >> >> You can execute "grep -rn check_disk /etc/nrpe.d/*" to check this. And >> make sure that you change all commands in /etc/nrpe.cfg to comments. >> >> HTH, Werner >> >> > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5918 bytes Desc: Kryptografische S/MIME-Signatur URL: From a.kuhr at fz-juelich.de Tue Mar 12 13:47:10 2024 From: a.kuhr at fz-juelich.de (Astrid Kuhr) Date: Tue, 12 Mar 2024 13:47:10 +0100 Subject: question to check_disk In-Reply-To: References: Message-ID: <34acef06-c1ec-75c3-0b2e-211ee054c041@fz-juelich.de> Hallo! Besten Dank fuer die Antwort. Ich schreib dann mal auf deutsch. Ich verwende das Nagios in nahezu unveraenderter Konfiguration schon seit vielen vielen Jahren. Ich vermute mal, dass diese Ungereimheit jetzt mit einem Update (von Nagios?) zusammenhaengt. Im ersten Bild ein Ausschnitt von meinem /home Filesystem Anfang 2022, es sind ca. 3,4 TB belegt. Das gibt das Nagios ja auch korrekt wieder. Anfang 2023 passt es auch noch. Aber im letzten halben Jahr von 2023 ist dann was "passiert", dass den Wert im Nagios zu Null gehen laesst. Siehe 3. Bild. Bei einem anderen Filesystem, was auch in der aehnlichen TB Region belegt ist, passiert dieses nicht. Siehe Bild 4. (Wie koennte ich dem Nagios fuer mein /home Filesystem sagen, dass es mir es bitte auch in GB anzeigen soll, wie es es bei dem anderen Filesystem tut?) Bei einem 3. Filesystem, was sich nur im GB Bereich belegt bewegt, da stimmt auch die Grafik, aber die min/max Werte in der Beschriftung sind auch krude... Der grep Befehl wird bei mir so nicht klappen, weil ich da eine eigene Struktur hab. Und wie gesagt, meine Nagiosinstallation laeuft ueber viele viele Jahre schon unveraendert und diese Filesystemungereimtheit ist erst "jetzt" irgendwann aufgetreten. Gruss, Astrid Werner Flamme wrote: > Am 2024-02-21 um 18:06 schrieb Astrid Kuhr: >> Hello! >> >> I am using check_disk >> (check_disk v2.3.1 (monitoring-plugins 2.3.1)) >> for some filesystems. >> >> But for one filesystem of this, the perfdata >> has strong values inside. >> >> As example: >> >> df -h >> /dev/mapper/raid-home????????????????? 4,0T??? 3,4T? 553G?? 87% /home >> /dev/mapper/raid-other???????????????? 197G??? 155G?? 41G?? 80% /other >> >> /usr/lib/nagios/plugins/check_disk -w 12% -c 10%? --unit GB -p /home >> DISK OK - free space: /home 552 GB (13% inode=97%);| >> /home=3474GB;3547;3627;0;4031 >> >> /usr/lib/nagios/plugins/check_disk -w 12% -c 10%? --unit GB -p /other >> DISK OK - free space: /usr/local/cfx 40 GB (20% inode=88%);| >> /other=154GB;172;176;0;196 >> >> But if I look into NagiosGrid I will find this for /home: >> >> Status Information:??? DISK OK - free space: /home 1 GB (90% inode=99%): >> Performance Data:??? /home=0GB;0;0;0;1 >> >> Which I do not understand, because it does not fit to the data, which >> the command at console has as output. >> >> For the filesystem /other it is similar to command: >> >> Status Information:??? DISK OK - free space: /other 40 GB (20% inode=88%): >> Performance Data:??? /other=154GB;166;176;0;196 >> >> Is it possible, that Nagios can not do with terrabyte disks? >> >> Nagios is Nagios Core 4.4.7 from Suse Leap 15.5. >> >> Thanx. >> >> Regards, Astrid > > Hello Astrid, > > nagios does not know anything about the filesystem size. It just > executes a command, normally using a plugin, and uses the returned text > output and return values (aka "errorlevel"). > > Can it be that nagios executes a check_nrpe command that triggers > something other on the monitored host than you execute yourself > manually? I had this several times, because some plugins store their > default config in /etc/nrpe.d and thus nrpe commands may be defined > multiple times. You can never be sure which of the definitions are used. > So I have nrpe checking in /etc/nrpe.ufz.d instead of the standard > /etc/nrpe.d, which often gets infested when updates roll in ;) > > You can execute "grep -rn check_disk /etc/nrpe.d/*" to check this. And > make sure that you change all commands in /etc/nrpe.cfg to comments. > > HTH, Werner > > -- Astrid Kuhr Institut f?r Energie- und Klimaforschung IEK-14 - Wasserstoffsicherheit Telefon +49 2461 61-6480 Telefax +49 2461 61-6856 E-Mail: a.kuhr at fz-juelich.de ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Forschungszentrum J?lich GmbH 52425 J?lich Sitz der Gesellschaft: J?lich Eingetragen im Handelsregister des Amtsgerichts D?ren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDir Stefan M?ller Gesch?ftsf?hrung: Prof. Dr. Astrid Lambrecht (Vorsitzende), Karsten Beneke (stellv. Vorsitzender), Dr. Ir. Pieter Jansens ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: Auswahl_001.bmp Type: image/bmp Size: 563706 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Auswahl_002.bmp Type: image/bmp Size: 593622 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Auswahl_003.bmp Type: image/bmp Size: 591246 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Auswahl_004.bmp Type: image/bmp Size: 584274 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Auswahl_005.bmp Type: image/bmp Size: 598590 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5894 bytes Desc: S/MIME Cryptographic Signature URL: From eric.schoeller at colorado.edu Mon Mar 18 18:42:10 2024 From: eric.schoeller at colorado.edu (Eric Schoeller) Date: Mon, 18 Mar 2024 11:42:10 -0600 Subject: Strange output issue with check_apt Message-ID: <3d21bc8c-ee84-4483-84cb-21b5415b054e@colorado.edu> Hello, This is a corner-case problem and I'm not entirely sure if it's something anyone will want to address. But I figured I'd mention it. I still use the text-based Nagios UI "cnagios" and it's having trouble parsing the output from check_apt in a way that I've never seen before. The hostname is gone and most of the status text is missing. Here are some examples, I'm not sure if images will come through on this list so if they don't I'll try to re-send as text only. Here is a host that has updates pending: You can see "sark" is missing from the "System Updates" check output. Here is a system that has no pending updates: Again, the hostname is missing, and most of the script output is also gone as well. Here is the actual plugin output from the command line for both: clu: /usr/lib/nagios/plugins/check_apt --critical="^[^\(]*\(.* (Debian-Security:|Ubuntu:[^/]*/[^-]*-security)" -o APT OK: 1 packages available for upgrade (0 critical updates). |available_upgrades=1;;;0 critical_updates=0;;;0 sark: /usr/lib/nagios/plugins/check_apt --critical="^[^\(]*\(.* (Debian-Security:|Ubuntu:[^/]*/[^-]*-security)" -o APT CRITICAL: 46 packages available for upgrade (46 critical updates). |available_upgrades=46;;;0 critical_updates=46;;;0 I "borrowed" that regex from the plugin help. I realize that cnagios is ancient and largely no longer supported so I can easily see this as being a problem with that software that won't get resolved, however, it processes plugin output from just about everything else OK so it leads me to believe there may be something buried within the check_apt output that may not be entirely nagios-friendly. It could simply be that it includes a newline at the end of the output, which as I recall is not exactly "compliant". cnagios doesn't wrap the plugin output onto additional lines, instead it just displays only what it can given the width of the window. I've stretched my window as wide as I can across two monitors and none of the missing text ever shows up. Thanks! Eric Schoeller Office of Information Technology University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dnnFqD0Eh0v4gyIT.png Type: image/png Size: 30457 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3tKG8fQy0u0ksWKu.png Type: image/png Size: 26770 bytes Desc: not available URL: