Monthly Snap March 2020

Monthly Snap March 2020

As most of you have already noticed, the NETWAYS family is officially in home-office.
This is very strange experience for most of us, but we are adapting to the new situation and are grateful for being able to work from home. As Leonie wrote in her blog NETWAYS @home we have a great Internal Support department, that helps with any issue we may have, and of course Bernd sends us regular updates.
In case you missed it: our NWS team offers a #stayathome-special: Rocket Chat, Jitsi and Nextcloud for free for 30 days! Check it out! These tools are very helpful for teamwork, telephone conferences etc, and help us stay in touch and cooperate despite being apart. It might be just the thing for your team!
And although business might not be quite as usual, we are still there for our customers! You can write us, phone us, order shop-products etc.

So, let us see what else NETWAYS wrote about in March!

 

NEWS from our Shop

STARFACE im Home-Office! Read Natalie`s Blog on how to use Starface while working from home, and that Starface UCC premium licences are for free till the end of May! Further, Natalie provided information on the HW group STE2: Netzwerk-Thermometer Set zum kleinen Preis. Just the thing for your server-room. Also read her second blog on the subject: HW group STE2: Netzwerk-Thermometer Set – Teil 2. And Nicole shared the advantages of the STE und STE PoE for those of us who don`t need the extra features of the STE2.

DevOpsDays Berlin

Julia informed us of DevOpsDays Berlin: Call for Papers open. Get involved! There are three different formats for talks. Read about them and send us your proposal for a talk in Berlin in October!

 

Icinga for Windows

Despite the Home-office situation the webinars are still taking place! Christian gave us an overview on topics and dates in the new webinar series Icinga for Windows – Webinar Kalender. Which leads us to Alexanders blog on his part in creating Icinga for Windows with PowerShell in Was war, ist und wird sein – ein Azubi & PowerShell. He is truly impressed with Christians work, and has learnt a lot in the process.

 

Techie topics

Artur wrote about his first experiences with Docker – ein erster Eindruck! In Privat: Better Late than never – Graphite-Web-Installation unter Debian 10 – Part 1 David kept his promise to his blog-readers and shared a thorough how-to. Why should you test tmux? Christoph gave us some reasons in tmux – terminal multiplexer. And Daniel`s blog Jitsi Best Practice und Skalierung helps with installing and using Jitsi. Julia annonced that NWS now hosts Kubernetes in NETWAYS Managed Kubernetes. Auf in die Welt der Container! The next blog is hilarious and cool at the same time! Read Tobias` Icinga Web Themes coming soon – Bayerisch, Fränkisch, Österreichisch!

 

#lifeatnetways

In our blog series NETWAYS stellt sich vor new colleagues share a bit about themselves. Read about our apprentices Natalie and Nathaniel

Catharina Celikel
Catharina Celikel
Office Manager

Catharina unterstützt seit März 2016 unsere Abteilung Finance & Administration. Die gebürtige Norwegerin ist Fremdsprachenkorrespondentin für Englisch. Als Office Manager kümmert sie sich deshalb nicht nur um das Tagesgeschäft sondern übernimmt nebenbei zusätzlich einen Großteil der Übersetzungen. Privat ist der bekennende Bücherwurm am liebsten mit dem Fahrrad unterwegs.

Ansible – should I use omit filter?

When we talk about Ansible, we more and more talk about AWX or Tower. This Tool comes in handy when you work with Ansible in a environment shared with colleagues or multiple teams.
In AWX we can reuse the playbooks we developed and share them with our colleagues on a GUI Platform.

Often we need a bit of understanding how a playbook is designed or if a variable need to be defined for the particular play. This can be much more tricky when sharing templates to people unaware of your work.

This is where the omit filter can be used. The easiest way to explain this, if the variable has no content or isn’t defined, omit the parameter.

The following example is an extract from the documentation:


