Check Device status

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Check Device status

Tony Eyles
Is there a way to check if a device is available?
For example checking if a USB Serial device shown in the system as /dev/ttyUSB0 is actively seen by the system?

I have tried

# check for USB serial adaptor as USB0
check filesystem USB_Serial0 path /dev/ttyUSB0
    if changed fsflags  then alert

and

# check for USB serial adaptor as USB0
check filesystem USB_Serial0 path /dev/ttyUSB0
    if not exist then alert



Tony
Reply | Threaded
Open this post in threaded view
|

Re: Check Device status

PhilTee
Hi Tony,

Have you tried FILE, instead of FILESYSTEM?

check file USB_Serial0 with path /dev/ttyUSB0
    if not exist then alert
Cheers!
Phil


On Mon, 29 Jul 2019 at 06:58, Tony Eyles <[hidden email]> wrote:
Is there a way to check if a device is available?
For example checking if a USB Serial device shown in the system as /dev/ttyUSB0 is actively seen by the system?

I have tried

# check for USB serial adaptor as USB0
check filesystem USB_Serial0 path /dev/ttyUSB0
    if changed fsflags  then alert

and

# check for USB serial adaptor as USB0
check filesystem USB_Serial0 path /dev/ttyUSB0
    if not exist then alert



Tony
Reply | Threaded
Open this post in threaded view
|

Re: Check Device status

Tony Eyles
I tried that :(
FILESYSTEM is suppose to check devices as well.  But is ttyUSB0 too devicie?


On Monday, 29 July 2019, 04:12:14 pm ACST, Phil Townes <[hidden email]> wrote:


Hi Tony,

Have you tried FILE, instead of FILESYSTEM?

check file USB_Serial0 with path /dev/ttyUSB0
    if not exist then alert
Cheers!
Phil


On Mon, 29 Jul 2019 at 06:58, Tony Eyles <[hidden email]> wrote:
Is there a way to check if a device is available?
For example checking if a USB Serial device shown in the system as /dev/ttyUSB0 is actively seen by the system?

I have tried

# check for USB serial adaptor as USB0
check filesystem USB_Serial0 path /dev/ttyUSB0
    if changed fsflags  then alert

and

# check for USB serial adaptor as USB0
check filesystem USB_Serial0 path /dev/ttyUSB0
    if not exist then alert



Tony