Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

How to check if the plugin works? [OCS 2.6]

Hello guys!

Because of a problem with plugins installation I had to change the letter size of directory and file names. After that the installation was successful and apache restart correctly. But I dont know how to check if the plugin works - I've never seen any :-P Where i should see results?

For example: https://github.com/PluginsOCSInventory-NG/officepack/releases

1. In Webconsole --> Deployment --> Build. I added here zip file with vbs script --> Execute and msofficekey.vbs in command field. After send it I tried automatic activate but:

GROUP OF REDISTRIBUTION NOT EXIST

OK than... Inventory --> Groups --> REDISTRIBUTION GROUP --> but i havent any Add button here. I can only create new static group.

2. I tried activate it manual - there is link: http://ocs.mydomain/download/1576224576 but when I tray to get there:

The requested URL was not found on this server.

3. Third attempt - i used OcsPackager.exe and include plugins - zip with vbs and vbs directly. I installed the agent on a workstation - in Plugin folder i see zip, and i see vbs... but what now? No results anywhere.

Operating system
    OS Name: Linux x86_64
    Version: 4.15.0-72-generic
    Distribution: Ubuntu 18.04.3 LTS

Software
    PHP Version: 7.2.24
    Web Server: Apache/2.4.29 (Ubuntu)
    Database Server: (Ubuntu) version 5.7.28-0ubuntu0.18.04.4
    Version OCSReports: 2.6

Perl version: v5.26.1

in OCS Inventory NG server for Unix by (810 points)

13 Answers

0 votes

I don't understand this. I installed it many times - restarting server and web console and nothing. Always when I click "Install" in "Extensions manager" I have a white screen (without plugins list - only button "Install" with plugin name. Today in this moment I tried logout from webconsole and log again and... now I see plugins options. Without data (only processing status) but it's always a step forward :)

Edit - however, it is not so good - some install and some do not. For example - Scheduled Tasks. I have it on list to install but when i click "install button" nothing happens.

And second problem - with plugins, workstations stopped reporting on the server. If plugin folder is empty than:
AGENT => Sending Prolog
AGENT => Prolog successfully sent

AGENT => Inventory required
AGENT => Launching hardware and software checks
AGENT => Sending Inventory
INVENTORY => No change since last inventory
AGENT => Inventory successfully sent

When i put vbs to Plugin folder manually:

AGENT => Sending Prolog
AGENT => Prolog successfully sent
AGENT => Inventory required
AGENT => Launching hardware and software checks
AGENT => Sending Inventory
INVENTORY => No change since last inventory
ERROR *** AGENT => Failed to send Inventory <HTTP Status Code #500>

by (810 points)
edited by
0 votes

The plugins info results are shown clicking e.g. on the miscelaneous, configuration or software tabs of each computer (it depends on the plugin). I don't use OcsPackager.exe but a GPO to copy the .vbs files.

by (4.6k points)
0 votes

pchamorro thank you for your answer. 

You wrote that you use GPO - can it make any difference in this situation? I updated my last post. I put vbs script manualy into plugin folder and I get HTTP 500 error.

Mysql error.log - no association with agent communication time, but an error occurs.

2019-12-15T07:29:54.190417Z 3990 [Note] Access denied for user 'ocs'@'localhost' (using password: YES)

Don't know why. This is my configuration:

/usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php
define("COMPTE_BASE","ocsuser");
define("PSWD_BASE","password");

/etc/apache2/conf-available/z-ocsinventory-server.conf
  PerlSetEnv OCS_DB_USER ocsuser
  PerlSetVar OCS_DB_PWD password

/etc/apache2/conf-available/zz-ocsinventory-restapi.conf
  $ENV{OCS_DB_USER} = 'ocsuser';
  $ENV{OCS_DB_PWD} = 'password';

apache2 acces.log 
10.0.4.111 - - [15/Dec/2019:08:34:45 +0100] "POST /ocsinventory HTTP/1.1" 500 3203 "-" "OCS-NG_WINDOWS_AGENT_v2.6.0.0"

apache2 error.log
Nothing interesting. I have here one error but for another machine I'm testing:
 

[Sun Dec 15 08:15:46.406792 2019] [php7:warn] [pid 28909] [client 10.0.2.209:57842] PHP Warning:  mysqli_fetch_object() expects parameter 1 to be mysqli_result, boolean given in /usr/share/ocsinventory-reports/ocsreports/extensions/Officepack-3.0/ms_officepack/ms_officepack.php on line 30, referer: https://ocs.mydomain/ocsreports/index.php?function=ms_officepack

