How can I get the version of a remotely running RabbitMQ server programmatically in Node.js? - node.js

I have a node server that connects to RabbitMQ using rabbot. This is working fine, I can publish messages, consume messages, etc.
Now I was hoping to be able to ask the RabbitMQ server which version it is running specifically.
I was hoping I might be able to publish a message asking for the version and get the answer via a reply queue. Or I could also make the request via HTTP, I have no preference. But strangely enough, I can't find any way of doing this. Hence my question: How can I get the version of a remotely running RabbitMQ server programmatically in Node.js?
Non-duplicate: Verify version of rabbitmq
The above is not a duplicate since it doesn't require the version be found programmatically, nor does it offer any Node.js solutions. Also, most solutions only apply to a local rabbitmq-server, not a remote one.

The RabbitMQ team monitors this mailing list and only sometimes answers questions on StackOverflow.
You can get this information by using the HTTP API:
$ curl -4su guest:guest localhost:15672/api/overview | jq '.rabbitmq_version'
"3.6.14+2.gd704c55"
Note that you will have to enable the rabbitmq_management plugin.
If you're feeling adventurous you can also use the erl command to connect remotely and get the list of running applications and their details. The RabbitMQ version will be the version of the rabbit application. This is basically how the rabbitmqctl script works.

Related

How exactly Nagios server communicates with remote nodes i.e which protocol does it use in agent and agentless settings?

I installed Nagios Core and NCPA on a Mac. Implemented a few checks via custom plugins to understand how to use it. I am trying to understand the following:
Protocol that Nagios server actually use to communicate with NCPA agent and how exactly does NCPA return the result back to Nagios. Does it ssh into Nagios server and writes a file that server processes?
From application monitoring standpoint how can it be leveraged? Is it just to monitor that application is up and running (I read its not just for that it can do more but couldn't find any place where I could see how its actually implemented) or is there a restful API as well that we invoke from with in our application to send custom notification to Nagios server. I understand it might require some configuration at Nagios server end as well.
I came across Pager Duty and Sematext articles i.e PagerDuty Integration and SemaText Nagios Alert Integration where they have integrated their solution with Nagios I am trying to do something similar. Adding integration support for Nagios so that a user can utilise our applications UI to configure alerts/notification. For e.g. if a condition is met then alert or notify Nagios server to show a notification on its dashboard.
Can we generate an alert from within a spark streaming application based on a variable e.g. if its value is above a threshold or some condition is met send an alert to Nagios Server to display as notification on Nagios Dashboard. I came across a link where we can monitor status of a spark application but didn't find anything for something within a spark application.
I tried looking for answers to above questions but couldn't find anything useful or complete as such online. I would really appreciate if someone could help me understand above.
Nagios is highly configurable, and can communicate across many protocols. NCPA can return JSON or XML data. The most common agentless protocol is probably SNMP. If you can read Python, look directly at the /usr/local/nagios/libexec/check_ncpa.py file to see what's up.
Nagios can check whether a system is running a service, how much resources it is consuming, etc... There is a restful API.
Nagios offers an application with a more advanced graphical interface called Nagios XI. Perhaps that is what you are after.
I bet you probably could, yeah. It might take some development work to get the systems to communicate though.

Jhipster app logging to remote ELK (elastic stack)

I've been asked to configure an ELK stack, in order to manage log from several applications of a certain client. I have the given stack hosted and working at a redhat 7 server (followed this cookbook), and a test instance in a virtual machine with Ubuntu 16.04 (followed this other cookbook), but I've hit a roadblock and cannot seem to get through it. Kibana is rather new for me and maybe I don't fully understand the way it works. In addition, the most important application of the client is a JHipster managed application, another tool I am not familiarized.
Up until now, all I've found about jhipster and logstash tells me to install the full ELK stack using Docker (which I haven't, and would rather avoid in orther to keep the configuration I've already made), so that Kibana deployed through that method already has configured a dashboard tunned for displaying the information that the application will send with the native configuration, activated in the application.yml logstash: enabled: true.
So... my questions would be... Can I get that preconfigured jhipster dashboard imported in my preexistent Kibana deploy. Where is the data, logged by the application, stored? can I expect a given humanly readable format? Is there any other way of testing the configuration is working, since I don't have any traffic going through the test instance into the VM?
Since that JHipster app is not the only one I care for, I want other dashboards and inputs to be displayed from other applications, most probably using file beat.
Any reference to useful information is appreciated.
Yes you can. Take a look at this repository: https://github.com/jhipster/jhipster-console/tree/master/jhipster-console
there are the exports (in JSON format) from kibana stored in the repository, along with the load.sh
The scripts adds the configuration by adding them via the API. As you can imply, any recent dashboard is not affected by this, so you can use your existing configuration.

Sending a request to the Nagios service to be monitored

What I know is Nagios is a tool used to monitor remote servers by configuring it.
But I have a requirement in which I need other remote server applications to be sending a request to the Nagios service at particular intervals and saying that I'm running and this is my status. Googling it didn't give any information so far. So I just want to know if this is possible with Nagios.
Can you please help me with this query so that I can fulfill my requirement.
If not Nagios, is there any other application capable of doing so ?
You need NSClient++ running on your Windows machine and NSCA running on your Nagios server, have a look for install guides. It's not the easiest thing to get working.

Configure mosquitto broker on windows to available in the network

I am currently starting to use MQTT (and mosquitto as a broker) for a home automation project.
I installed mosquitto using the .exe from the homepage on my windows server and I can run it as a service or by directly starting the .exe. Using the _sub and _pub programs I can also publish and suscripe to messages.
Awesome ;)
But (at least by using the standard config) I can't connect from other system in the same LAN. I tried using the said _sub and _pub programs and mqtt-spy, but none of them is able to connect.
Is this a problem with ports and the firewall or with the configuration? I can't find any answers for this only and would be grateful for any help!
If you need any more infos just ask.
Ok it was a firewall problem I guess. I changed the config to:
bind_address #ipAdress
port #Portnumber
of course the # fields are the numbers. Then I created 2 rules to allow incoming and outgoing pakets for the mosquitto.exe to pass the firewall. Now it works.
If anyone has more settings/explanation thats usefull, please answer here! There is not a lot of usefull explanation for this on the web.

Using Linux to execute a query from Windows server by ODBC connection

Here is the problem: We have a client that uses Progress Openedge database, we need to execute queries on this database from our servers.
Currently the drivers are installed on our Windows server, and the PHP code uses ODBC to run the queries.
Now we would like to move the code to a Linux server. We tried before to work with their linux drivers but that attempt has failed.
The question is, Is it possible somehow to run PHP code on a linux server, this code communicates with the Windows server, runs the query on the Windows server, and return the results to Linux?
How would you access to this problem.
Thanks!
Yes, it's possible. Your question boils down to "how can my Linux server ask my Windows server to do something" (where the "something" happens to be "talk to a database"), and there are a variety of ways to accomplish that. You could run a web service (RESTful or SOAP) on the Windows server, for example.
Make sure you think about security: if you deploy a service on your Windows server that lets remote clients modify a database, you have to be mindful of which remote clients are allowed to use that service. The last thing you want to do is accidentally allow random strangers to run arbitrary queries against your database.
We have a Knowledgebase Article detailing some setup procedures for Linux installations; it also has a video explaining some aspects of the setup. If the other answered haven't provided a complete solution for you, hopefully our article can at least get you started in the right direction.
Also keep in mind that depending on your version of OE, the driver libraries may be different.

Resources