crontab for AIX

crontab location for AIX

1
/var/spool/cron/crontabs/

Allow normal user to use crontab, add user to /var/adm/cron/cron.allow

1
echo efpuat >> /var/adm/cron/cron.allow

curl for AIX

Install curl

1
2
3
4
5
6
7
8
9
10
# rpm -U   \
curl-7.52.1-1.aix6.1.ppc.rpm \
ca-certificates-2019.01.10-2.aix6.1.ppc.rpm \
p11-kit-0.23.16-1.aix6.1.ppc.rpm \
p11-kit-tools-0.23.16-1.aix6.1.ppc.rpm

# curl --version
curl 7.52.1 (powerpc-ibm-aix6.1.8.0) libcurl/7.52.1 OpenSSL/1.0.2u zlib/1.2.11
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy

Using with HTTPS Proxy

1
2
3
4
5
6
7
8
9
# curl -x 10.114.237.2:8080 https://bastet.unixhk.com

.OR.

# export https_proxy=10.114.237.2:8080
# curl https://bastet.unixhk.com

# Download file
# curl -x 10.114.237.2:8080 -O https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/rsync/rsync-2.4.6-3.aix4.3.ppc.rpm

Download file

1
# curl -O https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/rsync/rsync-2.4.6-3.aix4.3.ppc.rpm

HP Smart Storage Admin (ssacli)

Check RAID Status

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@vmesxi04:~]  /opt/smartstorageadmin/ssacli/bin/ssacli ctrl all show config
HPE Smart Array P408i-a SR Gen10 in Slot 0 (Embedded) (sn: PWXKV0BRHDS7ID)

Internal Drive Cage at Port 1I, Box 3, OK
Internal Drive Cage at Port 2I, Box 0, OK

Port Name: 1I (Mixed)
Port Name: 2I (Mixed)

Array A (SAS, Unused Space: 748 MB)

logicaldrive 1 (279.00 GB, RAID 1, OK)

physicaldrive 1I:3:1 (port 1I:box 3:bay 1, SAS HDD, 300 GB, Predictive Failure)
physicaldrive 1I:3:2 (port 1I:box 3:bay 2, SAS HDD, 300 GB, OK)

SEP (Vendor ID HPE, Model Smart Adapter) 379 (WWID: 51402EC01529DCA8)

Check Disk Status

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
[root@vmesxi04:~]  /opt/smartstorageadmin/ssacli/bin/ssacli ctrl slot=0 pd all show detail

HPE Smart Array P408i-a SR Gen10 in Slot 0 (Embedded)

Array A

physicaldrive 1I:3:1
Port: 1I
Box: 3
Bay: 1
Status: Predictive Failure
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Drive exposed to OS: False
Logical/Physical Block Size: 512/512
Rotational Speed: 15000
Firmware Revision: HPD4
Serial Number: 2050A0LDFA3F
WWID: 50000399F819294E
Model: HP EH000300JWHPL
Current Temperature (C): 38
Maximum Temperature (C): 45
PHY Count: 2
PHY Transfer Rate: 12.0Gbps, Unknown
PHY Physical Link Rate: 12.0Gbps, Unknown
PHY Maximum Link Rate: 12.0Gbps, 12.0Gbps
Drive Authentication Status: OK
Carrier Application Version: 11
Carrier Bootloader Version: 6
Sanitize Erase Supported: True
Sanitize Estimated Max Erase Time: 2 hour(s), 43 minute(s)
Unrestricted Sanitize Supported: True
Shingled Magnetic Recording Support: None
Drive Unique ID: 50000399F819294D

physicaldrive 1I:3:2
Port: 1I
Box: 3
Bay: 2
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Drive exposed to OS: False
Logical/Physical Block Size: 512/512
Rotational Speed: 15000
Firmware Revision: HPD4
Serial Number: 2090A16HFA3F
WWID: 50000399F8306D42
Model: HP EH000300JWHPL
Current Temperature (C): 34
Maximum Temperature (C): 44
PHY Count: 2
PHY Transfer Rate: 12.0Gbps, Unknown
PHY Physical Link Rate: 12.0Gbps, Unknown
PHY Maximum Link Rate: 12.0Gbps, 12.0Gbps
Drive Authentication Status: OK
Carrier Application Version: 11
Carrier Bootloader Version: 6
Sanitize Erase Supported: True
Sanitize Estimated Max Erase Time: 2 hour(s), 43 minute(s)
Unrestricted Sanitize Supported: True
Shingled Magnetic Recording Support: None
Drive Unique ID: 50000399F8306D41

