Joseph Zikusooka (ZIK)

Linux Systems Engineer specializing in open source software technologies | Very experienced in building and configuring UNIX/Linux systems and servers. Passionate about developing software applications and hardware for the smart home | Currently serving as technologist at Jambula Labs and the project leader at JambulaTV, a smart home automation and entertainment platform - https://jambulatv.com | This blog focuses on the following areas: Linux How-Tos and Tutorials ::: IT Security News ::: Free and Libre Open Source Software ::: Smart Home Software ::: Digital Innovations in East Africa https://mastodon.social/@jzik | https://github.com/zikusooka

Author : Joseph Zikusooka

I am a software engineer and developer specializing in open source software. I have a solid experience building and configuring UNIX/Linux systems and servers. I am passionate about developing software applications and hardware for the smart home I am currently serving as the CEO of Jambula Labs and the project leader at JambulaTV, a smart home automation

A recap of my presentation at FOSS Backstage 2025

Hereโ€™s a summary of my presentation delivered during the FOSS Backstage 2025 conference in Berlin, Germany. For a deeper dive into the points outlined below, please refer to the official recording of my talk.

Why Are There Low Adoption Rates for Open Source Software in Africa?

  1. Lack of awareness and motivation for those who know.
  2. Prestige associated with using software from larger, well-known vendors.
  3. Vendor lock-in and aggressive marketing by proprietary companies targeting governments.
  4. Limited availability of certified and experienced FOSS/Linux professionals.
  5. Prevalence of software piracy.
  6. Fragmented or non-existent FOSS communities.

More Barriers to Adoption of Open Source Software in Africa

Infrastructure Challenges:

  1. Internet connectivity issues.
  2. Unstable and unreliable power supply.
  3. Lack of resources and funding.
  4. Systemic corruption.

Why Bother with FOSS Adoption in Africa?

  • Africa accounts for 18% of the world’s population (1.5B+), with some of the fastest-growing economies globally.
  • By 2025, 12 of the worldโ€™s 20 fastest-growing economies are projected to be in Africa.

Benefits of FOSS Adoption:

  1. Lower costs.
  2. Skilling and narrowing the digital divide.
  3. Startups and job creation.
  4. Empowerment through access to free resources.
  5. Localized innovations driving growth in key sectors.

Key and Strategic Sectors in Africa for FOSS Adoption

  1. Mining
  2. Agriculture
  3. Tourism
  4. Startups/SMEs (e.g., Banking, Film & Music Industry)
  5. Education
  6. Health
  7. Research
  8. Environment

Enablers and Implementers of Open Source Software Adoption

  1. Advocates/Evangelists: Promote FOSS use in sectors like government, health, and education.
  2. Trainers/Educators: Teach FOSS concepts (e.g., Linux).
  3. Community Leaders: Lead FOSS communities.
  4. Software Developers: Create and maintain open-source software.
  5. Vendors/Integrators: Include Linux distributors and organizations promoting FOSS.

Strategies for Stakeholders

For Advocates:

  1. Timing
  2. Focus
  3. Campaigns
  4. Showcase (e.g., trade shows)
  5. Share and evangelize

For Trainers/Educators:

  1. Localize content
  2. Contextualize teachings
  3. Port content
  4. Adapt materials
  5. Evangelize

For Community Leaders:

  1. Assess needs
  2. Partner with stakeholders
  3. Fundraise and support initiatives
  4. Host events
  5. Engage strategic sectors

For Software Developers:

  1. Solve immediate problems.
  2. Localize solutions.
  3. Enable workarounds.
  4. Use free and open licenses.
  5. Adapt bravely.

For Vendors:

  1. Provide support.
  2. Engage with local FOSS advocates and communities.
  3. Partner with startups to promote FOSS.
  4. Certify professionals.
  5. Establish local FOSS incubators.

Conclusion

I am optimistic that the next decade will see a significant increase in open source software adoption across Africa, unlocking its potential for economic growth and innovation in key sectors.

Jambula OS Linux – Version 2025.1.0 Released

I have just compiled and released a new image for Jambula OS Linux version 2025.1.0! This exciting update features a range of innovative enhancements, including:

๐ŸŒŸ Seamless integration with the latest Home Assistant smart home software

๐Ÿ“… Radicale, the lightweight and powerful CalDAV/CardDAV server for all calendaring needs

๐ŸŽต A local music server that supports audio announcements and alerts

๐Ÿ•ฐ๏ธ A talking clock feature that announces the time at hourly intervals