- name: touch files with an optional mode
  file:
    dest: "{{ item.path }}"
    state: touch
    mode: "{{ item.mode | default(omit) }}"
  loop:
    - path: /tmp/foo
    - path: /tmp/bar
    - path: /tmp/baz
      mode: "0444"

In AWX we can create surveys, those are great to ask a few questions and provide a guide on how to use the underlying play. But often we need to choose between two variables whether one or another action should happen. Defined by the variable in use. If we leave one of both empty, Ansible will see those empty as defined but “None” (Python null) as content.

With the omit filter we can remove the parameter from the play, so if the parameter is empty it won’t be used.

The following code is the usage of icinga2_downtimes module which can create downtimes for hosts or hostgroups but the parameters cannot be used at the same time. In this case I can show the variable for hostnames and hostgroups in the webinterface. The user will use one variable and the other variable will be removed and therefore no errors occur.


- name: schedule downtimes
  icinga2_downtimes:
    host: https://icingaweb2.localdomain
    username: icinga_downtime
    password: "{{ icinga_downtime_password }}"
    hostnames: "{{ icinga2_downtimes_hostnames | default(omit) }}"
    hostgroups: "{{ icinga2_downtimes_hostgroups | default(omit) }}"
    all_services: "{{ icinga2_downtimes_allservices | default(False) }}"

The variables shown in the AWX GUI on the template.

This filter can be used in various other locations to provide optional parameters to your users.

If you want to learn more about Ansible, checkout our Ansible Trainings or read more on our blogpost.

Thilo Wening
Thilo Wening
Consultant

Thilo hat bei NETWAYS mit der Ausbildung zum Fachinformatiker, Schwerpunkt Systemadministration begonnen und unterstützt nun nach erfolgreich bestandener Prüfung tatkräftig die Kollegen im Consulting. In seiner Freizeit ist er athletisch in der Senkrechten unterwegs und stählt seine Muskeln beim Bouldern. Als richtiger Profi macht er das natürlich am liebsten in der Natur und geht nur noch in Ausnahmefällen in die Kletterhalle.

Exclusion of NPD and AfD supporters from our events

We have always expressed our political convictions both personally and here in the blog. As a multicultural company, it has always been a concern to take a position where it is necessary. The political discourse in our country has unfortunately not really improved in the last months and weeks, and despite the increasingly extreme positioning of large sections of the AfD, a certain voter base also seems to have consolidated.

This concerns us as a company and me personally to a great extent. When people with whom you work every day are insulted as monkeys and applicants tell you that beer cans are thrown at them on the street, we should unfortunately feel remembered of our darkest times. This can not be tolerated.

Even if the extremes are in the minority, they are strengthened by the tolerant mass. In our view, not tolerating racism and extremism in any way and, whenever possible and necessary, raising one’s voice against it, is a matter of course.

We will draw the line more clearly in the future, especially at our conferences and events. We have added the following chapter to our Code of Conduct:

4.) We only work with people and companies who, like us, believe with absolute conviction in the free and democratic basic order and respect the dignity of all people. By accepting our Code of Conduct, you assure that you share our values and do not work with people or companies that degrade other people or promote the destabilization of our democratic system. The AfD and NPD parties should be mentioned here in particular. Conference participants be sanctioned or expelled from the conference without a refund.

One or the other reader may wonder whether an exclusion is undemocratic and whether we all have to seek dialogue with each other. I admit that this question has been on my mind for several weeks and months.

Ultimately however, I conclude that supporters of parties such as the AfD and NPD at least tolerate open racism in their ranks. And whoever does that, we would rather not have them among us.

Bernd Erk
Bernd Erk
CEO

Bernd ist Geschäftsführer der NETWAYS Gruppe und verantwortet die Strategie und das Tagesgeschäft. Bei NETWAYS kümmert er sich eigentlich um alles, was andere nicht machen wollen oder können (meistens eher wollen). Darüber hinaus startet er das wöchentliche Lexware-Backup und investiert seine ganze Energie in den Rest der Truppe und versucht für kollektives Glück zu sorgen. In seiner Freizeit macht er mit sinnlosen Ideen seine Frau verrückt und verbündet sich dafür mit seinem Sohn.

