Add new script to NSClient++ for Nagios

I created a function to add a new script to NSClient++ for Nagios on a local or remote computer. It copies your script to Script directory and creates a new entry in nsc.ini under [Wrapped Scripts].

https://github.com/amnich/Add-NscWrappedScript/blob/master/Add-NscWrappedScript.ps1

Example:

PS > Add-NscWrappedScript -ComputerName "PC1", "PC2" -PathToScript C:temptest.ps1 -CommandLine check_test=test.ps1 -BackupIniFile -Verbose VERBOSE: Running remote on PC1 VERBOSE: Folders found 1 VERBOSE: Script test.ps1 saved in C:Program FilesNSClient++scripts VERBOSE: NSC ini file backed up as C:Program FilesNSClient++nsc_20170519_2220.ini VERBOSE: New command inserted check_test=test.ps1 VERBOSE: Running remote on PC2 VERBOSE: Folders found 1 VERBOSE: Script test.ps1 saved in C:Program FilesNSClient++scripts VERBOSE: NSC ini file backed up as C:Program FilesNSClient++nsc_20170519_2220.ini VERBOSE: New command inserted check_test=test.ps1 

submitted by /u/amnich
[link] [comments]

Leave a Reply