10. December 2024

ATIX #CrewDay: Rhino learns to speak!

ATIX #CrewDay: Rhino learns to speak!

On 20.11.2017 it was time again: All colleagues of ATIX AG – from consultants to developers to marketing and support – met for the ATIX #CrewDay to exchange ideas and work together on various projects. Of course, everything revolved around LINUX & Open Source.

English Version

At #CrewDay, colleagues from Marketing are of course not left out. It is therefore important to find topics that are relevant for all departments. With this in mind, some time ago a colleague had the idea of using voice control to create a new host with the help of orcharhino to create a new host. A perfect project for #CrewDay! So we didn’t have to wait long, but rather teach our Rhino to speak. Rhino? Is that a colleague at ATIX? Almost – Rhino is the “mascot” of our product orcharhino. It can be used to further automate data centers and implement the deployment, configuration and patch management of Linux servers under a uniform interface. But back to our small Alexa project: First of all, we had to explore the available options. Option one would be to write our own Alexa skill. Option two is the one we initially opted for: As a communication mediator between Amazon Echo Dot and orcharhino we used Node-RED. Node-RED was initially designed by IBM and is available under an open source license. This allows scenarios in the Internet of Things to be put together directly in the browser like a modular system. In addition to Alexa, other modules are available for Google services, IRC, social media platforms and for controlling smart home devices. This gave rise to another idea: Why not use a tweet to build a new server via orcharhino build a new server? After installing Node-RED using “npm”, you can access it directly from your browser via http://127.0.0.1:1880. Additional modules can be searched for and installed using “Manage Palette” via the menu on the right-hand side next to “Deploy”. Here we have added the node-red-contrib-alexa-home-skill [1] module. This module uses a server [2] on the Internet with which it communicates between Alexa and Node-RED. We actually wanted to avoid this and implement everything locally. But then we realized that other modules [3] that make do with the local network were out of the question. This is because Node-RED, Alexa and orcharhino are not on the same network. It took a few minutes to establish successful communication between Alexa and Node-RED. We were now able to receive the first voice commands via Node-RED. The next step was to orcharhino to connect. Node-RED has a module for sending HTTP requests. The API of orcharhino allows almost everything to be controlled via corresponding API calls. This includes creating content views, deleting compute resources and starting a deployment process for new hosts.

This was done in no time and we were able to start Alexa with “Alexa, rhino on” (we use rhino instead of orcharhino because, as developers, we know that “brevity is the spice of life”;) ) to build a new host. Now the resolution for all those who are wondering why we used “orcharhino ein” as a command: This node-red-contrib-alexa-home-skill internally maps smart home functionalities like lamp control. The Sytax and voice command skill is therefore unsuitable for our use case. But that’s just a side note, now back to the essentials: Creating new hosts via tweet and posting a message to an IRC channel as soon as a new host is available ? The finished Node-RED flow looks like this:


To control the orcharhino API, we had to define the header and the HTTPS post body. We used the following method for this:

//set headers and payload
var payload = { "host":  {
  "enabled": true,
  "compute_resource_id":"1",  
  "hostgroup_id":"1",
  "location_id":"2",
  "organization_id":"1",
  "compute_attributes": {
   "start":"1"
},
"interfaces_attributes": {
  "0":{
     "subnet_id":"1"
   }
  }
}};
// construct the result
msg.payload= JSON.stringify(payload);
msg.headers = {};
msg.headers["Content-Type"] = "application/json";
msg.headers["Accept"] = "application/json";
return msg;

After the message has been sent via “Send orcharhino HTTPS Post”, Node-RED receives the response to the HTTPS Post request in “Set New Host Msg”. In this Javascript function we extract the name of the new host:

//Set New Host Msg
var hostname = msg.payload.match(/"name":"([a-zA-Z-\.]*).stage.atix"/); 
var msg = {};