Config Management Camp Ghent 2020 – Recap

Cfgmgmtcamp Logo

It seams like Config Management Camp at beginning of February in Ghent gets a fixed date for me. I attended the fifth year in series, gave a talk in the last three and joined the Foreman Construction day on the day after as many times. So why am I still attending while some people are perhaps already telling you that the time of configuration management is over in favor of containers and Kubernetes. While I can not totally agree or disagree with this thesis, my schedule is still full of Foreman, Puppet and Ansible, so it makes sense to keep me updated. Furthermore the event allows to network like not many others with speaker diner, community event (also known as beer event) and Foreman community dinner. And last but not least it is always interesting to hear what the big names think about configuration management in the future and how to adopt to a world of containers and Kubernetes which was a big part of the talks in the main track.

But to get everything in correct order let me start at Sunday morning where Blerim, Aleksander and I started so we can meet Bernd and Markus who attended FOSDEM in advance in our AirBnb before going to speaker diner. I have to admit I really like Ghent’s old City so I was happy the same restaurant right in the middle of Ghent was chosen for diner like last year. And also like last year I joined the Foreman table to meet old and new friends for some hours mixed of small talk and technical discussions.

The first conference day started as always with main tracks only and I can really recommend Ryn Daniels’ talk Untitled Config Game. After lunch I joined the Foreman community room to get latest news from the community and the 2.0 release by Tomer Brisker and Ewoud Kohl van Wijngaarden respectively. The talks about Katello and how to create API and CLI for a Compute Resource where also quite interesting, but my favorite was Marek Hulan who had initially chosen a very similar title for his talk about Foreman’s new Reporting Engine and showed some interesting examples and the future templates documentation which will be automatically rendered in a similar fashion like the API documentation which is always available at /apidoc on a Foreman installation. Last but hopefully not least was my talk about existing solutions which get data from Foreman into central systems like Elasticsearch for logs and Supervisor Authority Plugin which enables Elastic APM to show performance bottlenecks, stacktraces and some metrics and is perhaps the most promising solution for me. As I was the one between the audience and the beer I was quite happy finishing my talk in time and get some more Kriek afterwards.

Day two had also some create talks to start with John Willis telling us he got 99 (or perhaps even far more) problems and a bash DSL ain’t one of them and Bernd how convenience is killing Open Standards. The first was really great in showing how configuration management has evolved compared to the container world which follows the same evolutionary process. The second was not only related to configuration management but IT at all including clouds and many more (and Bernd was fully aware of the discrepancy giving such a talk on a macbook). This day I visited more different tracks to hear about the migration of Pulp 2 to 3 behind Katello, testing of Ansible roles with Molecule (including some chemistry lessons), Ansible modules for pulp, how Foreman handles Secure boot and last but not least to get an update on Mgmt Config. After the talks we joined the Foreman Community diner which was located in a separate room of the same location we visited last year, allowing even more discussions without fearing to disturb others.

The Foreman Construction day like many other community events is a fringe event at the same location allow to hack together on some features and I was happy to make the beginner session I had given already the last years an official workshop. It was based on our official training focusing on installation and provisioning including hints and answering questions. After lunch I joined the hacking session for some time before shopping some Kriek and waffles and then traveling home.

Dirk Götz
Dirk Götz
Principal Consultant

Dirk ist Red Hat Spezialist und arbeitet bei NETWAYS im Bereich Consulting für Icinga, Puppet, Ansible, Foreman und andere Systems-Management-Lösungen. Früher war er bei einem Träger der gesetzlichen Rentenversicherung als Senior Administrator beschäftigt und auch für die Ausbildung der Azubis verantwortlich wie nun bei NETWAYS.

