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.9.1 available

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

New Plugin/Extension

Hello,
I made a new plugin, this is not an easy way, there is not so much documentation and I did'nt use perl and php from a long long time :)
but with exemple plugins and inspirited by some others, I think I'm close.
Agent get data, sent to server and I can see them in Miscellaneous tab: Great!
But, because there is always a but! I have 2 fields in database with an ARRAY value instead of string value, and no idea why.

here is what I have in agent log:

    <CVESCAN>
      <CVE_ID>CVE-2021-26937</CVE_ID>
      <FIXED_VERSION>4.8.0-1ubuntu0.1</FIXED_VERSION>
      <PACKAGE>screen</PACKAGE>
      <PRIORITY>medium</PRIORITY>
      <REPOSITORY>Ubuntu Archive</REPOSITORY>
    </CVESCAN>

and what I have in DB:

HARDWARE_IDCVE_ID       PRIORITYPACKAGE             FIXED_VERSION                  REPOSITORY          
1CVE-2021-26937medium ARRAY(0x55626ae70688)4.8.0-1ubuntu0.1ARRAY(0x55626ae706e8)

and the map file:
$DATA_MAP{cvescan} = {
    mask => 0,
    multi => 1,
    auto => 1,
    delOnReplace => 1,
    sortBy => 'ID',
    writeDiff => 0,
    cache => 0,
    fields => {
         CVE_ID => {},
         PRIORITY => {},
         PACKAGE => {},
         FIXED_VERSION => {},
         REPOSITORY => {},
    }
};

if someone have an idea!

the aims of this plugin is getting cve info with the Canonical tool and send the result in ocs, of course when the plugin will be functional, I will share it.

thanks for your help
Eric

 

in OCS Inventory NG plugins by (160 points)

1 Answer

0 votes
so I don't know why but I renamed field PACKAGE and REPOSITORY and it is working, possible naming conflict? so I prefixed all column with CVE_ and it is ok.

if someone is interested, it is working with Ubuntu, I don't know if it is working with other Linux Distribution, I will make some test later if I have time

any suggestions or corrections are welcome!

https://github.com/emeygret/ocs-cvescan
by (160 points)
 
Powered by Question2Answer
...