Strange line in my INI config file

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Strange line in my INI config file

Postby Ponashish » Mon Feb 17, 2020 6:35 am

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
Ponashish
 
Posts: 6
Joined: Mon Feb 10, 2020 3:38 am

Re: Strange line in my INI config file

Postby mcapra » Mon Feb 17, 2020 8:18 am

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
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3601
Joined: Thu May 05, 2016 3:54 pm

Re: Strange line in my INI config file

Postby scottwilkerson » Mon Feb 17, 2020 10:47 am

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/master/modules/CheckExternalScripts/CheckExternalScripts.cpp#L118
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 19093
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Community Support

Who is online

Users browsing this forum: Google [Bot], nosajche and 21 guests