Xymon Mailing List Archive search

usb disk not showing

13 messages in this thread

list Kris Springer · Mon, 28 Nov 2022 06:57:33 -0700 ·
I've recently installed a xymon server on Debian to monitor my home network, and I'd like the server to also show the status of a USB drive I have plugged into it.? The drive is listed as /dev/sda and mounted at /media/user/USB-1TB
It is listed in the xymon client data, but it doesn't show up on the 'disk' or 'inode' columns at all.? I've commented out the default IGNORE rules from analysis.cfg and even tried adding the following as a host specific test, but still nothing appears.
DISK /dev/sda 80 90
INODE /dev/sda 80 90

Anyone have a clue they could give me?

-- 
Kris Springer
list Norbert Kriegenburg · Mon, 28 Nov 2022 16:36:36 +0100 ·
Hi Kris,

the disk and inode section are generated by the client script for the OS,
in your case it is the xymonclient-linux,sh (in the client bin dir).
Normally the command there is df -lP -x $EXCLUDES...
This will only use the local filesystems and excludes a lot of non usual fs.
You can just remove the "l" from the df call, or, if this is not enough,
remove the "-x $EXCLUDES" as well (or modify the EXCLUDE generation line)..
You can run the script at the shell manually to immediately see the results.

This has nothing to do with the analysis.cfg file at server side, this only
defines the rules for alerting, but can only use info which is provided by
the client beforehand.

Hope that points you to the right direction.

Norbert

Am Mo., 28. Nov. 2022 um 14:58 Uhr schrieb Kris Springer <
user-c2caa0a7a8d5@xymon.invalid>:
quoted from Kris Springer
I've recently installed a xymon server on Debian to monitor my home
network, and I'd like the server to also show the status of a USB drive
I have plugged into it.  The drive is listed as /dev/sda and mounted at
/media/user/USB-1TB
It is listed in the xymon client data, but it doesn't show up on the
'disk' or 'inode' columns at all.  I've commented out the default IGNORE
rules from analysis.cfg and even tried adding the following as a host
specific test, but still nothing appears.
DISK /dev/sda 80 90
INODE /dev/sda 80 90

Anyone have a clue they could give me?

--
Kris Springer

list Adam Thorn · Mon, 28 Nov 2022 18:00:27 +0000 ·
quoted from Kris Springer
On 28/11/2022 13:57, Kris Springer wrote:
I've recently installed a xymon server on Debian to monitor my home network, and I'd like the server to also show the status of a USB drive I have plugged into it.? The drive is listed as /dev/sda and mounted at /media/user/USB-1TB
It is listed in the xymon client data, but it doesn't show up on the 'disk' or 'inode' columns at all.? I've commented out the default IGNORE rules from analysis.cfg and even tried adding the following as a host specific test, but still nothing appears.
DISK /dev/sda 80 90
INODE /dev/sda 80 90
For DISK and INODE entries in analysis.cfg you need to specify the mountpoint rather than the device name, e.g.

HOST=my.example.host
   DISK /media/user/USB-1TB 80 90

Quoting selectively from "man analysis.cfg"..

DISK filesystem warnlevel paniclevel
...
"filesystem" is the mount-point where the filesystem is mounted, e.g. "/usr" or "/home".

If you had a default IGNORE rule then I think that's non-standard, because the default rule for DISK is

DEFAULT
   DISK * 90 95

Note that analysis.cfg is read top-to-bottom and the first matching rule wins, so it's important to check that the analysis rule you're adding isn't being overriden by something earlier in the file.

Adam
list Kris Springer · Mon, 28 Nov 2022 17:55:40 -0700 ·
I tried
DISK /media/user/USB-1TB 80 90

Didn't work.

Kris Springer
quoted from Adam Thorn


