Strange line in my INI config file

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Ponashish
Posts: 6
Joined: Mon Feb 10, 2020 3:38 am

Strange line in my INI config file

Post by Ponashish »

Hi all,
These days I set up a Nagios server and I still monitoring some servers.
In each ini file, I founded this line and I'm pretty sure that nobody have added that lines:

; Script wrappings - A list of templates for defining script commands. Enter any command line here and they will be expanded by scripts placed under the wrapped scripts section. %SCRIPT% will be replaced by the actual script an %ARGS% will be replaced by any given arguments.
[/settings/external scripts/wrappings]

; Batch file - Command used for executing wrapped batch files
bat = scripts\\%SCRIPT% %ARGS%

; POWERSHELL WRAPPING - Command line used for executing wrapped ps1 (powershell) scripts
ps1 = cmd /c echo If (-Not (Test-Path "scripts\%SCRIPT%") ) { Write-Host "UNKNOWN: Script `"%SCRIPT%`" not found."; exit(3) }; scripts\%SCRIPT% $ARGS$; exit($lastexitcode) | powershell.exe /noprofile -command -

; Visual basic script - Command line used for wrapped vbs scripts
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%

What has happened?
Thanks
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Strange line in my INI config file

Post by mcapra »

Here's the official NSClient++ documentation on wrapped scripts:
https://docs.nsclient.org/howto/externa ... ed-scripts

The ps1 wrapper is the only "complex" one; It's checking to see if the script exists, printing an error if the script doesn't exist, else running the script and preserving the exit code.

I can't say how they got there, but these lines of config are pretty benign if you're not using external scripts.
Former Nagios employee
https://www.mcapra.com/
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Strange line in my INI config file

Post by scottwilkerson »

I agree with mcapra

In addition, it looks like this code is part of the NSClient++ package, so they may be defaults (NSClient++ is NOT Nagios Enterprises software)
https://github.com/mickem/nscp/blob/mas ... s.cpp#L118
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked