Ad Widget

Collapse

Need help with LLD Certificate monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LaurisG
    Junior Member
    • Nov 2017
    • 14

    #1

    Need help with LLD Certificate monitoring

    Hello, deer Colleagues.

    Can't figure out how to monitor Certificate expiration with LLD...

    I get JSON data from Windows server:

    Code:
    {
     "data":
    
    [
        {
            "{#CERTINFO}":  "BlueBridge SIL Authentication",
            "{#DAYSLEFT}":  1169
        },
        {
            "{#CERTINFO}":  "Certum",
            "{#DAYSLEFT}":  3469
        }
    ]
    }
    Discovery Rule Key: certificate.discovery
    Item prototype: Name Certificate {#CERTINFO} expiring, Key: certificate[{#DAYSLEFT}], Numerical (Decimal)
    Trigger prototype Expression: {Template OS Windows:certificate[{#DAYSLEFT}].last()}<10

    But nothing happening...


    Q: What kind of keys i must use if I want to be notified about expiring cert in 10 days?

    Thanks a lot in advance!
    Last edited by LaurisG; 12-12-2017, 08:00.
  • LaurisG
    Junior Member
    • Nov 2017
    • 14

    #2
    Anyone?

    No luck with google...

    Comment

    • Atsushi
      Senior Member
      • Aug 2013
      • 2028

      #3
      Is the argument of certificate[] number of days?
      Make sure that the script executed with certificate[] specifies that the value of DAYSLEFT is specified as an argument and executed.

      I would like to have certificate.discovery to get a list of certificates and certificate[] to return the remaining number of days with the value of CERTINFO as an argument.

      Comment

      • LaurisG
        Junior Member
        • Nov 2017
        • 14

        #4
        Discovery generating items properly:

        Item: Certificate Expiration Discovery: Certificate DST Root CA X3 expiring
        Key: certificate[1387]

        Comment

        • LaurisG
          Junior Member
          • Nov 2017
          • 14

          #5
          But Trigger doesn't work...

          Certificate BlueBridge SIL Authentication expiring {some-server-name:certificate[1167].last(1)}<2000 Enabled

          Comment

          • LaurisG
            Junior Member
            • Nov 2017
            • 14

            #6
            And after some time all items changes to "Unsupported item key"

            Comment

            • Atsushi
              Senior Member
              • Aug 2013
              • 2028

              #7
              Please tell me the processing logic of certificate[].
              How do you define it?
              What value and how do you get it?

              Comment

              • LaurisG
                Junior Member
                • Nov 2017
                • 14

                #8
                I run script on windows server:

                Code:
                $Cert = ls Cert:\LocalMachine\ -Recurse |
                    Select @{Name = '{#CERTINFO}'; Expression = {$_.FriendlyName}},
                    @{Name="{#DAYSLEFT}";Expression={($_.NotAfter).subtract([DateTime]::Now).days}}  |
                    Where { $_.'{#CERTINFO}' } |
                    Sort '{#DAYSLEFT}'
                
                write-host "{"
                write-host " `"data`":`n"
                convertto-json $cert;
                write-host "}"
                In Zabbix agent conf using User Parameters:

                Code:
                UserParameter=certificate.discovery,powershell "c:\Scripts\cert_check.ps1"
                Items prototype key is:

                Code:
                certificate[{#DAYSLEFT}]
                Trigger prototype is:

                Code:
                {Template OS Windows:certificate[{#DAYSLEFT}].last(1)}<2000
                Last edited by LaurisG; 13-12-2017, 14:18.

                Comment

                • Atsushi
                  Senior Member
                  • Aug 2013
                  • 2028

                  #9
                  Please show me logic for certificate[].
                  not certificate.discovery.

                  Comment

                  • LaurisG
                    Junior Member
                    • Nov 2017
                    • 14

                    #10
                    Sorry,

                    I don't clearly understood what did You mean processing logic of certificate[].?

                    Comment

                    • Atsushi
                      Senior Member
                      • Aug 2013
                      • 2028

                      #11
                      You wrote that you set the item prototype as follows.
                      Originally posted by LaurisG
                      certificate[{#DAYSLEFT}]
                      This is not a standard item of Zabbix, so it will not work unless you are using a UserParameter to get the value.

                      Comment

                      • LaurisG
                        Junior Member
                        • Nov 2017
                        • 14

                        #12
                        Yes, certificate isn't standard Zabbix item.

                        So I've created Discovery rule with certificate.discovery key, and this rule collects data from Agent User Params.

                        That is not proper way?

                        Comment

                        • Atsushi
                          Senior Member
                          • Aug 2013
                          • 2028

                          #13
                          You can not use LLD with certificate.discovery only.

                          LLD requires two processes.
                          1. Create items from the monitored list with discovery rules
                          2. Retrieve the value of the generated item

                          You only have the first step.

                          Check the manual again.

                          Template's rules for network interfaces and hard disks will also be helpful.

                          Comment

                          Working...