Question regarding send/exprect test

"S. Seide" <[email protected]>
Newsgroups gmane.comp.monitoring.monit.general
Message-ID <[email protected]>
Hello,

currently i try to setup an generic tcp test for an mqtt server. The
protocol is simple but a binary one (1).

The following test send the correct CONNECT package to the server but i
did not manage to create a working expect string. Ist it possible or do
we need an nativ implementation of the protocol for a specific
connection test?


check process mosquitto with pidfile /var/run/mosquitto.pid
 if failed port 1883
  send "\0x10\0x16\0x00\0x04MQTT\0x04\0x02\0x00\0x02\0x00\0x05Monitoring"
  expect "\0x20\0x00\0x00\0x00"  # con ok
  send "\0xE0\0x00"              # disconnect
  then alert

other expected string may be connection refused/not authorized if auth
is required:
  expect "\0x20\0x00\0x00\0x05"


Thanks in advance,
S. Seide


(1) http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html

-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.