After upgrade 20.04 to 22.04 all services UPTIME are an errors “Unknown option: warning at /usr/lib/centreon/plugins/centreon_linux_snmp.pl line 141.” whatever linux or Windows
If Linux uptime serviceError in /var/log/centreon-engine/centengine.log
[2022-09-16T09:33:00.717+02:00] [events] [info]  INITIAL SERVICE STATE: **********;Uptime;UNKNOWN;SOFT;1;Unknown option: warning at /usr/lib/centreon/plugins/centreon_linux_snmp.pl line 141.
or if windows uptime service :
Unknown option: warning at /usr/lib/centreon/plugins/centreon_windows_snmp.pl line 141.
I have update the plugin pack “Plugin Packs Manager”
Best answer by gespadaView original
What’s your OS and distribution? If the Pack are up to date and plugin as well, you should not get this error.
Please mention also Pack and Plugins version it will help.
I’m on Linux Centos 7,
Centreon Plugin Packs Manager
It’s strange because it's only for the service UPTIME.
On this exemple i execute on the same host :
[************ ~]$ sudo /usr/lib/centreon/plugins/centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=load --hostname=********* --snmp-version='2c' --snmp-community='*****' --warning='' --critical=''
OK: Load average: 2.24, 1.60, 1.07 | 'load1'=2.24;;;0; 'load5'=1.60;;;0; 'load15'=1.07;;;0;
[************ ~]$ sudo /usr/lib/centreon/plugins/centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=uptime --hostname=********** --snmp-version='2c' --snmp-community='*****' --warning='' --critical=''
Unknown option: warning at /usr/lib/centreon/plugins/centreon_linux_snmp.pl line 141.
Your command not working since 2020.
You could see on this commit --warning and --critical was replaced by --warning-uptime and --critical-uptime
I think after the upgrade we updated the Centreon Plugins and Plugin Pack and you lost the macro.
You used the official Host template and service templates (Aka Plugin Pack Linux SNMP) ? Or a custom made by you ?
Ok i understand.
If i test whith the new argument it’s now ok :
sudo /usr/lib/centreon/plugins/centreon_linux_snmp.pl --plugin=os::linux::snmp::plugin --mode=uptime --hostname=*********** --snmp-version='2c' --snmp-community='******' --warning-uptime='' --critical-uptime=''
OK: System uptime is: 133d 2h 43m 57s | 'uptime'=11501037s;;;0;
It’s a custom template
But I can't apply this argument change in the associated service template.
If i change by warning-uptime and critical-uptime, it’s not OK. And the personnalised macro is in white.
How do I make this control "Inherited from command"?
Could you change the template to an another, just to produce a change on the service template (more specifically the macros list), and change an another time to the old value (OS-Linux-Uptime-SNMP) you could see the right color who indicate the inheritence of the command who is updated ? The old macro WARNING and CRITICAL could be in white whitout no heritence.
Maybe the update process works better when you inherit the -custom Host template on your template. Not directly the -custom on the service template
The Idea is to inherit the Host Template from the -custom template. Like that you could benefit the change made by Centreon without loosing a functionnality. And it's Centreon who manage the update process like that. If you set a value like on your service template WARNING, CRITICAL you do switch value from the old macro to the new macro.
Other thing, you do use the centreon-engine linux account to execute plugins, because you could have right problem when centengine schedule and execute itself the plugins with the centreon-engine linux account.
Maybe a Centreonian could write a post to use the plugin pack and benefits the update process without too inconvenients.
It’s now OK, thanks all