Bash script to check a remote nagios installation and run custom commands depending on status