Anonymous_User Absent Member.
Absent Member.
498 views

How does the LDAPDirectoryLookup KS work?


Can someone tell me how the Networks-RT_LDAPDirectoryLookup KS works? It
does not have any LDAP specific parameters (service account, Base DN,
attributes). What are the endpoints for? I cannot find any detailed doc
on it except for the KS Reference Guide.

I just want to open an LDAP connection to the LDAP server and do a test
query and create events based on the responses (up/down or response
times). I have a service account to do this.

Thanks.

Steve


--
stevelee
------------------------------------------------------------------------
stevelee's Profile: https://forums.netiq.com/member.php?userid=7211
View this thread: https://forums.netiq.com/showthread.php?t=52927

0 Likes
2 Replies
Anonymous_User Absent Member.
Absent Member.

Re: How does the LDAPDirectoryLookup KS work?

stevelee,

It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.

Has your issue been resolved? If not, you might try one of the following options:

- Visit http://www.netiq.com/support and search the knowledgebase and/or check all
the other support options available.
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://forums.netiq.com)

Be sure to read the forum FAQ about what to expect in the way of responses:
http://forums.netiq.com/faq.php

If this is a reply to a duplicate posting, please ignore and accept our apologies
and rest assured we will issue a stern reprimand to our posting bot.

Good luck!

Your NetIQ Forums Team
http://forums.netiq.com


0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: How does the LDAPDirectoryLookup KS work?


I talked to one of our pre-sales engineers. This KS only emulates LDAP
traffic since it is part of the Networks-RT category. I was supplied
with an unsupported one, "LDAP_ConnectionTest.qml", but it always
returns an error, "424:Object required", which seems to be a VBS error,
but I'm not sure. I can get the same config to work in NetIQ Operations
Center. Here's the script. We are running AppManager 8.0.3.

<PROLOGUE>
<![CDATA[

]]>
</PROLOGUE>


<KSID>
<Type>Regular</Type>
<Name>LDAP_ConnectionTest</Name>
<Version>
<AppManID>6.5</AppManID>
<KSVerID>1.0</KSVerID>
</Version>
<NeedPWD>0</NeedPWD>
<AdminOnly>0</AdminOnly>
<UnixOnly>0</UnixOnly>
<DataSrcID>0</DataSrcID>
<Platform>-1</Platform>
<OptionExplicit>0</OptionExplicit>
</KSID>

<ObjType fullpath="0" dropfolderlist="0" styleversion="3">
<Type name="NT_MachineFolder"></Type>
</ObjType>

<Schedule>
<Default type="runonce" runmode="sched"></Default>
<Allowed>
<RunOnce>1</RunOnce>
<IntervalIter>1</IntervalIter>
<Daily>1</Daily>
<Weekly>1</Weekly>
<Monthly>1</Monthly>
</Allowed>
</Schedule>

<DataSrc></DataSrc>

<Parameter>
<Param name="PRM_USER_DN">
<Desc>User DN</Desc>
<Value>CN=mvishvesh,ou=ENG,ou=BLR,ou=INDIA,o=Novell</Value>
<ReqInput>0</ReqInput>
<Folder>0</Folder>
<NoQuote>0</NoQuote>
</Param>
<Param name="PRM_USER_PASSWORD">
<Desc>User Password</Desc>
<Delim></Delim>
<Range></Range>
<Unit></Unit>
<Value></Value>
<ReqInput>0</ReqInput>
<I_Type></I_Type>
<Parent></Parent>
<Folder>0</Folder>
<NoQuote>0</NoQuote>
<OldParameter></OldParameter>
</Param>
<Param name="PRM_LDAP_SERVER">
<Desc>LDAP Server</Desc>
<Value>blr-dsmaster1.blr.novell.com</Value>
<ReqInput>0</ReqInput>
<Folder>0</Folder>
<NoQuote>0</NoQuote>
</Param>
<Param name="PRM_DN_LDAP_SERVER">
<Desc>LDAP Server DN</Desc>
<Value>ou=ENG,ou=BLR,ou=INDIA,o=Novell</Value>
<ReqInput>0</ReqInput>
<Folder>0</Folder>
<NoQuote>0</NoQuote>
</Param>
<Param name="PRM_OBJECT">
<Desc>Object class and name in LDAP format</Desc>
<Value>objectClass=inetorgPerson</Value>
<ReqInput>0</ReqInput>
<Folder>0</Folder>
<NoQuote>0</NoQuote>
</Param>
<Param name="PRM_OBJ_PROPS">
<Desc>Object Properties To Fetch</Desc>
<Value>fullName,employeeID,title</Value>
<ReqInput>0</ReqInput>
<Folder>0</Folder>
<NoQuote>0</NoQuote>
</Param>
</Parameter>

