I am trying to write a script that will check the status of devices shared across eveusb across a hostlist. The issue that I am having is that the results section will not allow me to include a $store_host parameter and given that the store host is included in the part I need to search for, I am unable to narrow it down to make it actually work.
This is my if statement, and the $store_host variable is not being accepted but it is needed for the script to work
if ($results -like ‘connected $store_host,1811*’)
And this is what the output of the command looks like when you run it:
connected X0308155R003,1811,usb1,port1,zebra,ZTC ZD410-203dpi ZPL,E,
Without the variable being used, I can’t make it work off of a host list. No amount of editing seems to make it recognize everything, but I can’t limit it to just searching the port or for the work connected cuz there are 3 ports I’m watching and if they are disconnected, they’re listed as disconnected