Testing LDAP connections

Integrating services with LDAP is a good way to keep users/authentication centralised.
The tests below will return a users information, if not you’ll have some information to go off.

Test LDAP

ldapsearch -d 5 -D "CN=BINDUSER,OU=Users,DC=example,DC=company" -s sub -b "dc=example,dc=company" -h myldapserver -p 389 -w <PASSWORD> -x "(sAMAccountName=scott.daniels)"

Test LDAPs

ldapsearch -ZZ -d 5 -D "CN=BINDUSER,OU=Users,DC=example,DC=company" -s sub -b "dc=example,dc=company" -h myldapserver -p 636 -w <PASSWORD> -x "(sAMAccountName=scott.daniels)"
Testing LDAP connections

Monitor Certificate Expiration with Sensu

Its very easy to monitor for certificate expiry using the “check_http” script. This is part of the “nagios-plugins” package.

A basic example:

    "checks": {
        "check_cert": {
            "handlers": ["default","email"],
            "command": "/usr/lib/nagios/plugins/check_http -H :::name::: -C 30,7",
            "interval": 1440,
            "subscribers": ["jenkins"]
        }
    }
}

This would check at 24hr intervals. A warning is issued when 30 days remain on the certificate. 7 days remaining will return a critical alert.

Plenty of time to get a replacement organised and installed. 🙂

Monitor Certificate Expiration with Sensu