Skip to main content

Hello everyone  I have centreon version 24.04.1 and two different paths for plugins, /usr/lib/centreon/plugins and /usr/lib64/nagios/plugins/ however the nagios one is empty(only has about 4 main  plugins) as for the first one i git cloned the repo for plugins in it, my machine has restrcited internet access and when I try to run some command to see if the plugins work, such as 

perl /usr/lib/centreon/plugins/centreon-plugins/centreon_plugins.pl	--plugin=apps::vrops::rest::plugin	--mode=alertsId	--username='xxx'	--password=***	--hostname='xxxxxxxx'	--VMId='xxxx'

any perl command doesnt work anyway its not just that, even the normal one to check for list of plugins or to grep something from the .pl file

I get the following error: Can't locate centreon/plugins/script.pm in @INC (you may need to install the centreon::plugins::script module)

And I have no clue why?

👋@xorya 

If you are using IT-100 you have the automatic installation with https://docs.centreon.com/pp/integrations/plugin-packs/getting-started/how-to-guides/connectors-licenses/#automatic-plugin-installation. Regarding the repo, where are you cloning the repo to?  I see it (centreon_plugins.pl) under “centreon-plugins/src/” 


I don’t think the plugins in the repo are in a state where they can be used as is. You should install them in a more conventional method, like ​@ponchoh suggested.


 


@ponchoh I’ve cloned the repo in “/usr/lib/centreon/plugins/centron-plugins” the centron-plugins is the repo i cloned, i cant use the online thing i have more than 100 hosts and they want something for free 


@xorya, do you see “centreon_plugins.pl” under “/usr/lib/centreon/plugins/centron-plugins”.. curious who is they?


just to try, on a basic linux (ubuntu) I did a “git clone https://github.com/centreon/centreon-plugins.git“ in a random folder

then I installed a missing perl module  “apt install libjson-xs-perl libwww-perl”

then I ran, from the folder I was in :

centreon-plugins/src/centreon_plugins.pl --plugin=apps::protocols::http::plugin --mode=response --hostname=www.google.com --proto='https' --port='443' --urlpath='/' --warning-time='5' --critical-time='10' --change-short-output=':'~': www.google.com'

 

this show that simply cloning the git works, there are no need for additionnal centreon packages

(this was in a new wsl machine that I just spawned just now on my windows machine and the plugin works)

 

if you can clone the git plugin on a machine and copy it on that “limited internet access” machine, you WILL need to copy also some basic perl packages for the plugin src to function, no idead what packages are needed, as they usually comes with the packages from the linux repository (apt install, or yum install), so you would need to analyse the dependencies of the package you want to install from a machine that has access to internet, then download these package for offline installation then port them on the centreon machine.

 

you can also copy that src folder ANYWHERE on the poller but when I develop my own plugin I tend to put them in subfolder of 

/usr/lib/centreon/plugins/

that folder has the advantage of being preconfigured as a macro : $CENTREONPLUGINS$

the other folder ,  /usr/lib64/nagios/plugins/  ( macro $USER1$ )you can ignore it, it contains some legacy binaries like “check_icmp” and you should not use that to put your plugins.

 

The place where the centreon_plugins.pl is located should have all these folders, and @INC will look in them to find what it needs

the “src” folder from the git is a recent (last year) modification, before the centreon_plugin.pl was at the root of the git repo, now it is in the src folder, and it is that folder that you really need to run the commands manually

be sure to not have an bad repo, or an old copy that was lying around in your folder

lastly, no idea what that example you gave in your first post is : apps::vrops…. this is not a plugin from the centreon plugin Git, is this a custom / internal development?


@christophe.niel-ACT 

😍😍😍😍😍


Reply