๐ŸŒฆ๏ธ Periodic weather updates delivered through voice alerts tailored to your location

๐Ÿ“ท MQTT-based triggers activated by motion detection from the built-in camera server

For more information about Jambula OS Linux, including instructions on how to download and install it, please visit:

https://github.com/zikusooka/Jambula-OS

Hass Core Installer, a new Home Assistant Installer and upgrade tool for Linux

I’m excited to announce that I have uploaded a new tool called HASS Core Installer. As you have guested, its a handy tool that makes it very easy to install, upgrade, and uninstall Home Assistant Core on Linux. So weather you are a beginner, intermediate, or advanced Home Assistant user, this tool is just what you need if any of the official and recommended methods are not sufficient for your use case.

I initially developed this tool for use on Jambula OS, a custom tailored Linux operating system designed for SoC devices such as the Raspberry Pi. However, you can use it on any Linux distribution such as Ubuntu, Fedora, OpenSUSE, Ubuntu, Debian etc.

HASS Core Installer also works off-line allowing for local installations and upgrades of Home Assistant in scenarios where there’s no access to the Internet.

To get started or contribute to this project, check out the HASS Core Installer repository on my Github!

Jambula OS Linux now offers support for Home Assistant

๐Ÿš€โœจ Exciting news for smart home enthusiasts! I have added support for Home Assistant Core installs & upgrades to Jambula OS (starting with version 2024.10.0) ๐ŸŽ‰

โš™๏ธ Jambula OS is a custom Linux operating system ๐Ÿง designed specifically for SoC devices like the Raspberry Pi 5

โฌ‡๏ธ You can download it here: https://github.com/zikusooka/Jambula-OS/

๐Ÿก Upgrade today and kickstart your journey to creating a private, offline smart home ๐Ÿ’กhub!

