Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agents hanging during inventory #237

Open
StCyr opened this issue Feb 8, 2022 · 1 comment
Open

Agents hanging during inventory #237

StCyr opened this issue Feb 8, 2022 · 1 comment

Comments

@StCyr
Copy link

StCyr commented Feb 8, 2022

It's hard to solve a problem when important details are missing, that why we added this template, to help you and us.

General information

Operating system : Windows Server 2016 Standard and Windows Server 2019 Standard

OCS Inventory information

Windows agent version : 2.8.0.0 and 2.9.0.0

Problem's description

Agent hangs on some machines.

Last lines in logs are:

==============================================================================
Starting OCS Inventory Agent on Tuesday, February 08, 2022 12:00:13.
AGENT => Running OCS Inventory Agent Version 2.9.0.0
AGENT => Using OCS Inventory FrameWork Version 2.9.0.0
AGENT => Loading plug-in(s)
	DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files\OCS Inventory Agent\plugins>
	DLL PLUGIN => 0 DLL Plug-in(s) successfully loaded on 0 DLL(s) found
AGENT => Using network connection with Communication Server
	COM PROVIDER => Loading Communication Provider <C:\Program Files\OCS Inventory Agent\ComHTTP.dll>
AGENT => Using Communication Provider <OCS Inventory cURL Communication Provider> Version <2.9.0.0>
AGENT => Sending Prolog
	DID_CHECK => *********redacted*************
	COM SERVER => Initializing cURL library for sendRequest
	COM SERVER => Using cURL with server authentication
	COM SERVER => Disabling cURL proxy support
	COM SERVER => Enabling cURL SSL server validation support using CA Bundle <cacert.pem>
	COM SERVER => Sending HTTP Post request to URL <*****redacted*******>
	COM SERVER => HTTP Post response received <HTTP Status Code #200>
	COM SERVER => Cleaning cURL library
AGENT => Prolog successfully sent
	AGENT => Prolog Frequency set to 10 hour(s)
	AGENT => Inventory on startup option set to  
AGENT => Inventory change forced by /NOTIFY option
AGENT => Launching hardware and software checks
	INVENTORY => Logged on user ID is <Administrator>
	INVENTORY => Operating System is <Microsoft Windows Server 2016 Standard 10.0.14393 >, description <>
	INVENTORY => Operating System uses 64 bits memory address width
	INVENTORY => Computer domain or workgroup is <***redacted***>

Looking at the code, this must be happening at:

// Get NT Domain or Workgroup
	if (!m_pSysInfo->getDomainOrWorkgroup( cs1))
		m_pLogger->log( LOG_PRIORITY_WARNING, _T( "INVENTORY => Failed to retrieve computer domain or workgroup"));
	else
		m_pLogger->log( LOG_PRIORITY_DEBUG, _T( "INVENTORY => Computer domain or workgroup is <%s>"), 
					cs1);
here, >>>	m_Device.SetDomainOrWorkgroup( cs1);
	// Get NT user Domain
here, >>>	if (!getAgentConfig()->isDefaultUserDomainRequired())
	{
here, >>>		if (!m_pSysInfo->getUserDomain(cs1, getAgentConfig()->getWmiFlagMode()))
			m_pLogger->log(LOG_PRIORITY_WARNING, _T("INVENTORY => Failed to retrieve user domain"));
		else
			m_pLogger->log(LOG_PRIORITY_DEBUG, _T("INVENTORY => User domain is <%s>"), cs1);
	}
	else
	{
or here >>>		cs1 = getAgentConfig()->getDefaultUserDomain();
		m_pLogger->log(LOG_PRIORITY_DEBUG, _T("INVENTORY => Default User domain is set to <%s>"), cs1);
	}
	m_Device.SetUserDomain( cs1);```
@StCyr
Copy link
Author

StCyr commented Feb 8, 2022

At first glance, the getAgentConfig directives should not make the agent hang and the m_Device.SetDomainOrWorkgroup is just about storing a string in a variable, so I would say that something is going wrong at line

if (!m_pSysInfo->getUserDomain(cs1, getAgentConfig()->getWmiFlagMode()))

but what?

NB: The only 3 agents exhibiting this issue all have similar purposes and have been installed by the same person, so there's probably a link to do here....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant