Execute a Shell Script using Zabbix Agent
Video Lecture
Description
In this lesson I will run a Shell Script (.sh
) using the agent running on my Zabbix Server.
This script will return the number of days remaining before an SSL certificate expires.
You can use any Linux agent you desire to run this script.
Create a folder on the Linux host. (if the folder doesn't already exist)
# |
|
CD into the folder
# |
|
Then create the script on your server,
# |
|
1 2 3 4 5 6 7 8 9 |
|
Save it, and give it execute permissions.
# |
|
Test that it works using
# |
|
or
# |
|
Adding port 443 is optional and default. You can put any port here in case your certificate was bound to a different port, e.g., 3000 or 8443
or use any other domain name rather than example.com
Then go into Zabbix and create items that call this script for each website SSL you want to monitor.
Example item key is
system.run[/home/zabbix/checkssl.sh example.com 443]
Since the expiry days can go negative, I advise you use the numeric(float) option in the type of information drop down.
See the video for more requirements to get this to work.