On 11/28/22 11:00 AM, Adam Thorn wrote:
On 28/11/2022 13:57, Kris Springer wrote:
I've recently installed a xymon server on Debian to monitor my home network, and I'd like the server to also show the status of a USB drive I have plugged into it.? The drive is listed as /dev/sda and mounted at /media/user/USB-1TB
It is listed in the xymon client data, but it doesn't show up on the 'disk' or 'inode' columns at all.? I've commented out the default IGNORE rules from analysis.cfg and even tried adding the following as a host specific test, but still nothing appears.
DISK /dev/sda 80 90
INODE /dev/sda 80 90
For DISK and INODE entries in analysis.cfg you need to specify the mountpoint rather than the device name, e.g.

HOST=my.example.host
? DISK /media/user/USB-1TB 80 90

Quoting selectively from "man analysis.cfg"..

DISK filesystem warnlevel paniclevel
...
"filesystem" is the mount-point where the filesystem is mounted, e.g. "/usr" or "/home".

If you had a default IGNORE rule then I think that's non-standard, because the default rule for DISK is

DEFAULT
? DISK * 90 95

Note that analysis.cfg is read top-to-bottom and the first matching rule wins, so it's important to check that the analysis rule you're adding isn't being overriden by something earlier in the file.

Adam
list Kris Springer · Mon, 28 Nov 2022 18:21:26 -0700 ·
Thanks for pointing me in the direction of the client script.? I messed around with it a lot and found that nothing I did would result in the USB drive showing up on the Server webpage in Disk or Inode pages.? I can get different results to appear by messing with the xymonclient-linux.sh script, but the USB drive never does. Running the script manually does display the USB drive in the [df] list, but it's as if something keeps stripping it from displaying on the Server's pages.? I even went so far as to comment out all of the options for df in the script and just run df without any other lines of grep or excludes, and still no joy.? There seems to be a break in the chain between the results shown by the client script and the results the Server displays on the Disk page.

So then in the script with all the df stuff commented out, I had it run
df /dev/sda
The results of the script show the USB, but nothing shows up on the Server Disk page except this error.
Expected strings (Capacity and Mounted) not found in df output

So, anyone know what's stripping the /dev/sda disk from the output, or why Capacity and Mounted can't be seen when the client script is outputting it just like the other drives?

Here's the output of the script that clearly shows the USB drive info.
[df]
Filesystem??????? 1K-blocks??????? Used??????? Available??? Use% Mounted on
/dev/sda??? ??? 960303848??? 268800??? 911180536??????? 1% /media/user/USB-1TB


Kris Springer
quoted from Norbert Kriegenburg


On 11/28/22 8:36 AM, nor krie wrote:
Hi Kris,

the disk and inode section are generated by the client script for the OS, in your case it is the xymonclient-linux,sh (in the client bin dir).
Normally the command there is df -lP -x $EXCLUDES...
This will only use the local filesystems and excludes a lot of non usual fs.
You can just remove the "l" from the df call, or, if this is not enough, remove the "-x $EXCLUDES" as well (or modify the EXCLUDE generation line)..
You can run the script at the shell manually to immediately see the results.

This has nothing to do with the analysis.cfg file at server side, this only defines the rules for alerting, but can only use info which is provided by the client beforehand.

Hope that points you to the right direction.

Norbert

Am Mo., 28. Nov. 2022 um 14:58?Uhr schrieb Kris Springer <user-c2caa0a7a8d5@xymon.invalid>:
quoted from Kris Springer

    I've recently installed a xymon server on Debian to monitor my home
    network, and I'd like the server to also show the status of a USB
    drive
    I have plugged into it.? The drive is listed as /dev/sda and
    mounted at
    /media/user/USB-1TB
    It is listed in the xymon client data, but it doesn't show up on the
    'disk' or 'inode' columns at all.? I've commented out the default
    IGNORE
    rules from analysis.cfg and even tried adding the following as a host
    specific test, but still nothing appears.
    DISK /dev/sda 80 90
    INODE /dev/sda 80 90

    Anyone have a clue they could give me?

    --     Kris Springer