Linux, Python, Security, and Open Source Software TIPS

  • So happy to see these two back together! Can't wait to catch up on season 3 of #TheDiplomat with Allison Janney and Bradley Whitford#TheDiplomatS3 #TVShows #TVSeries
  • Vibe coding – Fake it until AI breaks it.#fedihumour #vibecoding #AI #Fediverse
  • If you care about diversity in open source especially from marginalized communities like those across Africa – check out this talk I gave at the recent @opensuse Conference in Germany. I argue that the open source community can no longer afford to overlook developers in these regions. Their talent, perspectives and potential are vital to the future of open source everywhere.https://www.youtube.com/watch?v=olMcEiI8EVw#osC25 #Diversity #FOSS #Africa
  • Just finished watching an excellent presentation by Dorinda Bassey on "Modernizing Virtio GPU: A Rust-Powered Approach with vhost-device-gpu" at @KernelRecipes @redhat #kr2025 #KernelRecipes #Kernel #Embedded
  • I am really enjoying the talks coming out of the @KernelRecipes conference, running now through September 24. Especially looking forward to @gregkh 's session Today on "The CRA and What It Means for Us" Check out live stream at: https://www.youtube.com/watch?v=U7pZbCnJxEw#CRA #kr2025 #kernel #Embedded
  • RE: https://mastodon.social/@jzik/115225291806144141Thanks to everyone who replied, shared, or boosted my previous post about teaching Linux remotely.I've decided to offer my own 4-person class starting October 8th! It will be remote, & offered at a small cost. The schedule is flexible & course materials will be shared shortly.If you'd like to join or learn more, check the details here:https://joseph.zikusooka.com/?page_id=2807Boosts appreciated again!#Linux #FediHire #FediHired #GetFediHired #FediJobs #jobs #RemoteWork #TechEducation
  • Wishing everyone attending DevConf.US a fantastic conference this weekend! Unfortunately, I won't be able to join you or give my previously scheduled talk, but I hope you all have a great time!#DevConfUS #DevConf_US #devconfus2025 #FOSS
  • Would anyone know which organizations offer opportunities for teaching Linux classes online & remotely? I am interested in sharing my expertise. I currently live in the GMT+3 time zone but am flexible.I have experience teaching Intro to Linux Systems Admin & Server management. Iโ€™ve successfully trained multi-day/person classes using BBB, Jitsi & Zoom.If you know of any or need training, pls let me know.Boosts appreciated!#FediHire #FediJobs #GetFediHired #jobs #FediHired
  • I've uploaded the latest ๐‰๐š๐ฆ๐›๐ฎ๐ฅ๐š ๐Ž๐’ image – version ๐Ÿ๐ŸŽ๐Ÿ๐Ÿ“.๐Ÿ—.๐ŸŽ. This release continues the work I've been doing to make Jambula OS, a reliable, lightweight Linux platform for SoC devices like the Raspberry Pi 5. If you're building smart automation solutions on embedded platforms, this update is definitely worth checking out.Highlights in this update: Bluetooth speaker support, Kea DHCP, and much more!https://code.jambula.net/zikusooka/Jambula-OS #JambulaOS
  • The talks from this year's Open Source Summit Europe are now available @linuxfoundationCheck out the full playlist at:https://youtube.com/playlist?list=PLbzoR-pLrL6qKwLt8A787ggMLHNivOHve#OSSummit #OSSEU
  • Hass Core Installer 2025.9.0 released! No major changes – I just updated to the latest Home Assistant release.This free and open source tool helps you install/upgrade Home Assistant via the (now deprecated) core method for those who prefer its flexibility. https://github.com/zikusooka/hass-core-installer#HomeAssistant #FOSS
  • For anyone interested in using Kea DHCP server on buildroot, I have submitted a new package patch that is currently awaiting upstream review. You can check it out here: https://patchwork.ozlabs.org/project/buildroot/patch/20250903113307.100754-1-zik@jambula.net/@iscdotorg #ZikTIPS #buildroot #dhcp #networking
  • ๐Ÿ’ก Calculate the number of days since a given date (e.g. 30 June 2025) on a Linux system:echo $(( ( $(date +%s) – $(date -d "2025-06-30" +%s) ) / 86400 ))@opensuse @fedora @debian #ZikTIPs #Linuxtips #LinuxTechTips #FOSS
  • ๐Ÿ’กDid you know you can just run the mount command with -m flag to create a non-existent mount point instead of first creating it.e.g. mount -m /dev/sdc1 /myflash#ZikTIPs #linuxtips #techti
  • So I won't be able to attend or present my previously scheduled talk at #FOSSY2025 in Portland, OR. Disappointed to miss this amazing event and the vibrant #FOSS community. Nevertheless, I wish everyone attending a fantastic conference filled with inspiring talks and great connections. Hope to join you all in person at #FOSSY25 #FOSSY2026! @conservancy
  • In FOSS circles, we often speak of representation, equity and community – but are we truly reaching those most affected by the digital divide?2 weeks ago at the conference in Nuremberg, I spoke about this & how it continues to shape access, opportunity & equity especially in rural regions of Africa. I explored how FOSS can be a tool for empowerment, resilience & impact @opensuseVideo: https://youtu.be/olMcEiI8EVw#FOSS #DigitalDivide #GlobalImpact #TechForGood
  • Had a great time at @opensuse Conference 2025 in Nuremberg! A highlight was the hands-on workshop by @tropicsquar, showcasing #TROPIC01 โ€” the first open and auditable secure element. A big step for verifiable hardware #security in systems, edge devices & secure infrastructure.Thanks to the Tropic Square team for the great session and the devkit#HardwareSecurity #EdgeComputing #TROPIC01 #TrustedHardware #SecureChips#IoTSecurity #NoObscurity #OpenHardware
  • Agama, the modern, adaptive and modular installer for @opensuse has reached a new milestone: Version 16For what's new, checkout: https://agama-project.github.io/blog/2025/07/04/agama-16If you're not yet familiar with Agama, watch this talk and live demo I did at the openSUSE Conference 2025 recently:https://youtu.be/LXJbOy-pXMc#Agama #FOSS
  • In case you missed my talks or others at the @openSUSE Conference that took place in Nuremberg, Germany #oSC25 – all sessions are now published and ready to watch! Dive in and catch up on the latest in #FOSShttps://t.co/63N4y6IDhK
  • Demo of Agama Linux Installer at OpenSUSE Conference 2025 โ€“ Nuremberg, GermanyOver the weekend at the OpenSUSE Conference 2025 in Nuremberg, Germany, I had the pleasure of showcasing Agama, the innovative new Linux installer set to debut in openSUSE Project Leap 16 and SUSE Linux Enterprise Server 16.While still in active development, this tool is shaping up impressively and promises to redefine the future of unatthttps://joseph.zikusooka.com/?p=2742#Tips

How to install the latest Python 3 version on Linux using sources

Introduction

Python 3.11.0 was officially released on October 24 2022. However, most Linux distributions have not yet upgraded to the latest Python version i.e. Python 3.11.2 (released on February 8 2023). Please visit this page to see the most recent versions.

