PluginsOCSInventory-NG / vmwareVcenter

This plugin allow the unix agent to retrieve vmware servers informations using the latest REST Api.
GNU General Public License v3.0
5 stars 3 forks source link

missing date of inventory and vmware hosts names #15

Open pchamo opened 4 years ago

pchamo commented 4 years ago

I have the plugin working, thank you. I can see all the vm inventories info but it's not possible to know if the inventories are updated because the date is not registered. Should it be possible to include the date of the last inventory registered in ocs?

Additionaly, should it be possible to extract the names of the vmware hosts? I mean, vmware-vcenter is getting the VMHostId but not the VMHost.

Thank you.

msds18016 commented 4 years ago

Hello pchamo

Could you please share all the necessary steps here to deploy and configure this plugin as i am able to deploy and install this plugin only on the OCS server but i have no idea how to perform all the agent side configurations.

your prompt response is higly appreciated.

Thanks

pchamo commented 4 years ago

http://ask.ocsinventory-ng.org/11389/installation-du-plugin-vmware-vcenter-inventory

msds18016 commented 4 years ago

Hello pchamo,

Thank you for replying ,I have already followed this link that you have shared with me,By using that same set of steps i am already able to install the vmware Ocs plugin in my ocs server that is deployed on CentOS Linux release 7.3.1611 , i have also installed ocs inventory agent on the same server where i have installed my ocs server , The version i am using for ocs inventory agent is as image

I have also placed the Vmware.pm file on the following location at /usr/share/perl5/vendor_perl/Ocsinventory/Agent/Modules in the server where i have installed the ocs inventory agent as well

image

The Configurations in the vmware.pm file is also my vcenter server ip image

at the end i have also edit the modules.conf file as follwows image

But still i am unable to get any data on my dashboard image

Could you please help me with this where i am wrong as i am stuck at this part

your quick response is highly appreciated,

Thanks

pchamo commented 4 years ago

Run in a console:

tail -f /var/log/ocsinventory-agent/ocsinventory-agent.log | grep vmware

And in other console:

ocsinventory-agent --debug

If it's an credentials issue you will get:

[Tue Aug 4 19:44:01 2020][debug] [vmware] Starting VMWare inventory plugin [Tue Aug 4 19:44:02 2020][debug] [vmware] Can't auth with the sevrer https://vcenter.domain.local/

msds18016 commented 4 years ago

Hello Pchamo

I have excuted the above mentioned command but i wont be able to see any file with vmware data image The only file that got created is /var/lib/ocsinventory-agent/localhost-2020-08-02-16-08-49.ocs and in that file i am also not able to get any of the information related to Vmware not even starting of its Plugin ,are my configurations are correct as i have some what little different paths where i have placed the files as compared to the mentioned ones in the link that you have shared ???

pchamo commented 4 years ago

Try: ocsinventory-agent --debug -s ocsserver

It seems you are not sending the inventory to the ocs server.

msds18016 commented 4 years ago

again i got nothing related to vmware ,

could you specifically mention from where i can made all those necessary configurations.

pchamo commented 4 years ago

In /etc/ocsinventory/ocsinventory-agent.cfg:

# Server URL, unconmment if needed
server = ocsserver
#local = /var/lib/ocsinventory-agent

And in /etc/sysconfig/ocsinventory-agent:

# can be used to override the ocsinventory-agent.cfg setup.
OCSSERVER[0]=ocserver
# OCSSERVER[0]=local
msds18016 commented 4 years ago

I have already made the necessary configuration in these files and I am also able to get a response from these client machines as well to my OCS server, The main problem is I am unable to get the results of any plugin executed on these client machines to my OCS servers, Not only Vmware plugin but also any other plugin like uptime running process, etc, these are already installed successfully on my OCS server and I am able to get the tables as well on the dashboard but on the agent end side I have followed all the necessary configurations and steps but any of the plugin output is not populating any Table with data on the Dashboard except only the basic information that OCS provides by default, that is working perfectly fine, but not the plugins. image image

