mickem / nscp

NSClient++
http://nsclient.org
GNU General Public License v2.0
244 stars 94 forks source link

schedules from "/includes" files detects commands as "Unknown" or "". #636

Open wcs-bjogus opened 5 years ago

wcs-bjogus commented 5 years ago

Issue and Steps to Reproduce

Install latest nscp on centos 7 (Latest el7 build is 0.5.2.33)

Create a subfolder in /etc/nsclient/ ex ini In /etc/nsclient/ini create new ini file: Sample:

[/settings/scheduler/schedules]
test_swap=alias_swap2
test_swap2=check_swap

[/settings/external scripts/scripts]
check_swap=/usr/lib64/nagios/plugins/check_swap -w 20 -c 10

[/settings/external scripts/alias]
alias_swap2=check_swap

Define your nsclient.ini file so we include the /etc/nsclient/ini/ folder: [/includes] otherfiles=/etc/nsclient/ini/

Start NSCP:

nscp test --settings nsclient.ini
D   schedule Adding scheduled item: test_swap[1271584696] = {tpl: {alias: test_swap, path: /settings/scheduler/schedules/test_swap, is_tpl: false, parent: default, value: , options : { } }, command:, channel: NSCA, source_id: , target_id: , duration: 60s, 0% randomness}
D   schedule Adding scheduled item: test_Swap2[1271584696] = {tpl: {alias: test_Swap2, path: /settings/scheduler/schedules/test_Swap2, is_tpl: false, parent: default, value: , options : { } }, command: , channel: NSCA, source_id: , target_id: , duration: 60s, 0% randomness}

Expected Behavior

The Scheduler should find the defined commands from the other ini file.

Actual Behavior

The Scheduler creates a schedule but dose not define any command.

Details

Additional Details

NSClient++ log:

D   settings Activating: nsclient.ini
D   settings Creating instance for: ://nsclient.ini
D   settings Loading: nsclient.ini
D   settings Creating instance for: :///etc/nsclient/ini/
D   settings Creating instance for: ini:////etc/nsclient/ini/checks.ini
D   settings Loading: //etc/nsclient/ini/checks.ini
D       core Booted settings subsystem...
D       core booting::loading plugins
D       core Found: CheckExternalScripts
D       core Found: CheckHelpers
D       core Found: CheckNet
D       core Found: Scheduler
D       core lib/usr/lib/nsclient/modules/libCheckExternalScripts.so.so
D       core adding /usr/lib/nsclient/modules/libCheckExternalScripts.so
D       core lib/usr/lib/nsclient/modules/libCheckHelpers.so.so
D       core adding /usr/lib/nsclient/modules/libCheckHelpers.so
D       core lib/usr/lib/nsclient/modules/libCheckNet.so.so
D       core adding /usr/lib/nsclient/modules/libCheckNet.so
D       core lib/usr/lib/nsclient/modules/libScheduler.so.so
D       core adding /usr/lib/nsclient/modules/libScheduler.so
D       core Loading plugin: CheckExternalScripts
D       core Loading plugin: CheckHelpers
D       core Loading plugin: CheckNet
D       core Loading plugin: Scheduler
D   schedule Adding scheduled item: uptime[-109398088] = {tpl: {alias: uptime, path: /settings/scheduler/schedules/uptime, is_tpl: false, parent: default, value: check_uptime, options : { } }, command: check_uptime, channel: NSCA, source_id: , target_id: , duration: 60s, 0% randomness}
D   schedule Adding scheduled item: test_swap[-109398088] = {tpl: {alias: test_swap, path: /settings/scheduler/schedules/test_swap, is_tpl: false, parent: default, value: , options : { } }, command: , channel: NSCA, source_id: , target_id: , duration: 60s, 0% randomness}
D   schedule Adding scheduled item: test_Swap2[-109398088] = {tpl: {alias: test_Swap2, path: /settings/scheduler/schedules/test_Swap2, is_tpl: false, parent: default, value: , options : { } }, command: , channel: NSCA, source_id: , target_id: , duration: 60s, 0% randomness}
wcs-bjogus commented 4 years ago

Any news regarding this issue?