The jump from versions 3.10.X to 3.11.X brought with it significant changes and improvements to Python code. Among the improvements is that Python is now 10 – 60% faster than before. Thatโ€™s a big and noticeable speed boost. So beyond the usual reasons for upgrades i.e. security etc, I really wanted this version on my Linux desktop as soon as the final release was made publicly available.

If you are like me and donโ€™t like waiting for your favourite open-source program to be supported on your Linux distribution, here is how to install the latest Python 3 version on Linux using sources.

Before you begin, check the current version on your Linux system:

python  --version

Currently the version of Python on my Linux system is three (3) releases behind. So it is time for me to upgrade to the most recent version.

CAUTION: Due to the many dependencies on the currently installed Python common package, I highly recommend that you do not remove the existing version. Instead, we will install the latest version in an alternate location e.g. /usr/local

Prerequisites

Please ensure that your Linux system has the following packages installed:

On Ubuntu or Debian:

sudo apt-get install build-essential

sudo apt-get install autoconf automake gdb libffi-dev zlib1g-dev libssl-dev libncurses5-dev libgdbm-dev libnss3-dev libreadline-dev libsqlite3-dev

On Fedora or Rocky Linux:

sudo dnf groupinstall “Development Toolsโ€

sudo dnf install openssl-devel libffi-devel bzip2-devel sqlite-devel

* You will also need wget which is generally included by default on most Linux distributions

Visit the Python downloads page for sources to get the direct link to latest Python source package. In this tutorial I will be using the XZ compressed source tarball i.e. Python-3.11.2.tar.xz

Download the latest Python package to a temporary directory:

wget  -c  -P /tmp  https://www.python.org/ftp/python/3.11.2/Python-3.11.2.tar.xz

Unpack the Python 3 tarball:

tar xvf /tmp/Python-3.11.2.tar.xz -C /usr/src

Compile and build Python:

cd  /usr/src/Python-3.11.2

./configure  --prefix=/usr/local  --enable-shared  --enable-optimizations  --with-system-expat  --with-system-ffi

IMPORTANT: Ensure the prefix i.e. โ€˜/usr/localโ€™ you use is different from that used by your Linux distribution otherwise you will overwrite the default Python 3 installation!

Optional: You can make some of your modules a permanent part of the Python interpreter. To do so, simply modify the file: Modules/Setup.local before running make. To see my my local setup, see the appendix.

sudo  make

TIP: you can add โ€œ– j $(getconf _NPROCESSORS_ONLN)โ€ to the make command in order to speed things up i.e. sudo make -j $(getconf _NPROCESSORS_ONLN)

sudo  make  altinstall

Add the following export command to your shell initialization file:

Using Bash shell:

echo  โ€œexport  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/libโ€  >>  ~/.bashrc

Then source the file for now:

source  ~/.bashrc

To verify if you now have the latest Python 3 (including pip installer) versions:

/usr/local/bin/python3.11 โ€“version

/usr/local/bin/pip3.11 โ€“version

Congratulations! You now have the latest Python 3 version on your Linux system.

NOTE: When your distribution eventually catches up, you can remove this installation by issuing the ‘make uninstall‘ command in the installation directory i.e. /usr/src/Python3.11

Appendix

Here’s my sample ./Modules/Setup.local file:

array -DPy_BUILD_CORE_MODULE arraymodule.c
_contextvars _contextvarsmodule.c
_struct -DPy_BUILD_CORE_MODULE _struct.c
_random _randommodule.c -DPy_BUILD_CORE_MODULE
_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c
_pickle -DPy_BUILD_CORE_MODULE _pickle.c
_datetime _datetimemodule.c
_zoneinfo _zoneinfo.c -DPy_BUILD_CORE_MODULE
_bisect _bisectmodule.c
_asyncio _asynciomodule.c
_json -I$(srcdir)/Include/internal -DPy_BUILD_CORE_BUILTIN _json.c
unicodedata unicodedata.c -DPy_BUILD_CORE_BUILTIN
fcntl fcntlmodule.c
spwd spwdmodule.c
grp grpmodule.c
select selectmodule.c
mmap mmapmodule.c
_csv _csv.c
_socket socketmodule.c
termios termios.c
resource resource.c
_posixsubprocess  -DPy_BUILD_CORE_BUILTIN _posixsubprocess.c
audioop audioop.c
_md5 md5module.c
_sha1 sha1module.c
_sha256 sha256module.c -DPy_BUILD_CORE_BUILTIN
_sha512 sha512module.c -DPy_BUILD_CORE_BUILTIN
_sha3 _sha3/sha3module.c
_blake2 _blake2/blake2module.c _blake2/blake2b_impl.c _blake2/blake2s_impl.c
syslog syslogmodule.c
binascii binascii.c
zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DXML_POOR_ENTROPY -DUSE_PYEXPAT_CAPI
_multibytecodec cjkcodecs/multibytecodec.c

