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 http://wiki.ocsinventory-ng.org. Read it before asking your question.

Plugin 2.4 creation or convertion from 2.1 [closed]

Hello everyone.

I'm installing OCS Inventory NG 2.4.1 and I'd like to migrate some custom plugin that we have on version 2.1.1.

Unfortunately I'm not able to find a guide for create a plugin 2.4 from scratch or to upgrade an old one.

Anybody has some ideas or hint?

Thank you for your help.
closed with the note: Issue solved
in OCS Inventory NG server for Unix by (1.3k points)
closed by

7 Answers

0 votes
Hi @gbist ,

Can you specify which old plugin? For an agent on Windows or Linux ?

To create a new one, I think the best method is to study a recent plugin and then get inspired...

Regards, Stéphane
by (32.6k points)
0 votes
Hi @steph78630,

It's a plugin a colleague wrote a few years ago and it's both for Windows and Linux. VBs and perl scripts are on the agent and not installed by the plugin itself; I don't understand what I have to implement on the installation script on server side, to populate the new tables that it creates and how to make it appear in the OCS interface.

I tried to get inspired by recent plugins but it doesn't work so far.

Regards,

Gabriele
by (1.3k points)
0 votes
Hi @Gabriele ,

if you wish, I can take a look at your code ; In this case contact me privately on the ask OCS forum.

Regards, Stéphane.
by (32.6k points)
0 votes
Hi @Stéphane,

thank you for your offer but maybe I've found what was wrong. Restarting apache after the installation of the plugin it fails due to:

 $s->add_config() has failed: Can't locate Apache/Ocsinventory/Plugins/IST_SoftwareUpdateTimestamps/Map.pm in @INC (you may need to install the Apache::Ocsinventory::Plugins::IST_SoftwareUpdateTimestamps::Map module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /etc/apache2 /etc/ocsinventory-server/perl) at (eval 99) line 1.\nCompilation failed in require at (eval 98) line 2.\n

[perl:error] [pid 19789] Can't load Perl module Apache::Ocsinventory::Plugins for server invsrv.ista.local:0, exiting...

But the file actually exists

ls -l /etc/ocsinventory-server/perl/Apache/Ocsinventory/Plugins/Ist_softwareupdatetimestamps/Map.pm
-rw-rw-rw- 1 www-data www-data 473 Jun 15 09:04 /etc/ocsinventory-server/perl/Apache/Ocsinventory/Plugins/Ist_softwareupdatetimestamps/Map.pm

It looks like it doesn't look into the subdirectories.

Do you have any idea of what can be wrong?

Thank you,

Gabriele
by (1.3k points)
0 votes
Hi @Gabriele ,

sorry, without the complete code of the plugin, it's difficult for me to find the problem ...
Note: The names of folders and files are case-sensitive

Stéphane
by (32.6k points)
0 votes
Hi @Stephane,

Hi Stephane, thank you for the hint, I've aligned all cases in the package and now it starts. I've also made the cd_<plugin>/cd_<plugin>.php executable so it appears in the menu (not well formatted but now it appears).

Thank you again and have a nice week.

Kind regards,

Gabriele
by (1.3k points)
0 votes
Hi Gabriele,

I'm happy to have helped you.

See you soon ...

Kind regards, Stéphane
by (32.6k points)
 
Powered by Question2Answer
...