This fabfile was based on instructions below and we tested only with Nagios Core version 4 https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/upgrading.html
We assume that Nagios installation is on /usr/local/nagios Otherwise edit this fabfile accordingly.
Shell script to backup_nagios is also needed and it is available along with fabfile. Any suggestions to improve this fabfile to upgrade Nagios Core installation is very welcome.