How to use Linux GNOME terminal like a Pro

For most users work is typically done in a web browser like Firefox or Chrome. (BTW, if you are not using Mozilla’s Firefox, I can not emphasize enough why you should switch to this opensource browser)
For advanced users i.e. IT admins, software developers, most of their time may be spent in a terminal and on Linux most often gnome terminal

Like regular users who prefer to open multiple tabs in a browser, using tabs in a terminal is necessary for an advanced user if they are to be productive. However, it can get pretty tedious and boring having to open up multiple terminal tabs in every time you start your Linux desktop

Using the command line tool gnome-terminal this process can be automated. This tool allows you to open multiple gnome-terminal tabs like a pro i.e. At desktop startup, open several & different tabs each with its own specified directory path or run command. You can even log into a remote system, if you have setup to allow passwordless SSH connections.

Below is a basic example of gnome-terminal command in action

gnome-terminal --maximize --geometry=80x24+200+200 --display=:0 --tab-with-profile=DAY -t Local --working-directory=/projects --tab-with-profile=NIGHT -t Remote -e "ssh -t jambula@REMOTE \"cd /opt; bash\""

I use this in a script which is activated by a custom keyboard shortcut to start my day

How to monitor the presence of nearby WiFi devices using Icinga2

Introduction

I recently published a Python based plugin for Icinga and Nagios monitoring platforms that monitors the presence of wireless devices in the vicinity.

I really like the stability and reliability Icinga provides when it comes to monitoring the state of hosts or services. There are so many software applications that let you do this, including one I talked about a while back called trackerjacker: https://github.com/calebmadrigal/trackerjacker

Why this way?

At first trackerjacker seemed like what I needed to do this sort of thing, but after several months of testing one issue persisted. The performance hit whenever I started the process was huge. The server, would frequently slow down, as packet capturing and monitoring of WiFi devices took place. So I decided to ditch this tool, and write my own plugin.

I am already using icinga on the server, so I figured, rather than write another app for polling, why not use the existing and well performing icinga2 monitoring software. After all, I had done this with bluetooth devices earlier and presence detection was working so well.

Pre-requisites

You are running a Linux based server with Icinga2 monitoring software installed, configured and working properly. There are several articles about how to install and configure icinga2 including the official documentation at:
https://icinga.com/docs/icinga-2/latest/doc/01-about/

The heavy lifting i.e. scanning is done by the Wireshark based CLI tool ‘tshark’. Therefore, ensure that Wireshark is installed on your system. Also, a separate wireless interface that supports monitor mode is required

To capture packets as a non-root user, run the following command in your terminal:
sudo setcap cap_net_raw,cap_net_admin+eip $(which dumpcap)

If you’re still having trouble capturing packets as a non-root user, check out the following Wireshark wiki page:
https://wiki.wireshark.org/CaptureSetup/CapturePrivileges#Most_UNIXes

You will need to identify the MAC address of each wireless device you plan on monitoring. For phones for example, this information is in the Settings >> General >> About >> WiFi Address for iOS. For Android, go to Settings >> About >> Status >> Wi-Fi MAC address

NOTE: Some phones like the iPhone may have MAC randomization enabled, which makes it difficult to reliably monitor their presence status

Setup Icinga2 plugin

Download icinga2 monitoring plugin named ‘check_tshark’ from my Github page at:
https://github.com/zikusooka/icinga-nagios-plugins

Alternatively, you can clone the entire repository and check out my other plugins too:

git clone https://github.com/zikusooka/icinga-nagios-plugins

Copy the icinga2 plugin i.e. check_tshark to your icinga2 monitoring plugins directory e.g. /usr/lib64/nagios/plugins/

cp -v check_tshark /usr/lib64/nagios/plugins/

Configure Icinga2

Add new check and event command objects to icinga2 i.e. Add and save the following snippets to the file:
/etc/icinga2/conf.d/commands.conf

object CheckCommand "tshark" {
        import "plugin-check-command",

        command = [ PluginDir + "/check_tshark" ]

        arguments = {
                "-i"="$tshark_interface$"
                "-t"="$tshark_timeout$"
                "-a"="$tshark_address$"
        }
}
object EventCommand "wifi-tshark-status-event" {
  import "plugin-event-command"

