Is there a way to query online status from command line

I think there are better approaches: Search results for 'tags:monitoring+offline order:latest' - Storj Community Forum (official)

You may also request your external address with port of your node with curl (but not from the LAN), it would return the status in json.

See also