-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinventory.sh
55 lines (39 loc) · 968 Bytes
/
inventory.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!bin/bash
#Description:systen inventory
#Author: san
echo -e "\nnumber of cpus\n"
nproc
echo -e "\nfirst digit of the kernel version\n"
uname -r |awk -F"." '{print $1}'
echo -e "\nos running and version\n"
cat /etc/*release
echo -e "\nsize of memory\n"
free -m
echo -e "\ncpu speed\n"
lscpu
echo -e "\nkernel version\n"
uname -r
echo -e "\n system bits\n"
arch
echo -e "\nchecking hostname\n"
hostname
echo -e "\nipaddress\n"
ip addr
echo -e "\nchecking all opening opened ports\n"
lsof -i
echo -e "\nchecking dns\n"
dig
echo -e "\nchecking the manufacturer\n"
dmidecode system-manufacturer
echo -e "\nchecking if the system is physical or virtual\n"
dmidecode
echo -e "\nchecking the mac address\n"
ifconfig -a
echo -e "\ntotal number of memory\n"
free -m |grep Mem |awk -F" " '{print $1}
if [ -f /etc/group ] && [ -f /etc/passwd ] && [ -f /etc/httpd ] && [ -f /etc/kubernetes ]
then
echo -e "\nchecked passed\n"
else
echo -e "\nchecked failed\n"
fi