To add an alias, run sudo vi ~/.bashrc
at the end of the file under # Custom Aliases
add alias name='commands'
save and close. Then, run sudo source=~/bashrc
- Run Agent Update: agentupdate
alias agentupdate='sudo puppet agent --server=mgmt-b.foo.org.nz --no-daemonize --verbose --onetime'
- Edit Site.pp: site
alias site='sudo vi /etc/puppet/code/environments/production/manifests/site.pp'
alias mod='cd /etc/puppet/code/modules/'
alias nag='mod && cd nagios'
alias res='sudo systemctl restart'
alias stat='sudo systemctl status'
alias inst='apt list | grep'
alias resmas='sudo systemctl restart puppetmaster'
alias statmas='sudo systemctl status puppetmaster'
alias respup='sudo systemctl restart puppet'
alias statpup='sudo systemctl status puppet'
alias lcert='sudo puppet cert --list --all'
alias sign='sudo puppet cert --sign'
alias statnr='sudo systemctl status nagios-nrpe-server'
alias resnr='sudo systemctl restart nagios-nrpe-server'
alias statnag='sudo systemctl status nagios3'
alias resnag='sudo systemctl restart nagios3'
alias ernag='sudo nagios3 -v /etc/nagios3/nagios.cfg'
get error output from nagiosbumgmt
alias to backup VM to OE2-Group-Project/Mgmt-VM/ : bumgmtalias bumgmt='cd ~/OE2-Group-Project && git pull && sudo cp /etc/puppet/ -r ~/OE2-Group-Project/Mgmt-VM/ -r && sudo rm -r ~/OE2-Group-Project/Mgmt-VM/puppet/ssl && sudo cp /etc/puppet/code/environments/production/manifests/site.pp ~/OE2-Group-Project/Mgmt-VM/puppet/ && sudo chown bitstudent ~/OE2-Group-Project/Mgmt-VM/puppet/code && sudo chgrp bitstudent ~/OE2-Group-Project/Mgmt-VM/puppet && sudo chown bitstudent ~/OE2-Group-Project/Mgmt-VM/puppet/* && sudo chgrp bitstudent ~/OE2-Group-Project/Mgmt-VM/puppet/* && sudo cp /etc/hosts ~/OE2-Group-Project/Mgmt-VM/hosts && sudo chown bitstudent ~/OE2-Group-Project/Mgmt-VM/hosts && sudo chgrp bitstudent ~/OE2-Group-Project/Mgmt-VM/hosts && sudo chmod go+r ~/OE2-Group-Project/Mgmt-VM/hosts && sudo cp /etc/nagios3 -r ~/OE2-Group-Project/Mgmt-VM/ -r && sudo chown bitstudent ~/OE2-Group-Project/Mgmt-VM/nagios3 && sudo chgrp bitstudent ~/OE2-Group-Project/Mgmt-VM/nagios3 && sudo chown bitstudent ~/OE2-Group-Project/Mgmt-VM/nagios3/* && sudo chgrp bitstudent ~/OE2-Group-Project/Mgmt-VM/nagios3/* && sudo cp /etc/php/7.2/cgi/php.ini ~/OE2-Group-Project/Mgmt-VM/php.ini && sudo chown bitstudent ~/OE2-Group-Project/Mgmt-VM/php.ini && sudo chgrp bitstudent ~/OE2-Group-Project/Mgmt-VM/php.ini && history -w && sudo cp ~/.bash_history ~/OE2-Group-Project/Mgmt-VM/bash_history.txt && sudo chown bitstudent ~/OE2-Group-Project/Mgmt-VM/bash_history.txt && sudo chgrp bitstudent ~/OE2-Group-Project/Mgmt-VM/bash_history.txt && sudo chmod go+r ~/OE2-Group-Project/Mgmt-VM/bash_history.txt && sudo cp ~/.bashrc ~/OE2-Group-Project/Mgmt-VM/bashrc && sudo chown bitstudent ~/OE2-Group-Project/Mgmt-VM/bashrc && sudo chgrp bitstudent ~/OE2-Group-Project/Mgmt-VM/bashrc && sudo chmod go+r ~/OE2-Group-Project/Mgmt-VM/bashrc && sudo cp /etc/nagios ~/OE2-Group-Project/Mgmt-VM/ -r && sudo cp /etc/nagios-plugins ~/OE2-Group-Project/Mgmt-VM/ -r && cd ~/OE2-Group-Project && git status'
- alias to backup VM to OE2-Group-Project/Db-VM/ : budb
alias budb='cd ~/OE2-Group-Project && git pull && sudo cp /etc/puppet/ ~/OE2-Group-Project/Db-VM/ -r && sudo cp /etc/hosts ~/OE2-Group-Project/Db-VM/hosts && sudo chown bitstudent ~/OE2-Group-Project/Db-VM/hosts && sudo chgrp bitstudent ~/OE2-Group-Project/Db-VM/hosts && sudo chmod go+r ~/OE2-Group-Project/Db-VM/hosts && sudo cp /etc/puppet/ ~/OE2-Group-Project/Db-VM/ -r && history -w && sudo cp ~/.bash_history ~/OE2-Group-Project/Db-VM/bash_history.txt && sudo chown bitstudent ~/OE2-Group-Project/Db-VM/bash_history.txt && sudo chgrp bitstudent ~/OE2-Group-Project/Db-VM/bash_history.txt && sudo chmod go+r ~/OE2-Group-Project/Db-VM/bash_history.txt && sudo cp ~/.bashrc ~/OE2-Group-Project/Db-VM/bashrc && sudo chown bitstudent ~/OE2-Group-Project/Db-VM/bashrc && sudo chgrp bitstudent ~/OE2-Group-Project/Db-VM/bashrc && sudo chmod go+r ~/OE2-Group-Project/Db-VM/bashrc && sudo cp /etc/mysql ~/OE2-Group-Project/Db-VM/ -r && sudo chgrp bitstudent ~/OE2-Group-Project/Db-VM/mysql/debian.cnf && sudo chown bitstudent ~/OE2-Group-Project/Db-VM/mysql/debian.cnf && sudo cp /etc/nagios ~/OE2-Group-Project/Db-VM -r && sudo cp /etc/nagios-plugins ~/OE2-Group-Project/Db-VM -r && cd ~/OE2-Group-Project && git status'
alias pup='cd /etc/puppet'
alias res='sudo systemctl restart'
alias stat='sudo systemctl status'
alias inst='apt list | grep'
alias respup='sudo systemctl restart puppet'
alias statpup='sudo systemctl status puppet'
alias statnr='sudo systemctl status nagios-nrpe-server'
alias resnr='sudo systemctl restart nagios-nrpe-server'
alias buapp='cd ~/OE2-Group-Project && git pull && sudo cp /etc/puppet/ ~/OE2-Group-Project/App-VM/ -r && sudo cp /etc/hosts ~/OE2-Group-Project/App-VM/hosts && sudo chown bitstudent ~/OE2-Group-Project/App-VM/hosts && sudo chgrp bitstudent ~/OE2-Group-Project/App-VM/hosts && sudo chmod go+r ~/OE2-Group-Project/App-VM/hosts && sudo cp /etc/puppet/ ~/OE2-Group-Project/App-VM/ -r && history -w && sudo cp ~/.bash_history ~/OE2-Group-Project/App-VM/bash_history.txt && sudo chown bitstudent ~/OE2-Group-Project/App-VM/bash_history.txt && sudo chgrp bitstudent ~/OE2-Group-Project/App-VM/bash_history.txt && sudo chmod go+r ~/OE2-Group-Project/App-VM/bash_history.txt && sudo cp ~/.bashrc ~/OE2-Group-Project/App-VM/bashrc && sudo chown bitstudent ~/OE2-Group-Project/App-VM/bashrc && sudo chgrp bitstudent ~/OE2-Group-Project/App-VM/bashrc && sudo chmod go+r ~/OE2-Group-Project/App-VM/bashrc && sudo cp /etc/nagios ~/OE2-Group-Project/App-VM -r && sudo cp /etc/nagios-plugins ~/OE2-Group-Project/App-VM -r && cd ~/OE2-Group-Project && git status'
alias pup='cd /etc/puppet'
alias mod='cd /etc/puppet/code/module'
alias res='sudo systemctl restart'
alias stat='sudo systemctl status'
alias inst='apt list | grep'
alias respup='sudo systemctl restart puppet'
alias statpup='sudo systemctl status puppet'
alias statnr='sudo systemctl status nagios-nrpe-server'
alias resnr='sudo systemctl restart nagios-nrpe-server'
alias bubup='cd ~/OE2-Group-Project && sudo git pull && sudo cp /etc/puppet ~/OE2-Group-Project/Backup-VM/ -r && sudo cp /etc/hosts ~/OE2-Group-Project/Backup-VM/hosts && sudo chown bitstudent ~/OE2-Group-Project/Backup-VM/hosts && sudo chgrp bitstudent ~/OE2-Group-Project/Backup-VM/hosts && sudo chmod go+r ~/OE2-Group-Project/Backup-VM/hosts && sudo cp /etc/puppet/ ~/OE2-Group-Project/Backup-VM/ -r && history -w && sudo cp ~/.bash_history ~/OE2-Group-Project/Backup-VM/bash_history.txt && sudo chown bitstudent ~/OE2-Group-Project/Backup-VM/bash_history.txt && sudo chgrp bitstudent ~/OE2-Group-Project/Backup-VM/bash_history.txt && sudo chmod go+r ~/OE2-Group-Project/Backup-VM/bash_history.txt && sudo cp ~/.bashrc ~/OE2-Group-Project/Backup-VM/bashrc && sudo chown bitstudent ~/OE2-Group-Project/Backup-VM/bashrc && sudo chgrp bitstudent ~/OE2-Group-Project/Backup-VM/bashrc && sudo chmod go+r ~/OE2-Group-Project/Backup-VM/bashrc && sudo cp /etc/nagios ~/OE2-Group-Project/Backup-VM -r && sudo cp /etc/nagios-plugins ~/OE2-Group-Project/Backup-VM -r && cd ~/OE2-Group-Project && git status'
alias pup='cd /etc/puppet'
alias res='sudo systemctl restart'
alias stat='sudo systemctl status'
alias inst='apt list | grep'
alias respup='sudo systemctl restart puppet'
alias statpup='sudo systemctl status puppet'
alias statnr='sudo systemctl status nagios-nrpe-server'