-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvmware-createreport
executable file
·570 lines (519 loc) · 45.4 KB
/
vmware-createreport
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
#!/bin/sh
LINE='<hr class="dashed">'
SYSDATE=$(date +%F)
SYSDAY=$(date +%A)
SYSHOUR=$(date +%H:%M)
RDATE="$SYSDATE - $SYSDAY $SYSHOUR"
trap "rm -rf /tmp/oppyreports/" EXIT
test -z $HNAME && HNAME=vmware1
RDIR=/tmp/oppyreports/vmwarereports/$HNAME
rm -r $RDIR
mkdir -p $RDIR
LINKHEAD=reports/vmwarereports/$HNAME
ESXIHOSTNAME=$(esxcli system hostname get |grep "Host Name:")
ESXIFQDN=$(esxcli system hostname get |grep "Fully Qualified Domain Name:")
ESXIINSTALLTIME=$(esxcli system stats installtime get)
ESXIPYHMEM=$(esxcli hardware memory get |grep "Physical Memory:")
ESXIRELMEM=$(esxcli hardware memory get |grep "Reliable Memory:")
ESXINUMANODE=$(esxcli hardware memory get |grep "NUMA Node Count:")
ESXICLOCK=$(esxcli hardware clock get)
ESXIVER=$(esxcli system version get |grep "Version:")
ESXIBUILD=$(esxcli system version get |grep "Build:")
ESXIUPDATE=$(esxcli system version get |grep "Update:")
ESXIPATCH=$(esxcli system version get |grep "Patch:")
cat > $RDIR/$HNAME.systeminfo << EOF
==================================================================================================================
------------------------------------------------------------------------------------------------------------------
:::.. ESXI HOST INFORMATION :::..
------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
| Host Info
-----------------------------------------------------------------------------------------------------------------
Hostname: |$ESXIHOSTNAME --- FQDN: $ESXIFQDN
IP Address: |192.168.1.100
Pyhsical Memory: |$ESXIPYHMEM
Reliable Memory: |$ESXIRELMEMORY
NUMA Node: |$ESXINUMANODE
ESXI Clock: |$ESXICLOCK
-----------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
| ESXI Info
-----------------------------------------------------------------------------------------------------------------
ESXI Install Time: |$ESXIINSTALLTIME
ESXI Version: |$ESXIVER
ESXI Build: |$ESXIBUILD
ESXI Update: |$ESXIUPDATE
ESXI Patch: |$ESXIPATCH
-----------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
| Vulnerability Info
-----------------------------------------------------------------------------------------------------------------
CVE List: |
-----------------------------------------------------------------------------------------------------------------
=================================================================================================================
EOF
echo " " > $RDIR/$HNAME.userinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.userinfo
echo "$HNAME VMWare Host User Account Information " >> $RDIR/$HNAME.userinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.userinfo
esxcli system account list >> $RDIR/$HNAME.userinfo
echo " " >> $RDIR/$HNAME.userinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.userinfo
echo "-----------------------------------------------------------------------------------------------------------------" > $RDIR/$HNAME.fwinfo
echo "$HNAME VMWare Host Firewall Information " >> $RDIR/$HNAME.fwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.fwinfo
echo " " >> $RDIR/$HNAME.fwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.fwinfo
echo "| Firewall Ruleset " >> $RDIR/$HNAME.fwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.fwinfo
esxcli network firewall ruleset list | grep true >> $RDIR/$HNAME.fwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.fwinfo
echo " " >> $RDIR/$HNAME.fwinfo
echo "Firewall Config:" >> $RDIR/$HNAME.fwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.fwinfo
esxcli network firewall get >> $RDIR/$HNAME.fwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.fwinfo
echo " " >> $RDIR/$HNAME.fwinfo
echo "Firewall Loaded Rules:" >> $RDIR/$HNAME.fwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.fwinfo
esxcli network firewall load >> $RDIR/$HNAME.fwinfo
echo " " >> $RDIR/$HNAME.fwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.fwinfo
echo "-----------------------------------------------------------------------------------------------------------------" > $RDIR/$HNAME.nwinfo
echo "$HNAME VMWare Host Network Configuration " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
echo " " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
echo "| Physical NIC - Network Interface " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
esxcli network nic list >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
esxcli network nic coalesce get >> $RDIR/$HNAME.nwinfo
echo " " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
echo "| Network Interfaces | " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
esxcli network ip interface list >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
echo " " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
echo "| IP Adress Info | " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
esxcli network ip get >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
echo " " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
echo "| Route Information " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
echo "| IPv4 " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
esxcli network ip route ipv4 list >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
echo "| IPv6 " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
esxcli network ip route ipv6 list >> $RDIR/$HNAME.nwinfo
echo " " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
echo "| Netstack Info | " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
esxcli network ip netstack list >> $RDIR/$HNAME.nwinfo
echo " " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
echo "| Multicast Group List | " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nwinfo
esxcli network multicast group list >> $RDIR/$HNAME.nwinfo
echo " " >> $RDIR/$HNAME.nwinfo
echo "-----------------------------------------------------------------------------------------------------------------" > $RDIR/$HNAME.dnsinfo
echo "$HNAME VMWare Host DNS Server Info " >> $RDIR/$HNAME.dnsinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.dnsinfo
echo " " >> $RDIR/$HNAME.dnsinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.dnsinfo
echo "| DNS Servers " >> $RDIR/$HNAME.dnsinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.dnsinfo
esxcli network ip dns server list >> $RDIR/$HNAME.dnsinfo
echo " " >> $RDIR/$HNAME.dnsinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.dnsinfo
echo "-----------------------------------------------------------------------------------------------------------------" > $RDIR/$HNAME.conninfo
echo "$HNAME VMWare Host Connection Information " >> $RDIR/$HNAME.conninfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.conninfo
echo " " >> $RDIR/$HNAME.conninfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.conninfo
echo "| TCP UDP Connection List | " >> $RDIR/$HNAME.conninfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.conninfo
esxcli network ip connection list >> $RDIR/$HNAME.conninfo
echo " " >> $RDIR/$HNAME.conninfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.conninfo
echo " " >> $RDIR/$HNAME.conninfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.conninfo
echo "| Physical Neighbor List | " >> $RDIR/$HNAME.conninfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.conninfo
esxcli network ip neighbor list >> $RDIR/$HNAME.conninfo
echo " " >> $RDIR/$HNAME.conninfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo "| NIC queue Count Info | " >> $RDIR/$HNAME.nicinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
esxcli network nic queue count get >> $RDIR/$HNAME.nicinfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo "| NIC Filterclass List | " >> $RDIR/$HNAME.nicinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
esxcli network nic queue filterclass list >> $RDIR/$HNAME.nicinfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo "| NIC Checksum Info | " >> $RDIR/$HNAME.nicinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
esxcli network nic cso get >> $RDIR/$HNAME.nicinfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo "| NIC Settings (software configuration) Info " >> $RDIR/$HNAME.nicinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
esxcli network nic software list >> $RDIR/$HNAME.nicinfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" > $RDIR/$HNAME.nicinfo
echo "$HNAME VMWare Host NIC Adapter and Configuration Info " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo "| NICs SR-IOV Passthrough Info | " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
esxcli network sriovnic list >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "Mixed Mode :" >> $RDIR/$HNAME.nicinfo
echo "SR-IOV Only Mode :" >> $RDIR/$HNAME.nicinfo
echo "Non SR-IOV Mode :" >> $RDIR/$HNAME.nicinfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo "| Virtual Switch Info | " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo "| Distrubiuted Switch Info | " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
esxcli network vswitch dvs vmware list >> $RDIR/$HNAME.nicinfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo "| Standard Switch Info | " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
esxcli network vswitch standard list >> $RDIR/$HNAME.nicinfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.nicinfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.sysloginfo
echo "| Syslog Config Info | " >> $RDIR/$HNAME.sysloginfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.sysloginfo
SYSLOGDSTAT=$(/etc/init.d/vmsyslogd status)
echo "Syslogd Status: $SYSLOGDSTAT" >> $RDIR/$HNAME.sysloginfo
cat /etc/vmsyslog.conf |grep "logdir" |grep -v "logdir_unique" >> $RDIR/$HNAME.sysloginfo
cat /etc/vmsyslog.conf |grep "loghost" >> $RDIR/$HNAME.sysloginfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.sysloginfo
echo " " >> $RDIR/$HNAME.nicinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.lbinfo
echo "| Load Balancer State Info " >> $RDIR/$HNAME.lbinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.lbinfo
esxcli network nic queue loadbalancer state list >> $RDIR/$HNAME.lbinfo
echo "| Load Balancer Plugin Info " >> $RDIR/$HNAME.lbinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.lbinfo
esxcli network nic queue loadbalancer plugin list >> $RDIR/$HNAME.lbinfo
echo " " >> $RDIR/$HNAME.lbinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.lbinfo
#esxcli network nic coalesce low get -n $NIC
#esxcli network nic coalesce high get -n $NIC
#echo "| NIC Buffer Info " >> $RDIR/$HNAME.systemreport
#echo "---------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.systemreport
#esxcli network nic ring current get -n vmnic0 >> $RDIR/$HNAME.systemreport
#esxcli network nic ring preset get -n vmnic0 >> $RDIR/$HNAME.systemreport
#echo "| NIC VLAN Info " >> $RDIR/$HNAME.systemreport
#echo "---------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.systemreport
#esxcli network nic vlan stats get -n vmnic0 >> $RDIR/$HNAME.systemreport
#echo "| NIC Statistics " >> $RDIR/$HNAME.systemreport
#echo "---------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.systemreport
#esxcli network nic stats get -n $NIC
echo "----------------------------------------------------------------------------------------------------------------" > $RDIR/$HNAME.storageinfo
echo "$HNAME VMWare Host Storage and Datastore Information " >> $RDIR/$HNAME.storageinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.storageinfo
echo " " >> $RDIR/$HNAME.storageinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.storageinfo
echo "| Storage List | " >> $RDIR/$HNAME.storageinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.storageinfo
esxcli storage vmfs extent list >> $RDIR/$HNAME.storageinfo
echo " " >> $RDIR/$HNAME.storageinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.storageinfo
echo "----------------------------------------------------------------------------------------------------------------" > $RDIR/$HNAME.moduleinfo
echo "$HNAME VMWare Host Module Usage Information " >> $RDIR/$HNAME.moduleinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.moduleinfo
echo " " >> $RDIR/$HNAME.moduleinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.moduleinfo
echo "| System Module Info | " >> $RDIR/$HNAME.moduleinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.moduleinfo
esxcli system module list >> $RDIR/$HNAME.moduleinfo
echo "----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.moduleinfo
#----------------------------
# VM INFO
#----------------------------
echo "-----------------------------------------------------------------------------------------------------------------" > $RDIR/$HNAME.vminfo
echo "$HNAME VMWare Host VM Information " >> $RDIR/$HNAME.vminfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vminfo
echo " " >> $RDIR/$HNAME.vminfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vminfo
echo "| VM Info " >> $RDIR/$HNAME.vminfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vminfo
vim-cmd vmsvc/getallvms >> $RDIR/$HNAME.vminfo
echo " " >> $RDIR/$HNAME.vminfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vminfo
echo "" >> $RDIR/$HNAME.vminfo
echo "| VM .vmx List " >> $RDIR/$HNAME.vminfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vminfo
esxcli vm process list |grep ".vmx" >> $RDIR/$HNAME.vminfo
echo " " >> $RDIR/$HNAME.vminfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vminfo
echo " " >> $RDIR/$HNAME.vminfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vminfo
echo "| VM network Info " >> $RDIR/$HNAME.vminfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vminfo
esxcli network vm list >> $RDIR/$HNAME.vminfo
echo " " >> $RDIR/$HNAME.vminfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vminfo
#----------------------------
# VM IMAGE INFO
#----------------------------
### /usr/lib/vmware/isoimages
echo "-----------------------------------------------------------------------------------------------------------------" > $RDIR/$HNAME.imageinfo
echo "$HNAME VMWare Host VM .iso Image Information " >> $RDIR/$HNAME.imageinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.imageinfo
find /vmfs/ |grep "windows.iso" > $RDIR/$HNAME.imagelist
find /vmfs/ |grep "linux.iso" >> $RDIR/$HNAME.imagelist
find /vmfs/ |grep "isoimages_manifest.txt" >> $RDIR/$HNAME.imagelist
IMGLINE=$(cat $RDIR/$HNAME.imagelist |wc -l)
IM=1
while [ "$IM" -le "$IMGLINE" ]; do
CURRENTLINE=$(sed -n $IM{p} $RDIR/$HNAME.imagelist)
ls -lh $CURRENTLINE >> $RDIR/$HNAME.imageinfo
IM=$(( IM + 1 ))
done
echo " " >> $RDIR/$HNAME.imageinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.imageinfo
echo " " >> $RDIR/$HNAME.imageinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.imageinfo
echo "| VM isoimage Usage by Distro/OS | " >> $RDIR/$HNAME.imageinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.imageinfo
MANIFILE=$(find /vmfs/ |grep "isoimages_manifest.txt" |grep -v ".sig")
cat $MANIFILE >> $RDIR/$HNAME.imageinfo
echo " " >> $RDIR/$HNAME.imageinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.imageinfo
#rm $RDIR/$HNAME.imagelist
echo " " >> $RDIR/$HNAME.vibinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vibinfo
echo "| ESXI Host Software WIB Info " >> $RDIR/$HNAME.vibinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vibinfo
echo "Software Acceptance:" >> $RDIR/$HNAME.vibinfo
esxcli software acceptance get >> $RDIR/$HNAME.vibinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vibinfo
esxcli software vib list >> $RDIR/$HNAME.vibinfo
echo "-----------------------------------------------------------------------------------------------------------------" >> $RDIR/$HNAME.vibinfo
#------------------------------
# SYSTEMREPORT.HTML
#------------------------------
cat > $RDIR/$HNAME-systemreport.html << EOF
<!DOCTYPE html>
<html>
<head>
<title>TaliaOppy</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="/static/css/style.css">
</head>
<body>
<div class="nav">
<h2 class="main_title">$HNAME VMWare Host System Information Report</h2>
<p class="date">$RDATE</p>
<hr class="line">
</div>
EOF
echo "<div class="cards">" >> $RDIR/$HNAME-systemreport.html
echo "<div class="card">" >> $RDIR/$HNAME-systemreport.html
echo "<h5 class="card__title">Host and System Information</h5><br>" >> $RDIR/$HNAME-systemreport.html
echo "<p class="card__apply">" >> $RDIR/$HNAME-systemreport.html
echo "<br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.systeminfo>Inventory & System Report</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "<b>ESX Version and Install Date</b><br>" >> $RDIR/$HNAME-systemreport.html
cat $RDIR/$HNAME.systeminfo |grep "ESXI Version:" |cut -d "|" -f2 >> $RDIR/$HNAME-systemreport.html
echo "<br>" >> $RDIR/$HNAME-systemreport.html
cat $RDIR/$HNAME.systeminfo |grep "ESXI Install Time:" |cut -d "|" -f2 >> $RDIR/$HNAME-systemreport.html
echo "<br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.moduleinfo>Usage/Loaded Modules List</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.imageinfo>VM Image File Info</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.vibinfo>ESX Software Information</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "</p>" >> $RDIR/$HNAME-systemreport.html
echo "</div>" >> $RDIR/$HNAME-systemreport.html
echo "<div class="card">" >> $RDIR/$HNAME-systemreport.html
echo "<h5 class="card__title">User Account Information</h5><br>" >> $RDIR/$HNAME-systemreport.html
echo "<br>" >> $RDIR/$HNAME-systemreport.html
echo "<p class="card__apply">" >> $RDIR/$HNAME-systemreport.html
echo "<br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.userinfo>User Information Report</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "</p>" >> $RDIR/$HNAME-systemreport.html
echo "</div>" >> $RDIR/$HNAME-systemreport.html
echo "<div class="card">" >> $RDIR/$HNAME-systemreport.html
echo "<h5 class="card__title">Network Config and NICs Information</h5><br>" >> $RDIR/$HNAME-systemreport.html
echo "<p class="card__apply">" >> $RDIR/$HNAME-systemreport.html
echo "<br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.nwinfo>Network Configuration Report</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "<br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.nicinfo>NIC Adapter Report</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.dnsinfo>DNS Info</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.lbinfo>Load Balancer Configuration Info</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.fwinfo>Firewall Configuration Info</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "</p>" >> $RDIR/$HNAME-systemreport.html
echo "</div>" >> $RDIR/$HNAME-systemreport.html
echo "<div class="card">" >> $RDIR/$HNAME-systemreport.html
echo "<h5 class="card__title">Connections Information</h5><br>" >> $RDIR/$HNAME-systemreport.html
echo "<p class="card__apply">" >> $RDIR/$HNAME-systemreport.html
echo "<br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.conninfo>Connection List</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "<br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.conninfo>Listening Port List</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "</p>" >> $RDIR/$HNAME-systemreport.html
echo "</div>" >> $RDIR/$HNAME-systemreport.html
echo "<div class="card">" >> $RDIR/$HNAME-systemreport.html
echo "<h5 class="card__title">VM Information</h5><br>" >> $RDIR/$HNAME-systemreport.html
echo "<p class="card__apply">" >> $RDIR/$HNAME-systemreport.html
echo "<br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.vminfo>VM List</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "</p>" >> $RDIR/$HNAME-systemreport.html
echo "</div>" >> $RDIR/$HNAME-systemreport.html
echo "<div class="card">" >> $RDIR/$HNAME-systemreport.html
echo "<h5 class="card__title">Storage Information</h5><br>" >> $RDIR/$HNAME-systemreport.html
echo "<p class="card__apply">" >> $RDIR/$HNAME-systemreport.html
echo "<br>" >> $RDIR/$HNAME-systemreport.html
echo "<a href=$LINKHEAD/$HNAME.storageinfo>Storage Info</a><br>" >> $RDIR/$HNAME-systemreport.html
echo "</p>" >> $RDIR/$HNAME-systemreport.html
echo "</div>" >> $RDIR/$HNAME-systemreport.html
echo "</div>" >> $RDIR/$HNAME-systemreport.html
echo "</body>" >> $RDIR/$HNAME-systemreport.html
echo "</html>" >> $RDIR/$HNAME-systemreport.html
#------------------------------
# BIGRREPORT.HTML
#------------------------------
cat > $RDIR/$HNAME-bigr.html << EOF
<!DOCTYPE html>
<html>
<head>
<title>TaliaOppy</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="/static/css/style.css">
</head>
<body>
<div class="nav_bigr">
<p class="main_title_bigr">$HNAME VMWare Host BIGR Report</p>
<p class="date">$RDATE</p>
<hr class="line">
</div>
EOF
cat >> $RDIR/$HNAME-bigr.html << EOF
<p class="heading_bigr">3. VARLIK GRUPLARINA YÖNELİK GÜVENLİK TEDBİRLERİ<br>
3.1 Ağ ve Sistem Güvenliği<br>
3.1.9 Sanallaştırma Güvenliği</p>
$LINE
EOF
echo "<div class="cards">" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.1</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Güncel sürümlerin kullanılması" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "<a href=$LINKHEAD/$HNAME.systeminfo>ESX Information</a><br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.2</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Kapasite planlaması hangi kriterlere göre yapılmaktadır?" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "Mülakat<br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.3</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Kullanılmayan sanal makineler kapatılmalıdır" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "<a href=$LINKHEAD/$HNAME.vminfo>ESX Virtual Machines Information</a><br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.4</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">İşletim sistemi sıkılaştırma ve güvenlik kontrollerinin yapılması" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "Bkz.: Server Reports<br>" >> $RDIR/$HNAME-bigr.html
echo "<a href=$LINKHEAD/$HNAME.vminfo>VMWare Host VM List</a><br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.5</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Sözleşmelerde ve tedarik şartnamelerinde sanallaştırma güvenliği nasıl ele alınmaktadır?" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "Mülakat<br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.6</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Kurumda sanal makine imajlarının bütünlüğü kontrol edilmekte midir?" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "<a href=$LINKHEAD/$HNAME.imageinfo>VMWare Host VM Image Integrity and Information Report</a><br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.7</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Kurumda kullanılan servisler,protokoller,port numaraları dokümante edilmekte midir?" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "Bkz.: Server Reports -> Service List reports<br>" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "<a href=$LINKHEAD/$HNAME.moduleinfo>VMWare Host Module Usage Information</a><br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.8</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Operasyon ve test ortamları birbirinden izole edilmiş midir?" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.9</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Sanallaştırma sistemleri yönetim arayüzlerine erişim, tanımlanan yetki ile güvenli bir şekilde yapılmalıdır.<br>" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "<a href=$LINKHEAD/$HNAME.userinfo>VMWare Host Account Information Report</a><br>" >> $RDIR/$HNAME-bigr.html
echo "<a href=$LINKHEAD/$HNAME.userinfo>VMWare Host Listening Service Report</a><br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.10</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Kuruma ait ve yetkili otoriteden alınmış sertifikalar mı Kullanılmaktadır?" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "VMware Certificate Authority (VMCA) menu control from Web Interface<br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.11</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Sanal Makineler arası trafiğin kontrol edilmesi" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "<a href=$LINKHEAD/$HNAME.nicinfo>VMWare Host NIC Configuration Info</a><br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.12</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Depolama Ortamları ile İletişim Güvenliğinin Sağlanması" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "<a href=$LINKHEAD/$HNAME.storageinfo>VMWare Host Storage and Datastore Information</a><br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "<div class="card">" >> $RDIR/$HNAME-bigr.html
echo "<h5 class="card__title">3.1.9.13</h5><br>" >> $RDIR/$HNAME-bigr.html
echo "<p class="card__apply">Fiziksel kaynakların izole edilmesi" >> $RDIR/$HNAME-bigr.html
echo "<br>" >> $RDIR/$HNAME-bigr.html
echo "</p>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "</div>" >> $RDIR/$HNAME-bigr.html
echo "</body>" >> $RDIR/$HNAME-bigr.html
echo "</html>" >> $RDIR/$HNAME-bigr.html
test -e /tmp/${HNAME}-report.tar.gz && rm -rf /tmp/${HNAME}.tar.gz
cd /tmp/oppyreports/
tar -czf /tmp/${HNAME}-report.tar.gz /tmp/oppyreports/*