see other data is populating but not any data from plugins are populating image if the agent is not sending its inventory to the OCS server than I shouldn't get the other default information also(correct me if I am wrong)

Moreover, these are the necessary configurations for sending the agent data to server image

Moreover i am again not able to get any of the logs related to any execution of the plugins in any of the files.

pchamo commented 4 years ago

Did you follow https://wiki.ocsinventory-ng.org/10.Plugin-engine/Using-plugins-installer/?

I run:

python3 /usr/share/ocsinventory-reports/ocsreports/tools/install_plugin.py

and get:

Where is the plugins location [/usr/share/ocsinventory-reports/ocsreports/extensions/]

[0] => vmware_vcenter
[1] => winusers
[2] => checkfiles
[3] => networkshare
[4] => sharedfolders
[5] => security
[6] => uptime
[7] => officepack
[8] => bitlockerstatus
8
The server is installed on the same server ? [y]/n
y
Where is the server location [/etc/ocsinventory-server]

bitlockerstatushas been successfully installed ! Don't forget to restart your Apache server
msds18016 commented 4 years ago

No, I didn't but surely now i will follow it.

msds18016 commented 4 years ago

As per your suggestion i have also used the python script to install the plugin .as my agent and server is installed on the same machine this is how i have installed the plugin image but still i am out of luck and neither tables are populating nor the logs are printing as configured. Do you have any other workaround for this.

msds18016 commented 4 years ago

can you particularly specifiy the steps for agent side configuration as i know i need to place a file on agent server and edit the modules.conf file .is there anything that i am missing other than this because i have already done both of these things but still things didn't work out.

pchamo commented 4 years ago

what is your osversion?

msds18016 commented 4 years ago

image

pchamo commented 4 years ago

do you have windows clients? is your uptime extension working? I mean, any of your extensions are working or only vmware_vcenter?

msds18016 commented 4 years ago

yes i have added 2 clients one is windows based and other one is centos based and yes my uptime plugin is actually working for windows client only but not for Centos Client.till now i am not able to get any working plugin for cent os

pchamo commented 4 years ago

Ok, I'm trying in other ocs centos 7 server.

msds18016 commented 4 years ago

sure ,Please

pchamo commented 4 years ago

First, I got a No module named scp error. I installed it using pip3 install scp, and then: python3 /usr/share/ocsinventory-reports/ocsreports/tools/install_plugin.py Where is the plugins location [/usr/share/ocsinventory-reports/ocsreports/extensions/]

[0] => vmware_vcenter 0 The server is installed on the same server ? [y]/n

Where is the server location [/etc/ocsinventory-server]

vmware_vcenterhas been successfully installed ! Don't forget to restart your Apache server

but no luck :( I guess I'm in the same situation as you. I think I remember that this issue ocurred also in my other ocs server. At first it didn't work. I think Apache is not founding the Vmware.pm config file. I have that file in these paths:

/usr/share/ocsinventory-reports/ocsreports/extensions/vmware_vcenter/agent/Vmware.pm /usr/share/perl5/vendor_perl/Ocsinventory/Agent/Modules/Vmware.pm

The working one is the second one, but in the other server it didn't work :(

pchamo commented 4 years ago

Something to add, I installed ocs server using the tgz installer in production, and using RPM packages in test env. It should work in both but there is a possibility that installing from tgz works.

msds18016 commented 4 years ago

Hello pchamo,

I was trying to troubleshoot this issue and came to know that i am missing some dependencies ,here you can see that i am getting this error

image

do you know how to install JSON module for perl ??

pchamo commented 4 years ago

In CentOS 7, I installed the rpm package perl-JSON and perl-Mojolicious. Both contains JSON.pm. I think the first one is the one needed.

msds18016 commented 4 years ago

perfect thanks for the reply , i have used the cpan to install the JSON module and now i am able to successfully get result for VMWare Plugin.

pchamo commented 4 years ago

Good, did you notice that the vmware plugin only extracts some attributes? And there is no a date column of the inventories? I installed powershell in centos and write a few bash and powershell scripts to exctract the names of the hosts, clusters, serial numbers and date.