glpi-project / glpi-agent

GLPI Agent
GNU General Public License v2.0
240 stars 60 forks source link

GLPI agent doesn't scan db istances #543

Closed rshehuico closed 9 months ago

rshehuico commented 10 months ago

Bug reporting acknowledgment

Yes, I read it

Professional support

I still have but want a public following to keep the community aware

Describe the bug

The agent works correctly on every aspect in every server on my company datacenter, but on this particular server the databases are not being scanned. I tried to scan manually, also using the option --debug --partial database, but nothing changed. Also the log files are ok, no error showed up.

To reproduce

glpi-inventory.bat --debug --partial database

Expected behavior

C:\Program Files\GLPI-Agent>glpi-inventory.bat --debug --partial database [info] New partial inventory from xxxxxxxxxx-2023-11-29-10-59-12 for local0 [debug] Running GLPI::Agent::Task::Inventory::Generic [debug] Running GLPI::Agent::Task::Inventory::Generic::Databases [debug] Running GLPI::Agent::Task::Inventory::Generic::Databases::MSSQL [debug] Running GLPI::Agent::Task::Inventory::Win32 [debug] Running GLPI::Agent::Task::Inventory::Win32::Bios [debug] Running GLPI::Agent::Task::Inventory::Win32::Hardware [debug] Running GLPI::Agent::Task::Inventory::Vmsystem [debug] Running GLPI::Agent::Task::Inventory::Win32::Chassis { "action": "inventory", "content": { "bios": {

  },

<- here I expect the db infos -> "hardware": {

  },
  "versionclient": "GLPI-Inventory_v1.4"

}, "deviceid": "xxxxxx", "itemtype": "Computer", "partial": true }

Operating system

Windows

GLPI Agent version

1.4

GLPI version

10.0.10

GLPIInventory plugin or FusionInventory for GLPI plugin version

No response

Additional context

No response

g-bougard commented 10 months ago

Hi @rshehuico

this probably means the agent doesn't discovery how to access the MSSQL database on this computer.

Have you disabled default administrative access on it or replace/update it ?

What MSSQL version are you using ? Maybe it is not supported at that time.

Anyway, please, upgrade the agent on this computer and test again. The latest version is 1.6.1 released few weeks ago. 1.4 was release more than a year ago and I see in Changes there was a least a fix in 1.5 regarding MSSQL support.

rshehuico commented 10 months ago

Hi @g-bougard, I updated the agent but no changes. MSSQL is 2016 version, but I'm running it on other servers and no problem in the others. I didn't disable default admin access.

g-bougard commented 10 months ago

Have you some result when running the following commands in an administrative console:

sqlcmd -l5 -X1 -t 30 -K ReadOnly -r1 -W -h -1 -s ";" -Q "SELECT SERVERPROPERTY('productversion')"
sqlcmd -l5 -X1 -t 30 -K ReadOnly -r1 -W -h -1 -s ";" -Q "SELECT @@servicename"
sqlcmd -l5 -X1 -t 30 -K ReadOnly -r1 -W -h -1 -s ";" -Q "SELECT @@version"
sqlcmd -l5 -X1 -t 30 -K ReadOnly -r1 -W -h -1 -s ";" -Q "SELECT name,create_date,state FROM sys.databases"
rshehuico commented 10 months ago

HI @g-bougard,

I can't execute those cmds, I'm working on it. I'll report when I can resolve the issue, but probably once the sqlcmd will be working, the problem will be fixed.

Thanks

g-bougard commented 9 months ago

@rshehuico If you can't run those commands, I suppose you had a problem with the database installation and this explains why the agent can't make db inventory on this computer. I'm closing the issue, but feel free to reopen if you figure out the agent should be able anyway to run db inventory. I'll then expect you to explain what should be updated. You can also comment what was wrong in your installation and how you have been able to fix it to help any other people facing the same problem.

lexcyr commented 6 months ago

Hello @rshehuico ,

"Have you solved your issue with the database?"

rshehuico commented 6 months ago

Hello @rshehuico ,

"Have you solved your issue with the database?"

No, sorry, didn't have the time to look at it yet. I'll update this issue when I will work on it