list Kris Springer · Mon, 28 Nov 2022 21:28:43 -0700 ·
mount -l | grep USB-1TB shows
/dev/sda on /media/user/USB-1TB type ext4 
(rw,nosuid,nodev,relatime,errors=remount-ro,uhelper=udisks2) [USB-1TB]

Kris Springer
quoted from Kris Springer


On 11/28/22 9:24 PM, Michael T Pins wrote:
Thanks for pointing me in the direction of the client script.	 I messed
around with it a lot and found that nothing I did would result in the
USB drive showing up on the Server webpage in Disk or Inode pages.  I can
get different results to appear by messing with the xymonclient-linux.sh
script, but the USB drive never does. Running the script manually does
display the USB drive in the [df] list, but it's as if something keeps
stripping it from displaying on the Server's pages.  I even went so
far as to comment out all of the options for df in the script and just
run df without any other lines of grep or excludes, and still no joy.
There seems to be a break in the chain between the results shown by the
client script and the results the Server displays on the Disk page.

So then in the script with all the df stuff commented out, I had it run
df /dev/sda
The results of the script show the USB, but nothing shows up on the
Server Disk page except this error.
Expected strings (Capacity and Mounted) not found in df output

So, anyone know what's stripping the /dev/sda disk from the output,
or why Capacity and Mounted can't be seen when the client script is
outputting it just like the other drives?

Here's the output of the script that clearly shows the USB drive info.
[df]
Filesystem        1K-blocks        Used        Available    Use% Mounted on
/dev/sda        960303848    268800    911180536        1% /media/user/USB-1TB
  
You've changed what df format you're sending to the xymon server.
xymond is expecting POSIX headers, i.e.:
   Filesystem        1024-blocks      Used      Available  Capacity Mounted on

At a minimum, you need to be running "df -P" (and likely "df -Pl",
unless you really want non-local disks listed for some bizarre reason).

In general, the only thing you should ever need to change in that file
is the appropriate EXCLUDES= line.

What type of filesystem is /media/user/USB-1TB being mounted as?
( What's the output of: `mount -l | grep USB-1TB` )
list Adam Thorn · Tue, 29 Nov 2022 15:28:13 +0000 ·
quoted from Kris Springer
On 29/11/2022 01:21, Kris Springer wrote:
Thanks for pointing me in the direction of the client script.  I messed around with it a lot
I'd advise against editing the xymonclient script unless you're very careful, because...
quoted from Kris Springer
So then in the script with all the df stuff commented out, I had it run
df /dev/sda
...putting this in the client script will break server-side processing because...
quoted from Kris Springer
The results of the script show the USB, but nothing shows up on the Server Disk page except this error.
Expected strings (Capacity and Mounted) not found in df output
..one of the df arguments specified in the original client script is "-P" which specifies "use the POSIX output format". Compare the header row generated by df with and without -P:

$ df | head -n1
Filesystem     1K-blocks    Used Available Use% Mounted on

$ df -P | head -n1
Filesystem     1024-blocks    Used Available Capacity Mounted on

xymond is expecting the latter format, so by manually hacking the client script and changing the arguments, the message sent to the server is no longer in the format it expects - which is what's leading to that "Expected strings ... not found" message, I think.

I'd suggest putting the original client script back in place and debugging from there. Perhaps a good place to start would be with a very simple analysis.cfg with just two lines:

DEFAULT
   DISK * 90 95

and nothing else. If your disk then shows up in the 'disk' report, the problem is somewhere in your live analysis.cfg. I'm not immediately sure when analysis.cfg is reread - I can't see any mention in the documentation, but I may not be looking in the right place.

Adam
list Kris Springer · Tue, 29 Nov 2022 09:10:39 -0700 ·
Continued thanks for the responses.? I did try commenting everything out of the analysis.cfg except for the default DISK * line, but still no joy.? I don't think analysis.cfg is causing the USB to be ignored.? The xymonclient-linux script has been set back to it's original state.

Kris Springer
quoted from Adam Thorn


On 11/29/22 08:28, Adam Thorn wrote:
On 29/11/2022 01:21, Kris Springer wrote:
Thanks for pointing me in the direction of the client script.? I messed around with it a lot
I'd advise against editing the xymonclient script unless you're very careful, because...
So then in the script with all the df stuff commented out, I had it run
df /dev/sda
...putting this in the client script will break server-side processing because...
The results of the script show the USB, but nothing shows up on the Server Disk page except this error.
Expected strings (Capacity and Mounted) not found in df output
..one of the df arguments specified in the original client script is "-P" which specifies "use the POSIX output format". Compare the header row generated by df with and without -P:

$ df | head -n1
Filesystem???? 1K-blocks??? Used Available Use% Mounted on

$ df -P | head -n1
Filesystem???? 1024-blocks??? Used Available Capacity Mounted on

xymond is expecting the latter format, so by manually hacking the client script and changing the arguments, the message sent to the server is no longer in the format it expects - which is what's leading to that "Expected strings ... not found" message, I think.

I'd suggest putting the original client script back in place and debugging from there. Perhaps a good place to start would be with a very simple analysis.cfg with just two lines:

DEFAULT
? DISK * 90 95

and nothing else. If your disk then shows up in the 'disk' report, the problem is somewhere in your live analysis.cfg. I'm not immediately sure when analysis.cfg is reread - I can't see any mention in the documentation, but I may not be looking in the right place.

Adam
list Norbert Kriegenburg · Tue, 29 Nov 2022 18:07:26 +0100 ·
Hi Kris,

in analysis.cfg you can only set thresholds for disks which are reported by
the client and thus are already visible in the disk and inode column of
your Xymon server.
If there is no USB drive and no graph, then you don't need to mess up with
server side config.
By default the Xymon client will only provide info about local disks (which
makes sense, as the remote mounted disks should be monitored at the source
and not at dozens of connected servers), and also only for fixed mounted
disks to avoid alerts if a removable media gets disconnected.
If you want to change this you have to modify the linux client script (but
as pointed out, ensure the output as Posix standard to not confuse the
server side evaluation!).
So it is no problem to remove the "l" from "df -Pl", but not the "P". You
can also remove the "-x $EXCLUDES" w/o problems.
Does a "df -P | grep USB" show your USB drive?
If yes, modify the client script and test by "./xymonclient-linux.sh | grep
USB". This also should show your USB drive.
If not, the disk is not properly mounted.

Norbert


Am Di., 29. Nov. 2022 um 17:11 Uhr schrieb Kris Springer <
user-c2caa0a7a8d5@xymon.invalid>:
quoted from Kris Springer
Continued thanks for the responses.  I did try commenting everything out
of the analysis.cfg except for the default DISK * line, but still no
joy.  I don't think analysis.cfg is causing the USB to be ignored.  The
xymonclient-linux script has been set back to it's original state.

Kris Springer


On 11/29/22 08:28, Adam Thorn wrote:
On 29/11/2022 01:21, Kris Springer wrote:
Thanks for pointing me in the direction of the client script.  I
messed around with it a lot
I'd advise against editing the xymonclient script unless you're very
careful, because...
So then in the script with all the df stuff commented out, I had it run
df /dev/sda
...putting this in the client script will break server-side processing
because...
The results of the script show the USB, but nothing shows up on the
Server Disk page except this error.
Expected strings (Capacity and Mounted) not found in df output
..one of the df arguments specified in the original client script is
"-P" which specifies "use the POSIX output format". Compare the header
row generated by df with and without -P:

$ df | head -n1
Filesystem     1K-blocks    Used Available Use% Mounted on

$ df -P | head -n1
Filesystem     1024-blocks    Used Available Capacity Mounted on

xymond is expecting the latter format, so by manually hacking the
client script and changing the arguments, the message sent to the
server is no longer in the format it expects - which is what's leading
to that "Expected strings ... not found" message, I think.

I'd suggest putting the original client script back in place and
debugging from there. Perhaps a good place to start would be with a
very simple analysis.cfg with just two lines:

DEFAULT
  DISK * 90 95

and nothing else. If your disk then shows up in the 'disk' report, the
problem is somewhere in your live analysis.cfg. I'm not immediately
sure when analysis.cfg is reread - I can't see any mention in the
documentation, but I may not be looking in the right place.

Adam
list Norbert Kriegenburg · Tue, 29 Nov 2022 18:24:22 +0100 ·
Ah,

one more thing came to my mind: at some Unixes the df breaks the line for
longer mountpoints, causing the whole evaluation at server side to ignore
this.
So your "df -P | grep USB" should show the whole line and not only the
mountpoint (same for the manual run of the linux script of course).

Norbert

Am Di., 29. Nov. 2022 um 18:07 Uhr schrieb nor krie <user-ff2afb5e635f@xymon.invalid>:
quoted from Norbert Kriegenburg
Hi Kris,

in analysis.cfg you can only set thresholds for disks which are reported
by the client and thus are already visible in the disk and inode column of
your Xymon server.
If there is no USB drive and no graph, then you don't need to mess up with
server side config.
By default the Xymon client will only provide info about local disks
(which makes sense, as the remote mounted disks should be monitored at the
source and not at dozens of connected servers), and also only for fixed
mounted disks to avoid alerts if a removable media gets disconnected.
If you want to change this you have to modify the linux client script (but
as pointed out, ensure the output as Posix standard to not confuse the
server side evaluation!).
So it is no problem to remove the "l" from "df -Pl", but not the "P". You
can also remove the "-x $EXCLUDES" w/o problems.
Does a "df -P | grep USB" show your USB drive?
If yes, modify the client script and test by "./xymonclient-linux.sh |
grep USB". This also should show your USB drive.
If not, the disk is not properly mounted.

Norbert


Am Di., 29. Nov. 2022 um 17:11 Uhr schrieb Kris Springer <
user-c2caa0a7a8d5@xymon.invalid>:
Continued thanks for the responses.  I did try commenting everything out
of the analysis.cfg except for the default DISK * line, but still no
joy.  I don't think analysis.cfg is causing the USB to be ignored.  The
xymonclient-linux script has been set back to it's original state.

Kris Springer


On 11/29/22 08:28, Adam Thorn wrote:
On 29/11/2022 01:21, Kris Springer wrote:
Thanks for pointing me in the direction of the client script.  I
messed around with it a lot
I'd advise against editing the xymonclient script unless you're very
careful, because...
So then in the script with all the df stuff commented out, I had it run
df /dev/sda
...putting this in the client script will break server-side processing
because...
The results of the script show the USB, but nothing shows up on the
Server Disk page except this error.
Expected strings (Capacity and Mounted) not found in df output
..one of the df arguments specified in the original client script is
"-P" which specifies "use the POSIX output format". Compare the header
row generated by df with and without -P:

$ df | head -n1
Filesystem     1K-blocks    Used Available Use% Mounted on

$ df -P | head -n1
Filesystem     1024-blocks    Used Available Capacity Mounted on

xymond is expecting the latter format, so by manually hacking the
client script and changing the arguments, the message sent to the
server is no longer in the format it expects - which is what's leading
to that "Expected strings ... not found" message, I think.

I'd suggest putting the original client script back in place and
debugging from there. Perhaps a good place to start would be with a
very simple analysis.cfg with just two lines:

DEFAULT
  DISK * 90 95

and nothing else. If your disk then shows up in the 'disk' report, the
problem is somewhere in your live analysis.cfg. I'm not immediately
sure when analysis.cfg is reread - I can't see any mention in the
documentation, but I may not be looking in the right place.

Adam
list Kris Springer · Tue, 29 Nov 2022 12:41:57 -0700 ·
Running df -P | grep USB manually results in? the following results, with quite a bit of space between the output sections.
/dev/sda?????????????????? 960303848? 268800 911180536?????? 1% /media/user/USB-1TB

Putting df -P | grep USB into the script results in the Server page showing the 'Expected strings (Capacity and Mounted) not found' error

Kris Springer
quoted from Norbert Kriegenburg

On 11/29/22 10:07, nor krie wrote:
Hi Kris,

in analysis.cfg you can only set thresholds for disks which are reported by the client and thus are already visible in the disk and inode column of your Xymon server.
If there is no USB drive and no graph, then you don't need to mess up with server side config.
By default the Xymon client will only provide info about local disks (which makes sense, as the remote mounted disks should be monitored at the source and not at dozens of connected servers), and also only for fixed mounted disks to avoid alerts if a removable media gets disconnected.
If you want to change this you have to modify the linux client script (but as pointed out, ensure the output as Posix standard to not confuse the server side evaluation!).
So it is no problem to remove the "l" from "df -Pl", but not the "P". You can also remove the "-x $EXCLUDES" w/o problems.
Does a "df -P | grep USB" show your USB drive?
If yes, modify the client script and test by "./xymonclient-linux.sh | grep USB". This also should show your USB drive.
If not, the disk is not properly mounted.

Norbert


Am Di., 29. Nov. 2022 um 17:11?Uhr schrieb Kris Springer <user-c2caa0a7a8d5@xymon.invalid>:
quoted from Norbert Kriegenburg

    Continued thanks for the responses.? I did try commenting
    everything out
    of the analysis.cfg except for the default DISK * line, but still no
    joy.? I don't think analysis.cfg is causing the USB to be
    ignored.? The
    xymonclient-linux script has been set back to it's original state.

    Kris Springer


    On 11/29/22 08:28, Adam Thorn wrote:
On 29/11/2022 01:21, Kris Springer wrote:
Thanks for pointing me in the direction of the client script.? I
messed around with it a lot
I'd advise against editing the xymonclient script unless you're
    very
careful, because...
So then in the script with all the df stuff commented out, I
    had it run
df /dev/sda
...putting this in the client script will break server-side
    processing
because...
The results of the script show the USB, but nothing shows up on
    the
Server Disk page except this error.
Expected strings (Capacity and Mounted) not found in df output
..one of the df arguments specified in the original client
    script is
"-P" which specifies "use the POSIX output format". Compare the
    header
row generated by df with and without -P:

$ df | head -n1
Filesystem???? 1K-blocks??? Used Available Use% Mounted on

$ df -P | head -n1
Filesystem???? 1024-blocks??? Used Available Capacity Mounted on

xymond is expecting the latter format, so by manually hacking the
client script and changing the arguments, the message sent to the
server is no longer in the format it expects - which is what's
    leading
to that "Expected strings ... not found" message, I think.

I'd suggest putting the original client script back in place and
debugging from there. Perhaps a good place to start would be with a
very simple analysis.cfg with just two lines:

DEFAULT
? DISK * 90 95

and nothing else. If your disk then shows up in the 'disk'
    report, the
problem is somewhere in your live analysis.cfg. I'm not immediately
sure when analysis.cfg is reread - I can't see any mention in the
documentation, but I may not be looking in the right place.

Adam
list Norbert Kriegenburg · Tue, 29 Nov 2022 22:54:42 +0100 ·
Oh,

that was a misunderstanding. You should not change the client script that
way, but test at shell level what the df -P output is like (especially if
the USB output is all in one line).
As Michael pointed out, the server routines needs the standard Posix output
format.
But if you run the standard client script manually, you will see the same
output as at server side under "client info available". In the df section
there should be the USB disk usage in one line like the other partitions.
If it is not there, but visible by df -P at the client, then it is stripped
by the $EXCLUDE in the client script.

Norbert

Am Di., 29. Nov. 2022 um 20:41 Uhr schrieb Kris Springer <
user-c2caa0a7a8d5@xymon.invalid>:
quoted from Kris Springer
Running df -P | grep USB manually results in  the following results, with
quite a bit of space between the output sections.
/dev/sda                   960303848  268800 911180536       1%
/media/user/USB-1TB

Putting df -P | grep USB into the script results in the Server page
showing the 'Expected strings (Capacity and Mounted) not found' error

Kris Springer


On 11/29/22 10:07, nor krie wrote:

Hi Kris,

in analysis.cfg you can only set thresholds for disks which are reported
by the client and thus are already visible in the disk and inode column of
your Xymon server.
If there is no USB drive and no graph, then you don't need to mess up with
server side config.
By default the Xymon client will only provide info about local disks
(which makes sense, as the remote mounted disks should be monitored at the
source and not at dozens of connected servers), and also only for fixed
mounted disks to avoid alerts if a removable media gets disconnected.
If you want to change this you have to modify the linux client script (but
as pointed out, ensure the output as Posix standard to not confuse the
server side evaluation!).
So it is no problem to remove the "l" from "df -Pl", but not the "P". You
can also remove the "-x $EXCLUDES" w/o problems.
Does a "df -P | grep USB" show your USB drive?
If yes, modify the client script and test by "./xymonclient-linux.sh |
grep USB". This also should show your USB drive.
If not, the disk is not properly mounted.

Norbert


Am Di., 29. Nov. 2022 um 17:11 Uhr schrieb Kris Springer <
user-c2caa0a7a8d5@xymon.invalid>:
Continued thanks for the responses.  I did try commenting everything out
of the analysis.cfg except for the default DISK * line, but still no
joy.  I don't think analysis.cfg is causing the USB to be ignored.  The
xymonclient-linux script has been set back to it's original state.

Kris Springer


On 11/29/22 08:28, Adam Thorn wrote:
On 29/11/2022 01:21, Kris Springer wrote:
Thanks for pointing me in the direction of the client script.  I
messed around with it a lot
I'd advise against editing the xymonclient script unless you're very
careful, because...
So then in the script with all the df stuff commented out, I had it run
df /dev/sda
...putting this in the client script will break server-side processing
because...
The results of the script show the USB, but nothing shows up on the
Server Disk page except this error.
Expected strings (Capacity and Mounted) not found in df output
..one of the df arguments specified in the original client script is
"-P" which specifies "use the POSIX output format". Compare the header
row generated by df with and without -P:

$ df | head -n1
Filesystem     1K-blocks    Used Available Use% Mounted on

$ df -P | head -n1
Filesystem     1024-blocks    Used Available Capacity Mounted on

xymond is expecting the latter format, so by manually hacking the
client script and changing the arguments, the message sent to the
server is no longer in the format it expects - which is what's leading
to that "Expected strings ... not found" message, I think.

I'd suggest putting the original client script back in place and
debugging from there. Perhaps a good place to start would be with a
very simple analysis.cfg with just two lines:

DEFAULT
  DISK * 90 95

and nothing else. If your disk then shows up in the 'disk' report, the
problem is somewhere in your live analysis.cfg. I'm not immediately
sure when analysis.cfg is reread - I can't see any mention in the
documentation, but I may not be looking in the right place.

Adam
list Kris Springer · Tue, 29 Nov 2022 15:57:07 -0700 ·
I've finally fixed it.? Adam's suggestions pointed me in the right 
direction.? I'm not sure this should be considered a solution, but I 
reformatted the drive and specified the block size to be 1024 instead of 
letting the OS decide.? It showed up on the Xymon Server disk list 
properly as soon as I did that.

Kris Springer
quoted from Norbert Kriegenburg


On 11/29/22 2:54 PM, nor krie wrote:
Oh,

that was a misunderstanding. You should not change the client script 
that way, but test at shell level what the df -P output is like 
(especially if the USB output is all in one line).
As Michael pointed out, the server routines needs the standard Posix 
output format.
But if you run the standard client script manually, you will see the 
same output as at server side under "client info available". In the df 
section there should be the USB disk usage in one line like the other 
partitions.
If it is not there, but visible by df -P at the client, then it is 
stripped by the $EXCLUDE in the client script.

Norbert

Am Di., 29. Nov. 2022 um 20:41?Uhr schrieb Kris Springer 
quoted from Norbert Kriegenburg
<user-c2caa0a7a8d5@xymon.invalid>:

    Running df -P | grep USB manually results in? the following
    results, with quite a bit of space between the output sections.
    /dev/sda?????????????????? 960303848? 268800 911180536 1%
    /media/user/USB-1TB

    Putting df -P | grep USB into the script results in the Server
    page showing the 'Expected strings (Capacity and Mounted) not
    found' error

    Kris Springer

    On 11/29/22 10:07, nor krie wrote:
    Hi Kris,

    in analysis.cfg you can only set thresholds for disks which are
    reported by the client and thus are already visible in the disk
    and inode column of your Xymon server.
    If there is no USB drive and no graph, then you don't need to
    mess up with server side config.
    By default the Xymon client will only provide info about local
    disks (which makes sense, as the remote mounted disks should be
    monitored at the source and not at dozens of connected servers),
    and also only for fixed mounted disks to avoid alerts if a
    removable media gets disconnected.
    If you want to change this you have to modify the linux client
    script (but as pointed out, ensure the output as Posix standard
    to not confuse the server side evaluation!).
    So it is no problem to remove the "l" from "df -Pl", but not the
    "P". You can also remove the "-x $EXCLUDES" w/o problems.
    Does a "df -P | grep USB" show your USB drive?
    If yes, modify the client script and test by
    "./xymonclient-linux.sh | grep USB". This also should show your
    USB drive.
    If not, the disk is not properly mounted.

    Norbert


    Am Di., 29. Nov. 2022 um 17:11?Uhr schrieb Kris Springer
    <user-c2caa0a7a8d5@xymon.invalid>:

        Continued thanks for the responses.? I did try commenting
        everything out
        of the analysis.cfg except for the default DISK * line, but
        still no
        joy.? I don't think analysis.cfg is causing the USB to be
        ignored.? The
        xymonclient-linux script has been set back to it's original
        state.

        Kris Springer


        On 11/29/22 08:28, Adam Thorn wrote:
On 29/11/2022 01:21, Kris Springer wrote:
Thanks for pointing me in the direction of the client
        script.? I
messed around with it a lot
I'd advise against editing the xymonclient script unless
        you're very
careful, because...
So then in the script with all the df stuff commented out,
        I had it run
df /dev/sda
...putting this in the client script will break server-side
        processing
because...
The results of the script show the USB, but nothing shows
        up on the
Server Disk page except this error.
Expected strings (Capacity and Mounted) not found in df output
..one of the df arguments specified in the original client
        script is
"-P" which specifies "use the POSIX output format". Compare
        the header
row generated by df with and without -P:

$ df | head -n1
Filesystem???? 1K-blocks??? Used Available Use% Mounted on

$ df -P | head -n1
Filesystem???? 1024-blocks??? Used Available Capacity
        Mounted on
xymond is expecting the latter format, so by manually
        hacking the
client script and changing the arguments, the message sent
        to the
server is no longer in the format it expects - which is
        what's leading
to that "Expected strings ... not found" message, I think.

I'd suggest putting the original client script back in
        place and
debugging from there. Perhaps a good place to start would
        be with a
very simple analysis.cfg with just two lines:

DEFAULT
? DISK * 90 95

and nothing else. If your disk then shows up in the 'disk'
        report, the
problem is somewhere in your live analysis.cfg. I'm not
        immediately
sure when analysis.cfg is reread - I can't see any mention
        in the
documentation, but I may not be looking in the right place.

Adam