Ad Widget

Collapse

Issue when using external script to monitor certificate expiration

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Scrabbi
    Junior Member
    • Jan 2025
    • 10

    #1

    Issue when using external script to monitor certificate expiration

    Hello,

    I have created a small script to check how many days I have left before my website certificates expires. When I execute my script using the user "zabbix" (which is the one used when an external script is used if I understood well) on my zabbix server, the script works fine and I get the number of days before expiration. However, once I create a host with a template, I get " Could not read certificate from /tmp/tmp.xxxxxx unable to load certificate 0".


    Here you can find the script and the item :
    The name of the host is "mysite.com" and is monitored by my zabbix server :
    I found the script here : https://askubuntu.com/questions/1198...s-in-a-website



    I did a bit of troubleshooting, and when I execute the script form my server, the tmp file is created and contains the certificate, but if it's from the item, the tmp file is empty.

    I don't really know how to go from here, any help would be greatly appreciated.

    Scrabbi
    Attached Files
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4874

    #2
    I am no linux admin, but I think there might be a difference, if script is executed as logged in user from command line and as background process by same user... There can be difference in env vars, shell etc.. missing PATH etc...

    Comment

    Working...