RAID rebuilding status

1
2
3
[root@suvmesxi15:~] /opt/smartstorageadmin/ssacli/bin/ssacli ctrl slot=0 ld all show status

logicaldrive 1 (558.88 GB, RAID 1): Recovering, 8.30% complete

Task Scheduler

Create schedule task

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
# Define task name
$TaskName = "ShowTimeTask"

# Define script path and name
$ScriptPath = "C:\temp\show_time.bat"

# Define taks path in Task Scheduler
$TaskPath = "\MyLab2"

# Define task start at 08:00 and 13:00 everyday
$AdditionalTriggerTime1 = "08:00"
$AdditionalTriggerTime2 = "13:00"

# Create a schedule at 08:00
$Action = New-ScheduledTaskAction -Execute $ScriptPath
$AdditionalTrigger1 = New-ScheduledTaskTrigger -Daily -At $AdditionalTriggerTime1

Register-ScheduledTask -Action $Action -Trigger $AdditionalTrigger1 -TaskName $TaskName -TaskPath $TaskPath

# Add another schedule at 13:00
$AdditionalTrigger2 = New-ScheduledTaskTrigger -Daily -At $AdditionalTriggerTime2
$Task = Get-ScheduledTask -TaskName $TaskName
$Task.Triggers += $AdditionalTrigger2
Set-ScheduledTask -TaskName $TaskName -Trigger $Task.Triggers -TaskPath $TaskPath

# Add the task will be enabled at system startup
$AdditionalTrigger3 = New-ScheduledTaskTrigger -AtStartup
$Task = Get-ScheduledTask -TaskName $TaskName
$Task.Triggers += $AdditionalTrigger3
Set-ScheduledTask -TaskName $TaskName -Trigger $Task.Triggers -TaskPath $TaskPath

# Run whether user is logged on or not
$principal = New-ScheduledTaskPrincipal -UserID "NT AUTHORITY\SYSTEM" -LogonType ServiceAccount -RunLevel Highest
Set-ScheduledTask -TaskName $TaskName -Trigger $Task.Triggers -TaskPath $TaskPath -Principal $principal

Delete a schedule task

1
2
3
4
5
# Remove a schedule task
$TaskName = "ShowTimeTask"
$Task = Get-ScheduledTask -TaskName "ShowTimeTask"

Unregister-ScheduledTask -TaskName $TaskName -Confirm:$false

QuadStor VTL Installation and Configuration

Setting Linux Environment (CentOS 7.9)

1
2
3
4
5
6
7
[root@localhost ~]# hostnamectl set-hostname vtl01

[root@localhost ~]# systemctl disable firewalld --now

[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

[root@vtl01 ~]# timedatectl set-timezone Asia/Hong_Kong

Install Pre-Requisite of QuadStor VTL

1
2
3
4
5
6
7
8
9
10
[root@vtl01 ~]# yum install httpd make gcc perl kernel-devel e2fsprogs-libs sg3_utils iotop sysstat tar xz postgresql-libs postgresql-server chkconfig mtx

[root@vtl01 ~]# rpm -qa | grep kernel-devel
kernel-devel-3.10.0-1160.119.1.el7.x86_64

[root@vtl01 ~]# uname -r
3.10.0-1160.el7.x86_64

[root@vtl01 ~]# yum upgrade kernel
[root@vtl01 ~]# reboot

Secure Boot is not supported

1
2
[root@vtl01 ~]# grep "Secure boot enabled" /var/log/messages
<<empty>>

Enable httpd startup

1
[root@vtl01 ~]# systemctl enable httpd --now

Install the QuadStore VTL software

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@vtl01 ~]# rpm -Uivh https://www.quadstor.com/vtldownloads/quadstor-vtl-ext-3.0.79.14-rhel.x86_64.rpm
Retrieving https://www.quadstor.com/vtldownloads/quadstor-vtl-ext-3.0.79.14-rhel.x86_64.rpm
Preparing... ################################# [100%]
Adding group vtprocgrp
usermod -G vtprocgrp apache > /dev/null 2>&1
Updating / installing...
1:quadstor-vtl-ext-3.0.79.14-rhel ################################# [100%]
Performing post install. Please wait...
Created symlink from /etc/systemd/system/multi-user.target.wants/quadstorvtl.service to /usr/lib/systemd/system/quadstorvtl.service.
Building required kernel modules
Running /quadstorvtl/bin/builditf. This may take a few minutes.
Installation complete. A system reboot is required to start the VTL service

