.bar command in Windows do not redirect to a file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
FCC_Nagios_Support
Posts: 161
Joined: Tue Mar 10, 2020 11:07 am

.bar command in Windows do not redirect to a file

Post by FCC_Nagios_Support »

Hello,
We have a script in Windows as:
net stop service
echo Stopped > log

Nagios nrpe shows an "ERROR incompatible to redirect entries"
Thanks
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: .bar command in Windows do not redirect to a file

Post by vtrac »

Hi,
How are you doing?

What "service" are you stopping in the batch script?
See if you have permission to write to "C:\Program Files\NSClient++\" folder.
Maybe you could try writing the "log" to different location (folder).


I tested this on my NSClient++ and looks like it is working for me.

I created a simple "check_workstation_stat.bat" and put that under the NSClient++ "scripts" folder:

Code: Select all

C:\Program Files\NSClient++\scripts\check_workstation_stat.bat
Here's the content of "check_workstation_stat.bat":
M3.png
I then "ran" the script on my XI command prompt:
M2.png
And here's the "Vinhlog" file under "C:\Program Files\NSClient++\" folder:
The "check_workstation_stat.bat" script was able to created the "Vinhlog" file ... (please see picture below).
M1.png

Best Regards,
Vinh
You do not have the required permissions to view the files attached to this post.
FCC_Nagios_Support
Posts: 161
Joined: Tue Mar 10, 2020 11:07 am

Re: .bar command in Windows do not redirect to a file

Post by FCC_Nagios_Support »

Many thanks Vihn.
Good with PowerShell

KR
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: .bar command in Windows do not redirect to a file

Post by vtrac »

Great!! .... May I close this thread?

Regards,
Vinh
Locked