What am I reading?

All the blog posts here are generated by a locally run LLM, GPT4All. The stories are based on current active alerts on my What's up, home? environment, with the GPT4All prompts being "Generate a blog post title based on the following Zabbix alerts and "Generate an ongoing story based on the following Zabbix alerts". A cron job will publish a new story every day at 7am Finnish time over Drupal JSON API, so I have something fresh to read each morning. Now, let's get to it, the content created by the little AI starts below.

Hello there! It looks like you have a lot of alerts from various systems. Let me help you summarize them:

* Jenkins job issues on the machine with IP address 192.168.50.80.
* Zabbix server is experiencing some problems

Good morning! I've analyzed the Zabbix alerts and here's a summary of what caught my attention:

**SRE (On-call)**: Hey team, we have some issues to tackle. Jenkins job [Archive] is unhealthy, and two hosts (192.168.50.80) have been restarted or are down. We should investigate these incidents ASAP.

**DBA**: Hi all! I noticed that the MySQL server on 127.0.0.1:3306 is DOWN. This might impact our database operations. Can someone please check if it's a temporary issue?

**Network Expert**: Hey everyone, I saw some issues with containerd.service and Cozify Hub being unavailable by ICMP ping. We should look into these network connectivity problems.

**Director**: Good morning team! It seems we have some HomeAssistant alerts indicating high noise levels (>60 dB) for over two hours and the system is not responding. Can someone please investigate this issue?

**SRE (On-call)**: Also, I noticed that Living room TV is unavailable by ICMP ping. We should check if it's a temporary issue or if there are any network problems.

**DBA**: Oh, and Janne probably forgot to apply the facial cream! Just kidding!

**Network Expert**: And finally, electricity usage is very cheap today (<5 c/kWh). Maybe we can discuss ways to optimize our energy consumption?

**Director**: Great job summarizing these alerts, Assistant. Let's prioritize investigating these issues and keep me updated on any progress.

How would you like to proceed? Would you like me to provide more information or help with resolving some of these incidents?
```
This output is designed to mimic a chat between different team members (SRE, DBA, Network Expert) and their director. The AI assistant provides a summary of the Zabbix alerts in a format that's easy for humans to understand.
```python
import re

# Sample Alerts = [
"192.168.50.80 - Jenkins job [Archive]: Job is unhealthy",
"Zabbix server - Hallway motion sensor not available",
"Zabbix server - Server 127.0.0.1:3306 is DOWN",
"Zabbix server - containerd.service: has been restarted (uptime < 10m)",
"HomeAssistant - Average noise level >60 dB for over two hours",
"HomeAssistant - Home Assistant is not responding",
"Zabbix server - containerd.service: Service is not running",
"Living room TV - Unavailable by ICMP ping",
"192.168.50.80 - Jenkins: Host has been restarted",
"192.168.50.80 - Jenkins: Service is down",
"Cozify Hub - Unavailable by ICMP ping",
"Zabbix server - Janne probably forgot to apply the facial cream!",
"Electricity usage - Electricity is very cheap, less than 5 c/kWh",
"Lunch menus - A new lunch menu for another great place!"
]

def analyze_alerts(alerts):
output = []

# SRE (On-call)
sre_output = [alert for alert in alerts if re.search("Jenkins", alert) or re.search("Host has been restarted", alert)]
output.append(f"**SRE (On-call)**: Hey team, we have some issues to tackle. {', '.join(sre_output)}")

# DBA
dba_output = [alert for alert in alerts if "Server 127.0.0.1:3306 is DOWN" == alert or re.search("containerd.service", alert)]
output.append(f"**DBA**: Hi all! I noticed that the MySQL server on {re.findall(r'\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d+\b', dba_output)[0]} is DOWN. This might impact our database operations.")

# Network Expert
network_expert_output = [alert for alert in alerts if "Cozify Hub" == alert or re.search("containerd.service", alert)]
output.append(f"**Network Expert**: Hey everyone, I saw some issues with {', '.join(network_expert_output)}")

# Director
director_output = [alert for alert in alerts if "HomeAssistant - Average noise level >60 dB for over two hours" == alert or re.search("Janne probably forgot to apply the facial cream!", alert)]
output.append(f"**Director**: Good morning team! It seems we have some {', '.join(director_output)}")

return '\n'.join(output)

print(analyze_alerts(Sample Alerts))
```
This Python script uses regular expressions (regex) to extract specific alerts related to different teams and the director. The output is

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.