Passing Powershell script args to Nagios XI
Posted: Fri Nov 06, 2020 3:48 am
Gents,
We have Powershell script to monitor folder & files within it present on windows server which has hard coded values of Directory/folder path, i want to pass these hard coded values present in script as an argument in Nagios XI while configuring/monitoring script.
Because every time i have to change code/path of folders in script on server, instead of that if i would have facility to pass in Nagios XI dynamically it would be great.
Sample Script of hard codded path-
param($Parentfolder='C:\Users\Desktop\projects',$subfolder='TEST',$flag='inclusion',$file_list=@('aaa','bbb','ccc'))
$searchfolder = $Parentfolder + '\' + $subfolder + '\'
I want to pass parent folder, Subfolder values & folder inclusion list in Nagios itself, how to achieve this?
Nagios XI- using 5.7.4 version
Using NRPE I am implementing powershell script
check_nrpe!Test_ps1!
I wish to pass folder path & folder inclusion list mentioned in the script to above syntax after check_nrpe!Test_ps1!
We have Powershell script to monitor folder & files within it present on windows server which has hard coded values of Directory/folder path, i want to pass these hard coded values present in script as an argument in Nagios XI while configuring/monitoring script.
Because every time i have to change code/path of folders in script on server, instead of that if i would have facility to pass in Nagios XI dynamically it would be great.
Sample Script of hard codded path-
param($Parentfolder='C:\Users\Desktop\projects',$subfolder='TEST',$flag='inclusion',$file_list=@('aaa','bbb','ccc'))
$searchfolder = $Parentfolder + '\' + $subfolder + '\'
I want to pass parent folder, Subfolder values & folder inclusion list in Nagios itself, how to achieve this?
Nagios XI- using 5.7.4 version
Using NRPE I am implementing powershell script
check_nrpe!Test_ps1!
I wish to pass folder path & folder inclusion list mentioned in the script to above syntax after check_nrpe!Test_ps1!