Good collaboration is often a key contributing factor in high-performing teams. Collaboration is the process of working together towards a common goal, with teams working as one towards a common purpose, adapting as needed by using the available resources.
Providing the right tools to facilitate collaboration can mean the difference between an efficient and an inefficient workplace. In the open source and closed source spheres, you'll find an abundance of collaboration tools. Some offer up a no-frills platform with the basics of instant messaging and voice calling. Others take it a step further and throw in video conferencing, custom plugins, continuous integration/continuous development (CI/CD) integrations, bot accounts, and more.
Choosing a collaboration suite that is both open source and hosted on premises provides a number of advantages for sysadmins. Open source software often comes with the convenience of faster innovation, improved security, and more flexibility. Having the option to host a solution in-house instead of being forced onto a cloud-based solution can also be a huge plus for some companies, especially those with strict security policies.
It may be challenging to find a solution that addresses all your needs out-of-the-box, and it comes down to what product gives you the flexibility to adapt it to your specific requirements.
Mattermost is one such product. It provides:
- An excellent launchpad
- A base, no-frills collaboration platform that offers up a plethora of ready-to-use integrations
- An architecture that allows plugins
- A developer toolkit to help you tailor a solution to address your specific requirements
Marketed as an open source alternative to Slack and Teams, Mattermost has a clean and recognizable interface and includes many features you find in its closed source counterparts. So without further ado, let's get started with a preview of a Mattermost container.
Deploying the Mattermost container
- Pull the Mattermost preview container image:
$ podman image pull docker.io/mattermost/mattermost-preview
- Deploy the Mattermost container:
$ podman run -d \ --name mattermost \ --publish 8065:8065 \ --network host \ mattermost/mattermost-preview
- It will take approximately 30 seconds for the container to start up, after which you can open up a web browser and head over to
http : //localhost:8065
. - On the welcome page, enter your email address, username, and password. On the next page, you are prompted with a list of Teams to join. This being a fresh installation, you will not find any teams, so create one straight off the bat. Click Create a team, enter the desired Team Name, and accept the default URL generated on the last page. I used the team name "Red Fedora."
- Finally, a three-step tutorial appears, but feel free to skip this.
Welcome to your brand new Mattermost deployment. Take a look around and familiarize yourself with the Mattermost interface. You can access everything you need from the hamburger icon (three horizontal lines) at the top left, and be sure to check out the System Console to get an understanding of how you can configure Mattermost under the hood.
Exploring other features
When deploying a production instance of Mattermost, many knobs and switches need to be flicked, such as SSL configuration, SMTP, webserver fine-tuning, and so on. To keep this concise, I will skip all of that and focus on some of Mattermost's other features available through plugins and integrations.
[ Enhance your career by developing 5 essential soft skills for sysadmin self-improvement. ]
Plugins
- Open the Settings menu with the hamburger icon and go to Marketplace. As of this writing, the preview image lists 30 plugins that you can install directly from the Marketplace, but this is by no means all of the available plugins. You can find a complete list of available plugins over at the Marketplace webpage.
- Among the 30 available plugins, locate the Memes Plugin, then click Install.
- Once the plugin installs, click Configure, which will take you to the System Console configuration page for this plugin. Since it's only a basic plugin, you can only enable or disable it, so select True followed by Save.
- Return to the team page by clicking the Back to red-fedora link near the top left.
- Go to any available channels, and in the chat field, type /meme followed by a space; this will give you a list of available memes. I chose the Gatsy meme by typing /meme gatsby.
Integrations
- Navigate your way to the main menu and go to Integrations -> Outgoing Webhooks -> Add Outgoing Webhook.
- Input the values in their respective fields:
- Title: Fetch build status
- Content Type: application/json
- Channel: Off-topic
- Trigger Words: !buildstatus
- Trigger When: First word matches a trigger word exactly
- Callback URLs: http : //127.0.0.1:8080/
Note: Feel free to change the port in the callback URL if it conflicts with one already in use on your container host. Just be sure to use the correct port in the remaining steps.
- After hitting Save, you'll get a token ID; typically you will take note of and use this ID, but you can just click Done for this walkthrough.
- For the integration to work, you'll need to allow untrusted connectivity back to your container host, which you can do by navigating to System Console -> Environment -> Developer and then input 127.0.0.1 localhost under Allow untrusted internal connections to.
- Next, create a webserver on your container host that listens on port 8080. You can achieve this with a few lines of Python code and by using the
http.server
andjson
libraries, which are both included within the Python standard libraries. The following code was tested in Python 3.8.6 but should also work with Python 3.3+:from http.server import BaseHTTPRequestHandler, HTTPServer import json hostname = "localhost" http_port = 8080 class MyHTTPServer(BaseHTTPRequestHandler): def do_POST(self): self.send_response(200) self.send_header("Content-type", "application/json") self.end_headers() c_length = int(self.headers.get('content-length')) data_rcv = json.loads(self.rfile.read(c_length)) mm_token = data_rcv['token'] data_snd = {"text": "| OS Build | Tests Run | Issues Detected |\n" "|:---------|:----------|:---------------------|\n" "| RHEL | 534 | :white_check_mark: 0 |\n" "| Fedora | 856 | :warning: 2 |", "mattermost_token": mm_token } self.wfile.write(bytes(json.dumps(data_snd), "utf-8")) if __name__ == "__main__": web_server = HTTPServer((hostname, http_port), MyHTTPServer) web_server.serve_forever()
- Take the above code block and pop it into a file called
http_server.py
somewhere on your container host. You may need to adjustfirewalld
and SELinux configuration to allow it to run correctly. - To start the webserver, run
python http_server.py
from a terminal. The webserver runs continuously until you terminate it with Ctrl+C, so remember to do that when you're done. You won't see any output onstdout
until aPOST
is sent to the server. - Head back to Mattermost and switch over to the Off-Topic channel. In the text field, input !buildstatus and press Enter. You should immediately see a response with a nicely formatted table containing the static data you defined in your Python webserver script.
You have the connectivity between Mattermost and your application set up. Now it's up to your application to provide some meaningful data. Feel free to play around with the Python script and update the data_snd["text"]
dictionary key to return whatever you fancy.
[ A free guide from Red Hat: 5 steps to automate your business. ]
Wrapping up
This article took an introductory look into the open source collaboration tool Mattermost. A base installation of Mattermost is quick and straightforward and provides a great starting point, but the real power comes in the ability to customize it to your precise requirements. You achieve this by using some of the many available plugins or developing custom integrations that cater to your specific needs.
Mattermost gives you the launchpad to create the perfect collaboration tool for your environment, but now, it's up to you to make it happen.
Sull'autore
Thomas is a Technical Account Manager for Red Hat. An Aussie expat in Sweden, he is passionate about Open Source software and has a keen interest in emerging technologies such as blockchain. Always looking to discover something (or somewhere) new, Thomas prefers to either be travelling or working on a project. More recently he has combined these passions into an ongoing van conversion project, featuring IoT connectivity built on top of Raspberry Pi's with Open Source software!
Altri risultati simili a questo
Ricerca per canale
Automazione
Novità sull'automazione IT di tecnologie, team e ambienti
Intelligenza artificiale
Aggiornamenti sulle piattaforme che consentono alle aziende di eseguire carichi di lavoro IA ovunque
Hybrid cloud open source
Scopri come affrontare il futuro in modo più agile grazie al cloud ibrido
Sicurezza
Le ultime novità sulle nostre soluzioni per ridurre i rischi nelle tecnologie e negli ambienti
Edge computing
Aggiornamenti sulle piattaforme che semplificano l'operatività edge
Infrastruttura
Le ultime novità sulla piattaforma Linux aziendale leader a livello mondiale
Applicazioni
Approfondimenti sulle nostre soluzioni alle sfide applicative più difficili
Serie originali
Raccontiamo le interessanti storie di leader e creatori di tecnologie pensate per le aziende
Prodotti
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Servizi cloud
- Scopri tutti i prodotti
Strumenti
- Formazione e certificazioni
- Il mio account
- Supporto clienti
- Risorse per sviluppatori
- Trova un partner
- Red Hat Ecosystem Catalog
- Calcola il valore delle soluzioni Red Hat
- Documentazione
Prova, acquista, vendi
Comunica
- Contatta l'ufficio vendite
- Contatta l'assistenza clienti
- Contatta un esperto della formazione
- Social media
Informazioni su Red Hat
Red Hat è leader mondiale nella fornitura di soluzioni open source per le aziende, tra cui Linux, Kubernetes, container e soluzioni cloud. Le nostre soluzioni open source, rese sicure per un uso aziendale, consentono di operare su più piattaforme e ambienti, dal datacenter centrale all'edge della rete.
Seleziona la tua lingua
Red Hat legal and privacy links
- Informazioni su Red Hat
- Opportunità di lavoro
- Eventi
- Sedi
- Contattaci
- Blog di Red Hat
- Diversità, equità e inclusione
- Cool Stuff Store
- Red Hat Summit