[Sun Dec 15 08:16:47.484635 2019] [php7:warn] [pid 29048] [client 10.0.2.209:57848] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /usr/share/ocsinventory-reports/ocsreports/plugins/main_sections/ms_computer/ms_computer_views.php on line 132, referer: https://ocs.mydomain/ocsreports/index.php?function=visu_computers

if I run the script manually at the workstation - it returns the result.

by (810 points)
edited by
0 votes

You have to solve first the Access denied for user 'ocs'@'localhost'  issue. It seems the password is wrong.

by (4.6k points)
0 votes
But where? I know about three files where I can set it. And all these files have the correct password. But... let's leave the password for a while - he asks for the user ocs - I don't have it anywhere.

Edit.
Agent have ocsinventory.ini file with User= and Pwd=. I didn't set it at the moment - should I use the database pass? No errors in agent logs at the moment (but i haven't plugins).
by (810 points)
edited by
+1 vote
Hi,

I was getting this same error in the officepack (extension) plugin.

I verified that the officepack table had been partially created.

In the plugin installation file there is an SQL folder with this content:
-- Nicolas DEROUET
-- 29/08/2012
-- officepack

-- officepack version 2.1.x (create)
CREATE TABLE IF NOT EXISTS `officepack` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `HARDWARE_ID` int(11) NOT NULL,
  `OFFICEVERSION` varchar(255) DEFAULT NULL,
  `PRODUCT` varchar(255) DEFAULT NULL,
  `PRODUCTID` varchar(255) DEFAULT NULL,
  `TYPE` int(11) DEFAULT NULL,
  `OFFICEKEY` varchar(255) DEFAULT NULL,
  `NOTE` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`,`HARDWARE_ID`)
)  ENGINE=INNODB ;

-- officepack version 2.2.x (update)
ALTER TABLE `officepack` ADD COLUMN `GUID` varchar(255) DEFAULT NULL AFTER `OFFICEKEY`;
ALTER TABLE `officepack` ADD COLUMN `INSTALL` int(11) DEFAULT NULL AFTER `GUID`;

The last fields were not created in my case, I ran two commands in the MySQL console and stopped giving error 500:

ALTER TABLE `officepack` ADD COLUMN `GUID` varchar(255) DEFAULT NULL AFTER `OFFICEKEY`;
ALTER TABLE `officepack` ADD COLUMN `INSTALL` int(11) DEFAULT NULL AFTER `GUID`;
by (240 points)
0 votes

The user ocs should have all privileges for localhost, could you check that? (e.g. from command line (mysql -u ocs -p ocsweb and then show grants;) or using phpmyadmin?

mysql> show grants;

| GRANT ALL PRIVILEGES ON *.* TO 'ocs'@'localhost' |

mysql -u ocs -p should work.

by (4.6k points)
0 votes

I apologize for my silence but I had to leave it for a few days. I installed new server.

@ pchamorro
I can log as 'ocsuser' - I'm using this account, not 'ocs'. I don't know why in logs is 'ocs' user.
+------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'ocsuser'@'localhost' IDENTIFIED BY PASSWORD '*45CEED36B3D8B85A439385AD' |
| GRANT ALL PRIVILEGES ON `ocs`.* TO 'ocsuser'@'localhost' WITH GRANT OPTION                                     |
+------------------------------------------------------------------------------------------------------------------+


@  rmikeda

I have officekey-3.0 but I tried to do what you wrote and... IT WORKS! OK... it works in half Agent send logs and I see the entry on the webconsole in Office Key Manager. But when I try to view the details (column number) I have denied access.


Now I tray with uptime-2.0. And... the same problem
I need to manually create the tables for all plugins?
How do I know what to create?
Why no one wrote on the plugins documentation that there are such installation requirements? Or I missed it?
Or I install the plugins incorrectly?
 
By the way... sorry for my English. It's bad, but I see you get the point what I mean :-D
And Merry Christmas! :-D

by (810 points)
0 votes

You don't need to manually create plugins tables. The tables are created when you install the plugins. I use phpMyAdmin as a help to confirm that the tables are created. Once you have the plugins files downloaded and extracted you just need to run a command like this:

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

and choose the plugin to install.

by (4.6k points)
edited by
0 votes
Thanks pchamorro but as you can see it doesn't work for me. I'm using this command to install. Maybe some error with permissions to folders? Or MySQL?
I thought I was doing everything according to the documentation :/
by (810 points)
 
Powered by Question2Answer
...