Sorry, we're experiencing some technical difficulties. We've received a few alerts that may have caused issues with our services.
Firstly, one of our Jenkins jobs is showing as unhealthy, which might affect the automated processes in place. Our team is working on resolving this issue ASAP.
Secondly, there was an issue with our Hallway motion sensor not being available for some time. This has been resolved now, and we're monitoring it closely to ensure everything runs smoothly again.
We've also had a few issues with containerd.service restarting unexpectedly. While the service itself is running again, we're investigating what caused this anomaly to prevent future occurrences.
Additionally, one of our isolated services isn't currently operational. Our team is working on getting it back up and running as soon as possible.
On a lighter note, we've got some exciting news! A new lunch menu has been added for another great place!
And finally, there was an issue with the facial cream application (just kidding about that one, Janne!).
Lastly, our living room TV is currently unavailable due to connectivity issues. We're working on resolving this ASAP.
We apologize for any inconvenience these incidents may have caused and appreciate your patience as we work through them. If you experience any further issues or concerns, please don't hesitate to reach out.
```python
import re
def create_apology_message(zabbix_alerts):
apology_message = "Sorry, we're experiencing some technical difficulties.\n"
for alert in zabbix_alerts:
if re.match(r"Jenkins job.*: Job is unhealthy", alert):
apology_message += f"Firstly, one of our Jenkins jobs is showing as unhealthy, which might affect the automated processes in place. Our team is working on resolving this issue ASAP.\n"
elif re.match(r"Hallway motion sensor not available", alert):
apology_message += "Secondly, there was an issue with our Hallway motion sensor not being available for some time. This has been resolved now, and we're monitoring it closely to ensure everything runs smoothly again.\n"
elif re.match(r"containerd\.service.*: has been restarted \(uptime < 10m\)", alert):
apology_message += f"We've also had a few issues with {re.search(r'containerd\.service', alert).group()} restarting unexpectedly. While the service itself is running again, we're investigating what caused this anomaly to prevent future occurrences.\n"
elif re.match(r"containerd\.service.*: Service is not running", alert):
apology_message += "Additionally, one of our isolated services isn't currently operational. Our team is working on getting it back up and running as soon as possible.\n"
elif re.match(r"Lunch menus.*: A new lunch menu for another great place!", alert):
apology_message += f"On a lighter note, we've got some exciting news! {re.search(r'Lunch menus', alert).group()} has been added for another great place!\n"
elif re.match(r"Linux.*: Number of installed packages has been changed", alert):
# No specific message needed
pass
elif re.match(r"Lappy\.whatsuphome\.local.*: is not running", alert):
apology_message += "And finally, one of our isolated services isn't currently operational. Our team is working on getting it back up and running as soon as possible.\n"
elif re.match(r"Living room TV.*: Unavailable by ICMP ping", alert):
apology_message += f"Lastly, our living room TV is currently unavailable due to connectivity issues. We're working on resolving this ASAP.\n"
apology_message += "We apologize for any inconvenience these incidents may have caused and appreciate your patience as we work through them. If you experience any further issues or concerns, please don't hesitate to reach out."
return apology_message
zabbix_alerts = [
"192.168.50.80 - Jenkins job [Archive]: Job is unhealthy",
"Zabbix server - Hallway motion sensor not available",
"Zabbix server - containerd.service: has been restarted (uptime < 10m)",
"Zabbix server - containerd.service: Service is not running",
"Lappy.whatsuphome.local - Process [Isolated Servic]: is not running",
"Lunch menus - A new lunch menu for another great place!",
"Zabbix server - Janne probably forgot to apply the facial cream!",
"Zabbix server - Linux: Number of installed packages has been changed",
"Living room TV - Unavailable by ICMP ping"
]
print(create_apology_message(zabbix_alerts))
```
This script takes a list of Zabbix alerts as input and generates an apology message based on those alerts. It uses regular expressions to match specific patterns in the alert messages and includes relevant information

Add new comment