Automatic PDF Generation with Google Chrome

Many developers get, sooner or later, the task to generate PDF documents automatically. Though, less developers put their experiences and insights then into a blog-post to save others some hassle. So let me do you a favor by explaining how we utilize Google Chrome in headless mode to generate pretty PDF files from HTML.

I won’t go into the details why Google Chrome. If you found this blog entry I suppose you already tried other options without success or satisfying results. We sure have tried several other options (e.g. wkhtmltopdf, dompdf, tcpdf) but only Google Chrome provided us with the results we wanted.

Another advantage of Google Chrome is the possibility to instrument a remotely running instance. And that’s exactly how we instruct it to generate a PDF file for us. Though, not with Puppeteer but with plain chrome devtools protocol (CDP) communication over a websocket.

I’ll avoid any programming language specific examples. You can take a look here at our implementation in PHP. So, let’s start with it.

The Process to Print HTML to PDF

First you’ll need to connect with the browser by use of a websocket connection at: ws://10.11.12.13:9222/devtools/browser/79744167-25f0-41a8-9226-382fa2eb4d66

This is printed on stderr right at launch of the process and also available on the JSON api: 10.11.12.13:9222/json/version

The important bit is the browser id (79744167-25f0-41a8-9226-382fa2eb4d66) at the end of the URI. This changes every time the process is launched and can’t be configured.

Communicating with the browser now takes place over this socket by transmitting and receiving JSON messages. They are divided into four types:

Calls

These primarily originate from ourselves. They contain an id, a method and parameters:

{ “id”: <mixed>, “method”: <string>, “params”: <object> }

The id is chosen by us and should be different for each call. It’s sent back with the response so it’s possible to later associate it with the call we made. Though this is mostly relevant if you are not communicating synchronously, which we do. So this may just as well be an integer incremented by 1 each time.

Results

These are sent by the browser in response to an API call.

{ “id”: <mixed>, “result”: <mixed> }

Errors

If it’s not a response, it’s an error.

{ “id”: <mixed>, “error”: { “code”: <int>, “message”: <string> } }

Events

These may be sent by the browser at any time.

{ “method”: <string>, “params”: <object> }

Some of these are of interest to us. Some of them are not and can be ignored.

Operating the Browser As Usual

In order to let the browser print us a web page (or HTML) to PDF we need to instrument it the same as when we do it manually on the desktop.

First we need to open a new tab:

Call: { “id”: 1, “method”: “Target.createTarget”, “params”: { “url”: “about:blank” } }

Result: { “id”: 1, “result”: { “targetId”: “418546565-d4f9-4d9f-8569-9ad8f9db7f9de” } }

Now we have to communicate with the tab, which requires a new websocket connection to: ws://10.11.12.13:9222/devtools/page/418546565-d4f9-4d9f-8569-9ad8f9db7f9de

Before we can print anything we have to tell the browser where to load the content to print from. This may either be a URI (which then needs to be accessible for the browser) or raw HTML. I’ll stick to raw HTML here, since it’s the most flexible option anyway:

Call: { “id”: 2, “method”: “Page.setDocumentContent”, “params”: { “frameId”: “418546565-d4f9-4d9f-8569-9ad8f9db7f9de”, “html”: <html> } }

Result: { “id”: 2, “result”: { } }

The next step is the instruction to print the page’s content to PDF:

Call: { “id”: 3, “method”: “Page.printToPDF”, “params”: <object> }

Result: { “id: 3, “result”: { “data”: <string> } }

What parameters you can use to influence the generation (e.g. the layout) are outlined in the official documentation.

The string you will get back is probably encoded in Base64, so decode it and store it where you want. The PDF file has been successfully generated.

If you are planning to use a single process to generate multiple PDFs with, remember to clean up afterwards. (i.e. closing the tab) Otherwise you will soon have a memory usage issue.