<ActionDef></ActionDef>

<AdvanceConfig></AdvanceConfig>

<ScriptDef>
<Script language="VBScript">
<![CDATA[Function CreateEvent(evtMsg, evtDetail)
NQExt.CreateEvent 15, evtMsg, "AKP_NULL", NT_MachineFolder, 0,
evtDetail, "", 1, 0, 0
End Function

Function CreateEvent2(evtMsg)
CreateEvent evtMsg, ""
End Function


Sub Main


'Option Explicit
On Error Resume Next

'ADO Constants
Const adOpenStatic = 3
Const adLockOptimistic = 3
'The value below required for the connection string to read a text file
Const adCmdText = &H0001
Const objectExists = - 2147019886
Const failToOpenObject = - 2147016646
Const InvalidUseOfNull = 94

Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider", PRM_USER_DN,
PRM_USER_PASSWORD
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
"<LDAP://" & PRM_LDAP_SERVER & "/" & PRM_DN_LDAP_SERVER & ">;" & _
"(&(" & PRM_OBJECT & "));" & _
PRM_OBJ_PROPS & ";subtree"

Set objRecordSet = objCommand.Execute

If objRecordset.EOF Then
CreateEvent "We could not get properties, LDAP is dead!!!",
Err.Number & ":" & Err.Description
Else
' cscript.Echo "Users exist:"
'Dim recordset : recordset = objRecordSet.getString

props = split(PRM_OBJ_PROPS, ",")
props_no = ubound(props)

event_detail = ""
prop_index = 0

For Each prop In props
event_detail = event_detail & prop & ","
Next

event_detail = Left(event_detail, len(event_detail) - 1)
event_detail = event_detail & vbNewline


While Not objRecordset.EOF
prop_index = 0
For Each prop In props

If IsNull(objRecordSet.Fields(prop)) = False And
IsEmpty(objRecordSet.Fields(prop)) = False And _
IsNull(objRecordSet.Fields(prop).Value) = False And
IsEmpty(objRecordSet.Fields(prop).Value) = False Then
value = objRecordSet.Fields(prop).Value
If isarray(value) = False then
event_detail = event_detail & cstr(value)
Elseif VarType(value) = 8204 Then
If ubound(value) > 0 Then
For i = 1 To ubound(value)
event_detail = event_detail & cstr(value(i))
Next
Elseif len(value(0)) > 0 Then
event_detail = event_detail & cstr(value(0))
End If
End If
End If
If prop_index < props_no Then
event_detail = event_detail & ","
End If
prop_index = prop_index + 1
Next

event_detail = event_detail & vbNewline
objRecordset.MoveNext
Wend

CreateEvent "We could get the properties.. LDAP is alive",
event_detail
NQExt.QTrace event_detail

End If

objConnection.Close
End Sub
]]>
</Script>
</ScriptDef>


--
stevelee
------------------------------------------------------------------------
stevelee's Profile: https://forums.netiq.com/member.php?userid=7211
View this thread: https://forums.netiq.com/showthread.php?t=52927

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.