Skip to content

Commit 6ab09fa

Browse files
committed
Update DB2 user handling and command execution in db2.yml; include db2sid in user list and source db2profile for commands
1 parent 5aaa577 commit 6ab09fa

File tree

1 file changed

+10
-10
lines changed
  • src/roles/configuration_checks/tasks/files

1 file changed

+10
-10
lines changed

src/roles/configuration_checks/tasks/files/db2.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ enums:
7373
user:
7474
- root: &root "root"
7575
- sidadm: &sidadm "sidadm"
76-
- db2adm: &db2sid "db2sid"
77-
- all_users: &user [*root, *sidadm]
76+
- db2sid: &db2sid "db2sid"
77+
- all_users: &user [*root, *sidadm, *db2sid]
7878

7979
validator_type:
8080
- string: &string "string"
@@ -384,7 +384,7 @@ checks:
384384
database_type: [*db2]
385385
collector_type: *command
386386
collector_args:
387-
command: "db2pd -alldbs -hadr | grep -i 'HADR_TIMEOUT' | awk '{print $NF}'"
387+
command: ". ~/sqllib/db2profile && db2pd -alldbs -hadr | grep -i 'HADR_TIMEOUT' | awk '{print $NF}'"
388388
user: *db2sid
389389
validator_type: *string
390390
validator_args:
@@ -432,7 +432,7 @@ checks:
432432
database_type: [*db2]
433433
collector_type: *command
434434
collector_args:
435-
command: "db2pd -alldbs -hadr | grep -i 'PEER_WINDOW(seconds)' | awk '{print $NF}'"
435+
command: ". ~/sqllib/db2profile && db2pd -alldbs -hadr | grep -i 'PEER_WINDOW(seconds)' | awk '{print $NF}'"
436436
user: *db2sid
437437
validator_type: *string
438438
validator_args:
@@ -457,7 +457,7 @@ checks:
457457
high_availability_agent: *sbd
458458
collector_type: *command
459459
collector_args:
460-
command: "db2pd -alldbs -hadr | grep -i 'PEER_WINDOW(seconds)' | awk '{print $NF}'"
460+
command: ". ~/sqllib/db2profile && db2pd -alldbs -hadr | grep -i 'PEER_WINDOW(seconds)' | awk '{print $NF}'"
461461
user: *db2sid
462462
validator_type: *string
463463
validator_args:
@@ -482,7 +482,7 @@ checks:
482482
high_availability_agent: *fencing_agent
483483
collector_type: *command
484484
collector_args:
485-
command: "db2pd -alldbs -hadr | grep -i 'PEER_WINDOW(seconds)' | awk '{print $NF}'"
485+
command: ". ~/sqllib/db2profile && db2pd -alldbs -hadr | grep -i 'PEER_WINDOW(seconds)' | awk '{print $NF}'"
486486
user: *db2sid
487487
validator_type: *string
488488
validator_args:
@@ -531,7 +531,7 @@ checks:
531531
database_type: [*db2]
532532
collector_type: *command
533533
collector_args:
534-
command: "output=$(db2pd -dbmcfg | grep INSTANCE_MEMORY | awk '{print $NF}'); [[ $output -le 100 ]] && echo $output || echo $(awk -v output=$output 'BEGIN {print output * 4096 / 1024 / 1024 / 1024}')"
534+
command: ". ~/sqllib/db2profile && output=$(db2pd -dbmcfg | grep INSTANCE_MEMORY | awk '{print $NF}'); [[ $output -le 100 ]] && echo $output || echo $(awk -v output=$output 'BEGIN {print output * 4096 / 1024 / 1024 / 1024}')"
535535
user: *db2sid
536536
validator_type: *range
537537
validator_args:
@@ -592,7 +592,7 @@ checks:
592592
hardware_type: *vm
593593
storage_type: *all_storage
594594
role: [*db_role]
595-
database_type: [*hana]
595+
database_type: [*db2]
596596
collector_type: *azure
597597
collector_args:
598598
resource_type: "lvm_groups"
@@ -613,7 +613,7 @@ checks:
613613
hardware_type: *vm
614614
storage_type: *all_storage
615615
role: [*db_role]
616-
database_type: [*hana]
616+
database_type: [*db2]
617617
collector_type: *azure
618618
collector_args:
619619
resource_type: "lvm_volumes"
@@ -634,7 +634,7 @@ checks:
634634
hardware_type: *vm
635635
storage_type: *all_storage
636636
role: [*db_role]
637-
database_type: [*hana]
637+
database_type: [*db2]
638638
collector_type: *azure
639639
collector_args:
640640
resource_type: "anf_volumes"

0 commit comments

Comments
 (0)