if (hostname !== null{
  msg.payload = "New Host created: " + hostname[1];
}

return msg;

In the remaining time, we thought about how we could design our own Alexa skill in such a way that we could dispense with the remote server and also give real commands à la “Alexa, build a medium-sized host with orcharhino a medium-sized host”. Here we again had the problem with different network segments. Unfortunately, we ran out of time to find an adequate solution. At one of the next ATIX #CrewDays, however, we want to take this up again and design our own Alexa skill.

What have we learned?

– Voice control via Alexa is pretty good! – Node-RED as a tool for networking Internet of Things components is very powerful! – It’s fun with orcharhino implementing unusual ideas! [1] https://www.npmjs.com/package/node-red-contrib-alexa-home-skill [2] https://alexa-node-red.bm.hardill.me.uk/ [3] https://www.npmjs.com/package/node-red-contrib-alexa-local Amazon has set standards with Alexa and Echo (Dot). It can be assumed that our project can also be implemented with other systems such as Google Home Assistant or Apple HomePod.

What is orcharhino?

orcharhino is THE tool for automatically deploying servers in a data center, performing configuration management and always being up to date with patch management. In orcharhino several open source technologies are combined to achieve the goals of automation and standardization. It offers orcharhino three core functions; Deployment, Patch Management, Configuration Management and much more. All enterprise-ready, of course.

English Version

On 20.11.2017 it was time again: All colleagues of ATIX AG – from consultants and developers to marketing and support, met at the ATIX #CrewDay to exchange ideas and work together on different projects. Of course, they are all about LINUX & Open Source. Of course, the #CrewDay does not exclude colleagues from marketing. Therefore, it is important to find topics that are relevant for all departments. Against this background, a colleague had the idea some time ago to create a new host with the help of orcharhino using voice control. A perfect project for #CrewDay! So, it wasn’t long torchlighting, but teaching our rhino to speak. Rhino? Is that a colleague at ATIX? Almost – Rhino is the “mascot” of our product “orcharhino“. With this, data centers can be further automated and the deployment, configuration and patch management of Linux servers can be implemented under a uniform user interface. But back to our little Alexa project: First of all, we had to explore the available possibilities. Variant one would be to write your own Alexa Skill. Variant two is the one we initially chose: As a communication intermediary between Amazon Echo Dot and orcharhinowe used Node-RED. Node-RED was originally designed by IBM and is licensed under an open source license. This means that scenarios in the Internet of Things can be put together directly in the browser as if in a modular system. In addition to Alexa, other modules are available for Google services, IRC, social media platforms and for controlling Smart Home devices. A further idea came up: Why not build a new server with the help of a tweet via orcharhino? After the installation of Node-RED with “npm” you can access it directly with the browser via http://127.0.0.1:1880. Further modules can be searched for and installed using the “Manage Palette” menu on the right-hand side next to “Deploy”. Here we have added the module node-red-contrib-alexa-home-skill[1]. This module uses a server[2] in the internet with which it communicates between Alexa and Node-RED. Actually, we wanted to avoid this and implement everything locally. But then we found out that other modules[3], which are content with the local network, are no longer available. Because Node-RED, Alexa and orcharhino are not in the same network. It took a few minutes until a successful communication between Alexa and Node-RED took place. Now we could receive the first voice commands via Node-RED. The next step was to bind orcharhino. A module for sending HTTP requests exists in Node-RED. The API of orcharhino allows you to control almost everything via API calls. This includes creating content views, deleting compute resources, and starting a deployment process for new hosts.

This was soon done and we could ask Alexa with “Alexa, rhino ein” (we use rhino instead of orcharhinobecause we as developers know:””Keep it short and sweet””;)) to build a new host. Now the resolution for all those who wonder why we used “orcharhino ein” as a command: This node-red-contrib-alexa-home-skill internally maps Smart Home functionalities such as lamp control. Therefore, the skill of Sytax and voice commands is unsuitable for our application. But let me mention this only marginally, now back to the essential: Creating new hosts using Tweet and posting a message to an IRC channel as soon as a new host is available: -) The finished Node-RED Flow looks like this: To control the orcharhino API we had to define the header and HTTPS Post Body. We have used the following method for this:

//set headers and payload
var payload = { "host":  {
  "enabled": true,
  "compute_resource_id":"1",  
  "hostgroup_id":"1",
  "location_id":"2",
  "organization_id":"1",
  "compute_attributes": {
   "start":"1"
},
"interfaces_attributes": {
  "0":{
     "subnet_id":"1"
   }
  }
}};
// construct the result
msg.payload= JSON.stringify(payload);
msg.headers = {};
msg.headers["Content-Type"] = "application/json";
msg.headers["Accept"] = "application/json";
return msg;

After the message has been sent via “Send orcharhino HTTPS Post”, Node-RED receives the response to the HTTPS Post Request in “Set New Host Msg”. In this Javascript function we extract the name of the new host:

// Set New Host Msg{
var hostname = msg.payload.match(/"name":"([a-zA-Z-\.]*).stage.atix"/);

var msg = {};
if (hostname !== null{
   msg.payload = "New Host created: " + hostname[1];
 } 

return msg;

In the rest of the time we thought about how to design our own Alexa Skill in such a way that we can do without the remote server and give real commands à la “Alexa, build with orcharhino a medium-sized host”. Here again we had the problem with different network segments. Unfortunately, we ran out of time to find an adequate solution. At one of the next ATIX CrewDays we want to take this up again and design our own Alexa Skill.

What have we learned:

– the voice-control over Alexa is pretty good! – Node-RED as a tool for networking Internet of things components is very powerful – It’s fun to realize unusual ideas with orcharhino! [1] https://www.npmjs.com/package/node-red-contrib-alexa-home-skill [2] https://alexa-node-red.bm.hardill.me.uk/ [3] https://www.npmjs.com/package/node-red-contrib-alexa-local Amazon has set standards with Alexa and Echo (Dot). It is to be assumed that our project can also be implemented with other systems such as Google Home Assistant or Apple HomePod.

What is orcharhino?

orcharhino is THE tool for deploying servers automatically in a data center, performing configuration management and being always up to date with patch management. In orcharhino several open source technologies are combined to achieve the goals of automation and standardization. In addition, orcharhino offers three core functions: deployment, patch management, configuration management and much more. Of course, everything is Enterprise compatible.

Weitere Beiträge

Ready to get started?

Start your
free trial today!

If you have any questions about our products and services or any other
topics, please do not hesitate to contact us.

Suche
Search