func Do() {
	ckr := run(os.Args[1:])
	ckr.Name = "LDAP"
	ckr.Exit()
}
Do the plugin
package checkldap
import (
	"fmt"
	"net"
	"os"
	"time"
	"github.com/go-ldap/ldap/v3"
	"github.com/jessevdk/go-flags"
	"github.com/mackerelio/checkers"
)
type checkLDAPOpts struct {
	Warning   float64 `short:"w" long:"warning" description:"Response time to result in warning status (seconds)" required:"true"`
	Critical  float64 `short:"c" long:"critical" descriptin:"Response time to result in critical status (seconds)" required:"true"`
	Host      string  `short:"H" long:"host" default:"localhost" description:"Hostname"`
	Port      string  `short:"p" long:"port" default:"389" description:"Port number"`
	Base      string  `short:"b" long:"base" description:"LDAP base" required:"true"`
	Attribute string  `short:"a" long:"attr" default:"(objectclass=*)" description:"LDAP attribute to search"`
	BindDN    string  `short:"D" long:"bind" description:"LDAP bind DN"`
	Password  string  `short:"P" long:"password" description:"LDAP password"`
}