rsync on windows server

Reminder to establish rsync connection from a windows server to a remote server

install cwrsync Or CYGWING

Use this link for CWRSYNC

Or install Cygwin and select RSYNC, SSH et openSSL package

Setup a DOS script:
C:
cd c:/Program Files (x86)/cwRsync/bin
rsync.exe -aivz --rsh="./ssh.exe -i C:/Users/bob/.ssh/id_rsa -p 8888" "/windows/backup/" "bob@backup.server.com:/var/backup"

the rsh command allow you to customize the connection particularly to change the default port (the -p option) and to point the right identity file (private rsa key) (the -i option)

for basic explanations please refer to rsync.net

nagios on windows

‘install nsclientpp on windows server. I used version 2012-12-02.

in’ nsclient.ini:
in NRPE section check the port and ssl parameter. allow arguments

in external script section:
enable argument.

in alias section ‘/’settings/external scripts/alias]
define the alias command that you will call from nagios. it helps to reduce parameters on server side, cpu or process example elow’ ‘:

; alias_cpu – Alias for alias_cpu. To configure this item add a section called: /settings/external scripts/alias/alias_cpu
alias_cpu = checkCPU arn=80′ ‘crit=90 time=5m time=1m time=30s

; alias_process – Alias for alias_process. To configure this item add a section called: /settings/external scripts/lias’/’alias_process
alias_process = checkProcState $ARG1$=started »

; bob (test with py script)
alias_bob = bob

then in wrapped scripts maps he’ ‘alias to a real script located on windows

; A list of wrappped scripts (ie. using the template mechanism)
[/settings/external scripts/wrapped cripts]
‘ ‘check_updates = scripts\\check_updates.vbs
bob = bob.py

and at last’