Call: { “id”: 4, “method”: “Target.closeTarget”, “params”: { “targetId”: “418546565-d4f9-4d9f-8569-9ad8f9db7f9de” } }

Result: { “id”: 4, “result”: { “success”: <bool> } }

I hope this proves useful to you or convinces you to give Google Chrome a try to generate pretty PDFs. 🙂

Johannes Meyer
Johannes Meyer
Developer

Johannes ist seit 2011 bei uns und hilft bei der Entwicklung zukünftiger Knüller (Icinga2, Icinga Web 2, ...) aus dem Hause NETWAYS.
NWS announces: Nextcloud Hub now available

NWS announces: Nextcloud Hub now available

Nextcloud released a new version. But it’s not just a normal update, since there are a lot of changes, as they already described in their press release:

“With the release of Hub, Nextcloud brings a free, open source, on-premises office suite to millions of users, lowering the barrier to use. Hub brings office integration to a new level with the built-in sidebar featuring an insight in file activities, file versions, comments, chat, and video calls. […] With Hub come major improvements in Nextcloud Files, Talk and Groupware. Files introduces Workspaces, […] Nextcloud Talk for Hub features a rewritten user interface […] Nextcloud Groupware was improved.” – Nextcloud, Press release 17.01.2020

Since yesterday Nextcloud Hub is also available on the NWS Plattform. The most interesting point is that the new version brought a huge performance improvement to our SaaS (Software as a Service) app. We saw in the past, that Nextcloud 17 was pretty slow with a S3 storage as primary storage. But now we have the best benefits of using our own S3 as a primary storage with a performance that is just awesome. You could call it a “Nextcloud Managed Hosting”

We also decided to stick with Nextcloud Collabora Online instead of OnlyOffice, since we invested a lot of time to optimize Collabora to ensure the best user experience.

What makes Nextcloud Hub as a NWS SaaS app so special?

Feature
Current Version Hub (18.0.0)
Users 25 / 50 / 100
Storage 50 GB / 200 GB / 1000 GB / More possible
Traffic Flat
Collabora Inclusive
Updates Inclusive
Backup (Of configuration) Inclusive
Storage Our own NWS S3 (NOT AWS)
Need to buy a domain No. Use one of our free CNAMEs or use your own Custom Domain
Support 8×5
Migrating to NWS Possible
Installed apps Use our preinstalled apps or install whatever you want from the appstore
Callable Monthly
Server locations Nuremberg, Germany
DC Certificate ISO 27001
Time the app needs to be ready Max. 5 minutes
Special offer First 30 days are for free. Note that it is callable monthly
Costs 9,99 € / 24,99 € / 99,99 €
Start now FOR FREE Show me more informations

What is the NWS SaaS platform about?

With our SaaS platform we provide our customers with applications on demand with almost no need to take care of them. We deliver the features, the updates, taking care of the security and offer support.
Not everyone has the know-how to build up an infrastructure that fits their needs as well as maintaining it. So we created NWS for everyone who don’t want to take care about things they need to work with – we created NWS for everyone who just wants to use the software.

It’s a platform for things like “one klick installation Nextcloud / Gitlab / Rocket.Chat” etc.

Give it a try. If you just want to try, it’s completely for free. WHAT ARE YOU WAITING FOR?

Marius Gebert
Marius Gebert
Systems Engineer

Marius ist seit 2013 bei NETWAYS. Er hat 2016 seine Ausbildung zum Fachinformatiker für Systemintegration absolviert und ist nun im Web Services Team tätig. Hier kümmert er sich mit seinen Kollegen um die NWS Plattform und alles was hiermit zusammen hängt. 2017 hat Marius die Prüfung zum Ausbilder abgelegt und kümmert sich in seiner Abteilung um die Ausbildung unserer jungen Kollegen. Seine Freizeit verbringt Marius gerne an der frischen Luft und ist für jeden Spaß zu...