Quote from: PhiDeck on January 22, 2015, 06:17:40 AM
Unwelcome finding: it appears that the address of the syslog server must be hardcoded (numeric IP).
Was expecting the option of entering the server's name, and have the OBi110 use DNS to resolve it.
Sorry I didn't recall and/or mention the OBi syslog address must be an IP address. I found out the hard way when I was setting up my
papertrailapp.com account on the OBi110 and the URL did not work. I simply pinged the host address and used the IP address for the OBi syslog. I think papertrailapp syslogs probably use a load balancing system because I didn't always get the same IP address on pings. Luckily the one I chose seems to be working. I found the following official papertrailapp answer to the same question today: "Feel free to ping
logs.papertrailapp.com and use whichever address is returned. It's quite common for embedded devices to only accept an IP, so a lot of Papertrail customers do exactly the same thing." So I guess I did the correct thing back when I was shooting from the hip.
I was thinking your Raspberry Pi syslog would be at the patient's home alongside the OBi or tucked away somewhere safe (same network) and would be configured with a static IP address.
But if you want the Raspberry Pi in your home and want a Rube Goldberg solution (I can't stop my brain sometimes, forgive me) you could try this:
1. Run your syslog on a free
papertrailapp.com account:
The syslog port number is not the default 514 but should be set to the port number assigned in the
papertrailapp.com account and use a fixed IP for
logs.papertrailapp.com (see above verbose background). The IP probably won't change (famous last words...)
2. You probably already have a dynamic dns service like
www.noip.com to route a URL to your Raspberry Pi. Use the URL in the next step.
3. Set an alert notification on the
papertrailapp.com syslog to send the OFFHOOK and ONHOOK events to a "Webhook: POST matching events as JSON to an HTTP/HTTPS URL". The URL would be the URL from #2 above pointing to your Raspberry Pi.
4. Write a JSON service to be run on the Raspberry Pi. I have to bail on this one. I don't know JSON. I could probably learn it (wishful thinking) but my laziness knows no boundaries.
As a halfazzed proof of concept I setup an alert notification to my email address on my papertrailapp syslog that looks like this:
SearchName: HOOKSTATUS
Query: "Slic#0 OFF HOOK" OR "Slic#0 ONHOOK"
One test, I received an
email with:
Jan 23 22:18:03 obi1 logger: [SLIC]:Slic#0 OFF HOOK
Jan 23 22:18:14 obi1 logger: [SLIC]:Slic#0 ONHOOK
I used a one-minute time increment on the alert frequency. I had never tried the alert notifications. So I learned something today. I made the query an "OR" because two separate alert queries resulted in emails coming in with events out of order (sometimes). Trust me on this one.
I left out some detail in the flowchart. That would be where the "miracle occurs".
This is where I pass the underinflated football and you catch it and run in for a touchdown.