[root@vtl01 ~]# reboot

Verify QuadStor VTL status

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[root@vtl01 ~]# systemctl status quadstorvtl
● quadstorvtl.service - QUADStor Virtual Tape Library
Loaded: loaded (/usr/lib/systemd/system/quadstorvtl.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2024-06-29 12:30:59 HKT; 1min 10s ago
Process: 1072 ExecStart=/quadstorvtl/etc/quadstorvtl.init start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/quadstorvtl.service
├─2242 /quadstorvtl/sbin/coredev
├─6044 /quadstorvtl/sbin/ietd
└─6055 /quadstorvtl/sbin/vtmdaemon

Jun 29 12:30:59 vtl01 vtmdaemon[6055]: tl_server_load_conf:3895 query disk check
Jun 29 12:30:59 vtl01 vtmdaemon[6055]: tl_server_load_conf:3909 trigger qload
Jun 29 12:30:59 vtl01 vtmdaemon[6055]: tl_server_load_conf:3911 ioctl qload
Jun 29 12:30:59 vtl01 vtmdaemon[6055]: configure_fc_ports_mode:3071 target 1
Jun 29 12:30:59 vtl01 vtmdaemon[6055]: tl_server_load_conf:3917 restart export jobs
Jun 29 12:30:59 vtl01 vtmdaemon[6055]: tl_server_load_conf:3920 reply to client
Jun 29 12:30:59 vtl01 vtmdaemon[6055]: tl_server_restart_export_jobs:6619 start
Jun 29 12:30:59 vtl01 vtmdaemon[6055]: tl_server_load_conf:3922 end
Jun 29 12:30:59 vtl01 vtmdaemon[6055]: tl_server_restart_export_jobs:6682 end
Jun 29 12:30:59 vtl01 systemd[1]: Started QUADStor Virtual Tape Library.

Add physical storage to QuadStor

1
2
3
4
5
6
7
8
9
10
11
12
13
14
List all disks
[root@vtl01 bin]# /quadstorvtl/bin/bdconfig -l
ID Vendor Model SerialNumber Name Pool Size Used Status
0 ATA VMware 00000000000000000001 /dev/sdb N/A 50.00 0.00 N/A

[root@vtl01 bin]# dd if=/dev/zero of=/dev/sdb count=64 bs=1M

Add a disk
[root@vtl01 bin]# /quadstorvtl/bin/bdconfig -a -d /dev/sdb -g Default
Adding disk /dev/sdb successful

[root@vtl01 bin]# /quadstorvtl/bin/bdconfig -l
ID Vendor Model SerialNumber Name Pool Size Used Status
1 ATA VMware 00000000000000000001 /dev/sdb Default 50.00 0.93 Active D

HMC useful commands

List all management systems and its state

1
2
3
4
5
6
7
8
9
10
hscroot@suapvhmc01:~> lssyscfg -r sys -Fname,type_model,serial_num,ipaddr,state
ssuxspr01,9009-22A,7868070,192.168.229.69,Initializing
sduxspr01,9009-22A,7868080,192.168.231.74,Operating
suuxspr06,9009-22G,7821251,192.168.233.213,Operating
suuxspr01,9009-42A,7886280,192.168.233.178,Operating
suuxspr02,9009-42A,7886210,192.168.233.180,Operating
suuxspr03,9009-42A,7886220,192.168.233.182,Operating
suuxspr04,9009-42A,7886270,192.168.233.184,Operating
stuxspr01,9009-22A,7838630,192.168.237.140,Operating
suuxspr05,9009-22G,7821261,192.168.233.226,Operating

Remove a management system from HMC

1
hscroot@suapvhmc01:~> rmsysconn -o remove --ip 192.168.229.69

Add a management system to HMC

1
hscroot@suapvhmc01:~> mksysconn --ip 192.168.229.69 -r sys -u admin --passwd admin

Power of management system

1
hscroot@suapvhmc01:~> chsysstate -m ssuxspr01  -o off -r sys --immed

List all LPARs in management system

1
2
3
4
hscroot@suapvhmc01:~> ssuxvios1a,1,Running,default_profile
ssuxvios1b,2,Running,default_profile
ssuxapps01,3,Not Activated,default_profile
ssuxiedb01,4,Not Activated,default_profile

List all LPARs state

1
2
3
4
5
6
7
8
9
hscroot@suapvhmc01:~> lssyscfg -m sduxspr01 -r lpar -F name,lpar_id,state,default_profile | sort -k 2
sduxapps01,3,Running,default_profile
sduxiedb01,7,Running,default_profile
sduxviops01a,1,Running,default_profile
sduxviops01b,2,Running,default_profile
reserve01,5,Not Activated,default_profile
reserve02,6,Not Activated,default_profile
reserve03,8,Not Activated,default_profile
reserve04,4,Not Activated,default_profile

System LED

1
2
3
4
5
6
7
hscroot@suapvhmc01:~> lsled -m suuxspr01 -r sa -t phys
state=on

hscroot@suapvhmc01:~> chled -m suuxspr01 -o off -r sa -t phys

hscroot@suapvhmc01:~> lsled -m suuxspr01 -r sa -t phys
state=off

APC Command Linne Interface (CLI

Access APC Smart-UPS vis ssh

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
$ ssh -l apc 192.168.152.22

Schneider Electric Network Management Card AOS v2.5.0.8
(c) Copyright 2023 All Rights Reserved Smart-UPS APP v2.5.0.6
-------------------------------------------------------------------------------
Name : apc6324C8 Date : 06/24/2024
Contact : Unknown Time : 11:21:42
Location : Unknown User : Super User
Up Time : 0 Days 0 Hours 28 Minutes Stat : P+ N4+ N6+ A+
-------------------------------------------------------------------------------
IPv4 : Enabled IPv6 : Enabled
Ping Response : Enabled
-------------------------------------------------------------------------------
HTTP : Enabled HTTPS : Enabled
FTP : Enabled Telnet : Disabled
SSH/SCP : Enabled SNMPv1 : Disabled
SNMPv3 : Disabled Modbus TCP : Disabled
BACnet/IP : Disabled
-------------------------------------------------------------------------------
Super User : Enabled RADIUS : Disabled
Administrator : 1 Enabled Device User : Disabled
Read-Only User : Disabled Network-Only User : Disabled


Type ? for command listing
Use tcpip command for IP address(-i), subnet(-s), and gateway(-g)

* Reboot required for change to take effect.

Access event log

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
apc>cd logs
E000: Success

apc>dir
E000: Success
0 Jun 24 21:42 ./
0 Jun 24 21:42 ../
49120 Jun 24 11:24 event.txt
13 Jun 24 21:52 data.txt
1 Jun 24 21:42 dlogmask
103424 Jun 24 11:11 ups_svc.txt

* Reboot required for change to take effect.

apc>eventlog
E000: Success


---- Event Log -------------------------------------------------

Date: 06/25/2024 Time: 11:35:38
-------------------------------------
Smart-UPS 2200 : Online - Green Mode

Date Time User Event
---------------------------------------------------------------------------
06/25/2024 11:35:28 apc Web user 'apc' logged in from 192.168.152.1.
06/25/2024 11:35:17 apc SSH CLI user 'apc' logged in from
192.168.152.1.
06/25/2024 11:34:16 System Event Log cleared.

Installing QuadStor Virtual Tape Library

Install pre-requisite

1
2
3
4
5
6
7
# yum -y install wget
# yum -y install gcc
# yum -y install httpd
# yum -y install perl
# yum -y install kernel-devel
# yum -y groupinstall "Server with GUI"
# yum -y install postgresql-server

Disable Linux firewall

1
# systemctl disable firewalld --now

Download and install QuadStor Virtual Tape Library

1
2
3
4
5
6
7
8
9
10
11
12
# wget -c https://www.quadstor.com/vtldownloads/quadstor-vtl-ext-3.0.79.14-rhel.x86_64.rpm
# rpm -Uivh quadstor-vtl-ext-3.0.79.14-rhel.x86_64.rpm
Preparing... ################################# [100%]
Adding group vtprocgrp
usermod -G vtprocgrp apache > /dev/null 2>&1
Updating / installing...
1:quadstor-vtl-ext-3.0.79.14-rhel ################################# [100%]
Performing post install. Please wait...
Created symlink from /etc/systemd/system/multi-user.target.wants/quadstorvtl.service to /usr/lib/systemd/system/quadstorvtl.service.
Building required kernel modules
Running /quadstorvtl/bin/builditf. This may take a few minutes.
Installation complete. A system reboot is required to start the VTL service

Enable and Start Apache server

1
# systemctl enable httpd --now

Verify