Mac utility to watch sqlite table and post as JSON? - json

anyone know of:
a utility that will run on the Apple Mac that will
listen to changes on a set of tables on a local sqlite table and via
a configuration mechanism to then
HTTP post those ongoing changes as JSON requests
to a remote http or apache camel server?
Thanks, Martin.

Related

How to send json syslog messages to a remote host with ulogd2

I am working on a project to log connection tracking events with ulogd2. I want to know if there is any way to send messages to a remote host in JSON format. So far, I was able to save the message to a JSON file on the local server, but I don't want to save it in the local machine, I just want to send it. Or maybe if there is a way to send the file and after that delete it.
I would really appreciate your help.
Usually syslog logs are sent to remote servers via one of the syslog network protocols, rsyslog is often used for this purpose. On the receiving end you can also use rsyslog to collect it into the syslog of the remote server.
On the receiving side you can also use tools like fluentd to collect the syslog messages and write them to a file as JSON or do a number of other tings with them. An alternative tool to do this as well is called filebeat.
You can also install tools on the server creating the logs, instead of rsyslog which you can configure to send them via some method other than the syslog protocol if you so desire. Filebeat can do this and fluent bit(lightweight version of fluentd) as well.

Spring Cloud Dataflow routing by JSON header

I have been trying to create a stream with Spring Cloud Dataflow but have not had much luck (mostly due to the lack of documentation).
Issue 1: Accessing web GUI of dockerized Spring Cloud Dataflow
I have a dockerized Spring Cloud server running with Kafka on a basic Ubuntu container. For some reason I can't access the web GUI in Windows (at < docker-machine ip >:9393/dashboard). However, I have a separate Docker Ubuntu container running Nginx reverse proxy, which shows up when I go to < docker-machine ip >/index.html or etc. I don't think it is an issue with ports, I have the Spring Cloud container setup with -p 9393:9393 and the port is otherwise unused.
Issue 2: Routing by JSON Header
My ultimate goal is to get a file loaded in from Nginx and routed based on its JSON header (there are two different JSON headers) and then ingest queries to Cassandra.
I can do all of this except the sorting by JSON header. Which app would you recommend I use?
Issue 1: Accessing web GUI of dockerized Spring Cloud Dataflow
We might need little more details around this. Assuming this is the local-server, perhaps you could share the docker scripts/image, so we could try it out.
Issue 2: Routing by JSON Header
The router-sink application would come handy for this type of use-cases. This application routes the payload to named destinations based on certain conditions, so you'd have the opportunity to route the payload with respective ingest-query to Cassandra.
stream 1:
stream create test --definition "file | router --expression=header.contains('a')?':foo':':bar’"
stream 2:
stream create baz --definition ":foo > cassandra --ingest-query=\"query1\""
stream 3:
stream create wiz --definition ":bar > cassandra --ingest-query=\"query2\""
(where: foo and bar are named destinations)

Using zabbix_sender for host discovery

I'm writing an application which delivers data from remote devices over an HTTP API. These devices are on a mobile data connection and have limited resources.
I wish to receive custom monitoring data over the HTTP API, relying on the security model designed in the application, and push that data to Zabbix directly (or indirectly) from node.js. I do not wish to use Zabbix Agent on the remote devices.
I see that I can use zabbix_sender to send data to a Zabbix server containing a pre-configured host. This works great. I intend to deliver monitoring data over my custom API, and when received give this data to zabbix_sender inside the server network.
The problem is there are many devices in the field and more are being added all the time.
TL;DR:
When zabbix_sender provides a custom hostname which doesn't exist in Zabbix already, it fails.
I would like to auto-add discovered hosts, based upon new hostnames from zabbix_sender. How would I do this?
Also, extra respect if anyone can give examples of how to avoid zabbix_sender and send data directly from node.js to the Zabbix server. I mean: suggest an NPM package that you have experience using. (Update: Found working node.js package here: https://www.npmjs.com/package/node-zabbix-sender)
Zabbix configuration: I'm learning from Zabbix 2.4 installed in Docker, no custom configuration from this Dockerhub: https://hub.docker.com/r/zabbix/zabbix-2.4/
Probably the best would be to use the Zabbix API to create hosts directly.
Alternatively, you could set up an action and emulate active agent connection, which would make Zabbix create the host via the active agent auto-regstration.
You could also use low level discovery (LLD) to send in JSON, which would result in hosts/items being created, based on prototypes.
In all of these cases you have to wait for one minute (by default) for the hosts to appear in the Zabbix cache, then you can send the data.
Also note that Zabbix 2.4 is not supported anymore, it will receive no fixes - it is not a "long-term support" release.

Hosting html file over mosquitto

I just found that mosquitto had got a websockets upgrade which allows it to
host the HTTP services.
I tried hosting a html file using the websockets feature on the port 8080.
The mosquitto broker seems to start fine and the mqtt services on the other ports seem to function properly. But when i try to access the html file over the localhost I get the a response saying no data sent by the server.
I am not sure where my mistake lies..Any ideas?
Mosquitto is not a HTTP server, it can not serve generic files.
The HTTP listener is only there to facilitate an upgrade to the websocket protocol in order to run MQTT over a websocket connection.
You might want to look out for a different broker that is flexible enough to do what you're looking for. I don't know of any MQTT broker that allows you to do that out of the box, but many are fairly extensible. For one I can talk about is VerneMQ, as I am one of the core developers. Developing a simple VerneMQ plugin that serves some static files over HTTP is a matter of a few lines of code, as the plugin only requires to setup some configuration for the internal webserver.
However, unfortunately we haven't yet documented this feature. But feel free to drop us a line if such an approach sounds interesting for you.
Cheers,
Andre

how to connect mysql server on external server in j2me application

I have a hosting account at godaddy ruinning Linux. Is has MySQL. I am creating a J2ME application that runs on android and I was wondering if there is any simpler way to connect from j2me application to my MySQL server?
Is it required to install anything at my server? which I cannot do because of the shared account. Any way to just open the connection, update some data in the MySQL from j2me application?
It is quite simple. You just need to do HTTP application/x-url-form-encoded request on the midlet and set request property to HTTP.POST. Then stream form data as bytes. Receive those post variable using a server side language (i used PHP) like $_POST['var'] and in that server script write MySQL query like insert into .. VALUES.. etc.
I don't know if any DB drivers exist for J2ME. If you can't find them just make layer on the server and implement your own protocol for retrieving data via http or sockets