refactor for only support LDAP and be compatible with nagios with Apache