  command = [ SysconfDir + "/icinga2/scripts/wifi-tshark-status-event.sh" ]

  env = {
    "HOSTALIAS" = "$host.display_name$",
    "HOSTADDRESS" = "$address$",
    "HOSTSTATE" = "$host.state$",
    "HOSTSTATEID" = "$host.state_id$",
    "HOSTSTATETYPE" = "$host.state_type$",
    "HOSTOUTPUT" = "$host.output$",
    "HOSTDISPLAYNAME" = "$host.display_name$",
    "LASTHOSTSTATE" = "$host.last_state$",
    "LASTEHOSTSTATEID" = "$host.last_state_id$",
    "LASTHOSTSTATETYPE" = "$host.last_state_type$",
    "LASTHOSTSTATECHANGE" = "$host.last_state_change$",
    "LASTHOSTCHECK" = "$host.last_check$",
    "LONGDATETIME" = "$icinga.long_date_time$",
  }

}

Add new host templates to icinga2 i.e. Add and save the following snippets to the file:
/etc/icinga2/conf.d/templates.conf

template Host "event-tshark-status" {
  max_check_attempts = 6
  check_interval = 30s
  retry_interval = 5s

  check_command = "tshark"

  enable_event_handler = 1
  event_command = "wifi-tshark-status-event"

  enable_flapping = 1
  flapping_ignore_states = ["Critical"]
}

Finally add the wireless devices you want to monitor to the hosts in icinga2 i.e. Add and save the following snippets to the file:
/etc/icinga2/conf.d/hosts.conf

NOTE: In addition to the MAC address, make sure you specify the WiFi interface used for monitoring

object Host "Phone_Zik" {
  import "event-tshark-status"
  vars.tshark_interface = "wlan1"
  vars.tshark_timeout = 10
  vars.tshark_address = "xx:xx:xx:xx:xx:xx"
}

object Host "Phone_Shushu" {
  import "event-tshark-status"
  vars.tshark_interface = "wlan1"
  vars.tshark_timeout = 10
  vars.tshark_address = "xx:xx:xx:xx:xx:xx"
}

Optional: Add Alert notification using MQTT

In order to send alerts whenever a WiFi device appears or disappears, you will need to set up a MQTT broker server. I personally use mosquitto on Fedora Linux. For detailed instructions on how to setup mosquitto on Fedora Linux, check out this how to: https://nullr0ute.com/2016/05/getting-started-with-mqtt-using-the-mosquitto-broker-on-fedora/

Since, we have already enabled event handling for our monitored devices in icinga2, all that is left is to add an event script that will be triggered by the HOST state of either UP or DOWN. Here’s an example:

Create the following script and make it executable:

cat > /etc/icinga2/scripts/wifi-tshark-status-event.sh <<ET
#!/bin/sh
# Variables
TSHARK_MAC_ADDRESS=$(echo "$HOSTOUTPUT" | grep -oP "(?<=\[).+?(?=\])")
MQTT_TOPIC_PRESENCE_TSHARK=Home/presence/$TSHARK_MAC_ADDRESS
MQTT_PUBLISH_CMD=/usr/bin/mosquitto_pub
MQTT_PUBLISH_OPTS="--quiet -h 127.0.0.1 -p 8883"
# Quit if type of state alert is 'SOFT'
[[ "$HOSTSTATETYPE" = "SOFT" ]] && exit 0

# Publish status via MQTT
if [[ "$HOSTSTATE" = "UP" ]];
then
$MQTT_PUBLISH_CMD $MQTT_PUBLISH_OPTS -t "$MQTT_TOPIC_PRESENCE_TSHARK" -m "Home"

else
$MQTT_PUBLISH_CMD $MQTT_PUBLISH_OPTS -t "$MQTT_TOPIC_PRESENCE_TSHARK" -m "Away"
fi
ET
 
chmod 755 /etc/icinga2/scripts/wifi-tshark-status-event.sh

To check your configuration and that all syntax is correct; run the following command:

icinga2 daemon -C

If all’s OK, restart icinga2 as follows:

systemctl restart icinga2

Conclusion

Next, log into your icinga2 web interface (if you have this setup) and ensure your devices are reporting correctly.

In order to monitor alerting via MQTT run the following command in a terminal:

mosquitto_sub -v -h JambulaTV -p 8883 -t "JambulaTV/#" --insecure  | grep presence

That’s all for now. Until next time!

Scroll to top