Linux Commands
Linux Commands
cfg
vi contactgroups.cfg
vi
cgi.cfg
vi nagios.cfg
vi timeperiods.cfg
useradd (username)
userdel (delete user)
passwd (username)
cd /usr/local/nagios/etc
To reload Nagios
/etc/init.d/nagios reload
tail -f /usr/local/nagios/var/nagios.log
ls
tail -f /var/log/sendEmail
tail -f ../var/nagios.log
NMS User Files
vi cgi.cfg
vi contactgroups.cfg
vi contacts.cfg
To access NMS Files
cd /usr/local/nagios/etc
To find SQUID current status
/etc/init.d/squid status
To restart SQUID
/etc/init.d/squid restart
cd bin
ACLS in Squid
cd /etc/squid/acls
To Delete Logs
> /var/log/lastlog
> /var/log/message
history c
To install HBA Drivers in ESXi
/tmp # esxcli software vib install -v /(soft path)/scsi-bfa-3.2.3.01OEM.550.0.0.1198610.x86_64.vib
To change I.P or Gateway
1.
cd /etc/sysconfig/network-scripts/
2.
vi route-eth0
vi ifcfg-eth0
To add persistent Route
echo "10.0.0.0/8 via 10.1.1.200" >> /etc/sysconfig/network-scripts/routeeth0
Vi /etc/sudoers
To Del User
userdel name
Add SUDO user
sudo adduser saqib
Tacaca + File Having User I.D
Vi /usr/local/etc/tac_plus/tac_plus.cfg
cd /NOC/cacti/syslog/TAC_PLUS
Tacaca + Login Information
cd /NOC/cacti/syslog/TAC_PLUS/2014/04/16/tac_plus-2014-04-16.txt
SQUID I.P Logs
tail -f /var/log/squid/access.log |grep 10.200.252.115
cat /var/log/squid/access.log |grep 10.200.252.115
Copy file or folder on a remote computer
/vmfs/volumes # scp -r KC-NWSYSBK-98
[email protected]:/vmfs/volumes/ESXI57
scp -r WEBOC-INT-9.142 [email protected]:/vmfs/volumes/ESXI65/
scp r file or folder name [email protected]:folder address
Find a Extension file
find / -name "*.vmx"
To delete a folder/directory
rm rf (folder name)/*
To make a folder/directory
mkdir (Folder name)
To find directory size in linux
du -h
To find folder size in linux
du /vmfs/volumes/ESXI52/iris2 -h
du /folder path -h
~ # vim-cmd vmsvc/getallvms
Vmid
Name
File
Guest OS
Version Annotation
4
WEBOC-TFS-45 [ESXI76] WEBOC-INT2-9.45/WEBOC-INT2-9.45.vmx
windows7Server64Guest vmx-08
6
WEBOC-INT-138 [ESXI76] WEBOC-INT-9.138/WEBOC-INT-9.138.vmx
windows7Server64Guest vmx-08
Check Power Status of Virtual Machine (WEBOC-TFS-45):
~ # vim-cmd vmsvc/power.getstate 4
Retrieved runtime info
Powered on
Power off virtual machine:
~ # vim-cmd vmsvc/power.of 4
Powering of VM:
Power on virtual machine:
~ # vim-cmd vmsvc/power.on 4
Powering on VM:
,WEBOC-INT-227,WEBOC-EXT-229
Available