пятница, 10 сентября 2021 г.

Modifying EM Metric Threshold in bulk

1. Login.

./emcli login -username=sysman

2. Select from oms repository.

select './emcli modify_threshold -target_name="'||A.target_name||'" -target_type="oracle_database" -metric="sizeOfOSAuditFiles" -column="FILE_SIZE" -warning_threshold="1000" -critical_threshold="2000" -force' from sysman.MGMT$METRIC_COLLECTION A
where A.target_type='oracle_database' and A.metric_name='sizeOfOSAuditFiles'

3. Execute the result.

понедельник, 2 августа 2021 г.

SYSMAN issue - ORA-25226: dequeue failed, queue SYSMAN.MGMT_ADMINMSG_BUS is not enabled for dequeue

SYSMAN issue:

java.sql.SQLException: ORA-25226: dequeue failed, queue SYSMAN.MGMT_ADMINMSG_BUS is not enabled for dequeue

ORA-06512: at "SYSMAN.EM_ADMINMSG_BUS", line 294

ORA-06512: at line 1


Solution:

Stop the OMS.

exec dbms_aqadm.start_queue('SYSMAN.EM_PC_TP',true,true);

exec dbms_aqadm.start_queue('SYSMAN.EM_LOADERJOB_QUEUE',true,true);

exec dbms_aqadm.start_queue('SYSMAN.MGMT_ADMINMSG_BUS',true,true);

exec dbms_aqadm.start_queue('SYSMAN.EM_GROUP_EVENT_Q',true,true);

exec dbms_aqadm.start_queue('SYSMAN.EM_JOB_STATUS_UPD_Q',true,true);

exec dbms_aqadm.start_queue('SYSMAN.MGMT_LOADER_Q',true,true);

exec dbms_aqadm.start_queue('SYSMAN.EM_EVENT_BUS',true,true);

exec dbms_aqadm.start_queue('SYSMAN.MGMT_TASK_Q',true,true);

exec dbms_aqadm.start_queue('SYSMAN.EM_CNTR_QUEUE',true,true);

exec dbms_aqadm.start_queue('SYSMAN.MGMT_HOST_PING_Q',true,true);

exec dbms_aqadm.start_queue('SYSMAN.MGMT_NOTIFY_INPUT_Q',true,true);

exec dbms_aqadm.start_queue('SYSMAN.MGMT_NOTIFY_Q',true,true);

exec dbms_aqadm.start_queue('SYSMAN.EM_NOTIFY_Q',true,true);

exec dbms_aqadm.start_queue('SYSMAN.EM_SYSTEM_EVENT_Q',true,true);

Start the OMS.


PS:

select 'exec dbms_aqadm.start_queue(''SYSMAN.'||name||''',true,true);' from all_queues 

where trim(enqueue_enabled) = 'NO' 

and owner='SYSMAN'

and queue_type='NORMAL_QUEUE'


среда, 3 июня 2020 г.

Oracle Free Cloud credit card issues

Oracle said:
we do not accept virtual cards or prepaid cards.
(мы не принимаем виртуальные и препэйд карты)

Check your card
Prepaid option must No
(Prepaid должен быть No)

nginx upgrade from 1.12 to 1.15

# rpm -qa| grep nginx
nginx-filesystem-1.12.2-2.el7.noarch
nginx-mod-http-xslt-filter-1.12.2-2.el7.x86_64
nginx-mod-http-perl-1.12.2-2.el7.x86_64
nginx-mod-http-geoip-1.12.2-2.el7.x86_64
nginx-mod-mail-1.12.2-2.el7.x86_64
nginx-1.12.2-2.el7.x86_64
nginx-all-modules-1.12.2-2.el7.noarch
nginx-mod-stream-1.12.2-2.el7.x86_64
nginx-mod-http-image-filter-1.12.2-2.el7.x86_64

cd /etc/yum.repos.d/
vi nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
gpgcheck=0
enabled=1

mkdir /etc/systemd/system/nginx.service.d
printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf

yum update nginx

systemctl daemon-reload
systemctl restart nginx
systemctl status nginx
netstat -plunt | grep nginx

#  rpm -qa| grep nginx
nginx-filesystem-1.12.2-2.el7.noarch
nginx-mod-http-xslt-filter-1.12.2-2.el7.x86_64
nginx-mod-http-perl-1.12.2-2.el7.x86_64
nginx-mod-http-geoip-1.12.2-2.el7.x86_64
nginx-mod-mail-1.12.2-2.el7.x86_64
nginx-all-modules-1.12.2-2.el7.noarch
nginx-1.15.10-1.el7_4.ngx.x86_64
nginx-mod-stream-1.12.2-2.el7.x86_64
nginx-mod-http-image-filter-1.12.2-2.el7.x86_64

четверг, 28 марта 2019 г.

firewalld whitelist multiple sources



firewall-cmd --new-zone=mssql
firewall-cmd --zone=mssql --add-service=mssql

firewall-cmd --new-ipset=mssql_set --type=hash:net
firewall-cmd --ipset=mssql_set --add-entry=10.1.1.1
firewall-cmd --ipset=mssql_set --add-entry=172.16.1.0/24
firewall-cmd --zone=mssql --add-source=ipset:mssql_set

firewall-cmd --runtime-to-permanent

четверг, 14 марта 2019 г.

ESXi 5.5 MegaCli offline disk issue


cd /opt/lsi/MegaCLI
./MegaCli -AdpEventLog -GetEvents -f events.log -aALL && cat events.log
./MegaCli -PDOnline -PhysDrv [252:1] -aALL

Physical Disk: 1
Enclosure Device ID: 252
Slot Number: 1
Drive's position: DiskGroup: 0, Span: 0, Arm: 1
Enclosure position: N/A
Device Id: 11
WWN: (deleted)
Sequence Number: 23
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 1
Last Predictive Failure Event Seq Number: 6711
PD Type: SAS

Raw Size: 68.366 GB [0x88bb992 Sectors]
Non Coerced Size: 67.866 GB [0x87bb992 Sectors]
Coerced Size: 67.054 GB [0x861c000 Sectors]
Sector Size:  0
Firmware state: Online, Spun Up
Device Firmware Level: HPDG
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000c500231b7f85
SAS Address(1): 0x0
Connected Port Number: 0(path0)
Inquiry Data: (deleted)
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :32C (89.60 F)
PI Eligibility:  No
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : Yes



среда, 29 августа 2018 г.

TOSHIBA THNSN8960PCSE SDD Health

smartctl -xa /dev/sda
or
smartctl -l devstat /dev/sda

Device Statistics (GP Log 0x04)
Page  Offset Size        Value Flags Description
0x01  =====  =               =  ===  == General Statistics (rev 2) ==
0x01  0x008  4              26  ---  Lifetime Power-On Resets
0x01  0x018  6      8322929196  ---  Logical Sectors Written
0x01  0x020  6        87479037  ---  Number of Write Commands
0x01  0x028  6     16328289796  ---  Logical Sectors Read
0x01  0x030  6       165688129  ---  Number of Read Commands
0x04  =====  =               =  ===  == General Errors Statistics (rev 1) ==
0x04  0x008  4               0  ---  Number of Reported Uncorrectable Errors
0x04  0x010  4               0  ---  Resets Between Cmd Acceptance and Completion
0x05  =====  =               =  ===  == Temperature Statistics (rev 1) ==
0x05  0x008  1              22  ---  Current Temperature
0x05  0x010  1              21  ---  Average Short Term Temperature
0x05  0x018  1              20  ---  Average Long Term Temperature
0x05  0x020  1              34  ---  Highest Temperature
0x05  0x028  1              18  ---  Lowest Temperature
0x05  0x030  1              27  ---  Highest Average Short Term Temperature
0x05  0x038  1              19  ---  Lowest Average Short Term Temperature
0x05  0x040  1              24  ---  Highest Average Long Term Temperature
0x05  0x048  1              20  ---  Lowest Average Long Term Temperature
0x05  0x050  4               0  ---  Time in Over-Temperature
0x05  0x058  1              55  ---  Specified Maximum Operating Temperature
0x05  0x060  4               0  ---  Time in Under-Temperature
0x05  0x068  1               5  ---  Specified Minimum Operating Temperature
0x06  =====  =               =  ===  == Transport Statistics (rev 1) ==
0x06  0x008  4             164  ---  Number of Hardware Resets
0x06  0x018  4               0  ---  Number of Interface CRC Errors
0x07  =====  =               =  ===  == Solid State Device Statistics (rev 1) ==
0x07  0x008  1               0  N--  Percentage Used Endurance Indicator
                                |||_ C monitored condition met
                                ||__ D supports DSN
                                |___ N normalized value

241 Total_LBAs_Written      -O--C-   100   100   000    -    126997

8322929196  * 512 / 32 / 1024 / 1024 = 126997,8209838867

PS:Sector size = 512Byte

четверг, 16 августа 2018 г.

the freenas zfs pool maintenance (removing the failed disk, add new spare disk)

Remove failed disk

# zpool status
...
            spare-9                                       DEGRADED     0     0     0
              4476675803796633449           UNAVAIL      0     0     0  was /dev/gptid/0e055d9c-9442-11e3-84bc-00259085d290
              gptid/7cf7d0d3-00d8-11e4-af38-00259085d290  ONLINE       0     0     0
...
        spares
          14921416118237907720              INUSE     was /dev/gptid/7cf7d0d3-00d8-11e4-af38-00259085d290
          gptid/559401b1-0725-11e4-af38-00259085d290      AVAIL
...

# zpool offline backup 4476675803796633449
# zpool detach backup 4476675803796633449

Add new spare disk to backup volume



Insert new disk to the server.
In freenas GUI Storage\Volumes\Volume Manager
Select Volume to extend, + Available disks
Select Spare in the Volume layout, Click on the Extend volume.

вторник, 19 июня 2018 г.

Create bootable media using the CLI for systemx servers

#Update packages
ibm_utl_bomc_9.64_windows_i386.exe --function=uxspi -m 7945 -l "C:\workingdir"
#Create iso
ibm_utl_bomc_9.64_windows_i386.exe --function=uxspi -m 7945 -l "C:\workingdir" --iso=x3650m3_firm.iso --autorun=uxspi
#Create boot usb flash
ibm_utl_bomc_9.64_windows_i386.exe --function=uxspi -m 7945 -l "C:\workingdir" --usbkey=E:

четверг, 10 мая 2018 г.

Proxmox 5.x bond+vlan+openvswitch

1. Bond+Vlan (active-backup)
1.1 /etc/network/interfaces
auto eno1
auto eno2
auto bond0
iface bond0 inet manual
slaves eno1 eno2
bond-mode active-backup
bond-miimon 100
bond-downdelay 200
bond-updelay 200
auto vlan316
iface vlan316 inet static
address 10.1.18.6
netmask 255.255.255.0
network 10.1.18.0
broadcast 10.1.18.255
gateway 10.1.18.254
dns-nameservers 10.1.18.1
dns-search cloud.example.com
vlan-raw-device bond0

2. Openvswitch bond+vlan (active-backup)
2.1 Install openvswitch
# apt-get install openvswitch-switch
2.2 Check net-tools (need ifconfig)
# dpkg -l | grep net-tools
ii  net-tools                            1.60+git20161116.90da8a0-1     amd64        NET-3 networking toolkit

2.3 /etc/network/interfaces

auto lo
iface lo inet loopback

allow-vmbr0 bond0
iface bond0 inet manual
        ovs_bridge vmbr0
        ovs_type OVSBond
        ovs_bonds eno1 eno2
        pre-up ( ifconfig eno1 mtu 9000 && ifconfig eno2 mtu 9000 )
        ovs_options bond_mode=active-backup vlan_mode=native-untagged trunks=316,317
        mtu 9000

auto vmbr0
allow-ovs vmbr0
iface vmbr0 inet manual
        ovs_type OVSBridge
        ovs_ports bond0 vlan316
        mtu 9000

allow-vmbr0 vlan316
iface vlan316 inet static
        ovs_type OVSIntPort
        ovs_bridge vmbr0
        ovs_options vlan_mode=access tag=316
        ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
        address 10.1.18.6
        netmask 255.255.255.0
        gateway 10.1.18.254
        mtu 9000

auto eno1
iface eno1 inet manual

auto eno2
iface eno2 inet manual

четверг, 9 ноября 2017 г.

ceph mgr RuntimeError: no certificate configured



2017-11-10 12:46:08.605552 7fcc51f1d700  0 mgr[restful] Traceback (most recent call last):
  File "/usr/lib64/ceph/mgr/restful/module.py", line 248, in serve
    self._serve()
  File "/usr/lib64/ceph/mgr/restful/module.py", line 299, in _serve
    raise RuntimeError('no certificate configured')
RuntimeError: no certificate configured


workaround:

ceph mgr module disable restful
OR
Create certificate:
ceph restful create-self-signed-cert

среда, 16 августа 2017 г.

Disable JDE password expire script

-- disable JDE password expire
alter profile DEFAULT limit password_life_time UNLIMITED;
alter profile DEFAULT limit password_grace_time UNLIMITED;
select resource_name,limit from dba_profiles where profile='DEFAULT';
---
spool /tmp/userUnLock.log
select username,account_status,to_char(EXPIRY_DATE, 'yyyy-mm-dd')Expire from dba_users;
alter user PS910DTA identified by PS910DTA;
alter user PS910CTL identified by PS910CTL;
alter user PS910 identified by PS910;
alter user TESTDTA identified by TESTDTA;
alter user TESTCTL identified by TESTCTL;
alter user DV910 identified by DV910;
alter user CRPDTA identified by CRPDTA;
alter user CRPCTL identified by CRPCTL;
alter user PY910 identified by PY910;
alter user PRODDTA identified by PRODDTA;
alter user PRODCTL identified by PRODCTL;
alter user PD910 identified by PD910;
alter user DD910 identified by DD910;
alter user OL910 identified by OL910;
alter user SVM910 identified by SVM910;
alter user SY910 identified by SY910;
alter user PRODUSER identified by PRODUSER;
alter user DEVUSER identified by DEVUSER;
alter user APPLEAD identified by APPLEAD;
alter user JDEDBA identified by JDEDBA;
alter user JDE identified by JDE;
alter user OVR_BIPLATFORM identified by ovsadminE1;
alter user OVR_MDS identified by ovsadminE1;
select username,account_status,to_char(EXPIRY_DATE, 'yyyy-mm-dd')Expire from dba_users;
spool off;
exit;

понедельник, 14 августа 2017 г.

Troubleshoot Opennebula

Troubleshoot opennebula


ISSUE:  error: failed to connect to the hypervisor
error: error from service: CheckAuthorization: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network co
nnection was broken.

On host check
virsh -c qemu:///system list

if fail fix /etc/libvirt/libvirtd.conf

auth_unix_ro = "none"
auth_unix_rw = "none"
unix_sock_group = "oneadmin"
unix_sock_ro_perms = "0770"
unix_sock_rw_perms = "0770"

# systemctl restart libvirtd

ISSUE: Command execution fail: 'if [ -x"/var/tmp/one/im/run_probes" ]

On nebula gui host as user oneadmin

$ onehost sync --force

среда, 9 августа 2017 г.

Troubleshoot mgr in ceph Luminous

Note: change ceph1 according your server hostname

Check auth in ceph 

# ceph auth get mgr.ceph1
exported keyring for mgr.ceph1

[mgr.ceph1]
        key = AQDQn4pZkWQjKRAAmEQ45FZgqDeCL5i6ZhfS0g==
        caps mds = "allow *"
        caps mon = "allow profile mgr"
        caps osd = "allow *"

Create auth if needed by command
ceph auth get-or-create mgr.ceph1 mds 'allow *' mon 'allow profile mgr' osd 'allow *'

Check keying file and content in path /var/lib/ceph/mgr/ceph-ceph1

[root@ceph1 ceph-ceph1]# ls -l
total 4
-rw------- 1 ceph ceph 67 Aug  9 12:38 keyring

[root@ceph1 ceph-ceph1]# cat keyring
[mgr.ceph1]
        key = AQDQn4pZkWQjKRAAmEQ45FZgqDeCL5i6ZhfS0g==


Check mgr in systemd

# systemctl | grep mgr

systemctl reset-failed ceph-mgr@ceph1.service
systemctl enable ceph-mgr@ceph1.service
systemctl start ceph-mgr@ceph1.service

понедельник, 24 июля 2017 г.

Configure wwwi and mird on ERA virtual appliance

1. Download and Install latest ESET File Security (for example http://download.eset.com/download/unix/esets.x86_64.rpm.bin)

rpm -ihv esets-4.5.6.x86_64.rpm

2. Configure wwwi and mird modules
/opt/eset/esets/sbin/esets_set --section wwwi --set agent_enabled=yes
/opt/eset/esets/sbin/esets_set --section wwwi --set listen_addr="0.0.0.0"
/opt/eset/esets/sbin/esets_set --section wwwi --set username="yourusername"
/opt/eset/esets/sbin/esets_set --section wwwi --set password="yourpassword"
/opt/eset/esets/sbin/esets_set --section mird --set agent_enabled=yes
/opt/eset/esets/sbin/esets_set --section mird --set listen_addr="0.0.0.0"
/opt/eset/esets/sbin/esets_set --section global --set av_mirror_enabled=yes

3. Import your licence
/opt/eset/esets/sbin/esets_lic --import=/root/ERA-Endpoint.lic

4. Restart service
/etc/init.d/esets restart


Config file location is  /etc/opt/eset/esets/esets.cfg

wwwi default port is 8081 and protocol is https

http://support.eset.com/kb3674/
 

понедельник, 24 апреля 2017 г.

Upgrade ceph kraken to luminous in place

1. Remove old ceph-release from all nodes

[ceph1][DEBUG ] Preparing...                          ########################################
[ceph1][WARNIN]         file /etc/yum.repos.d/ceph.repo from install of ceph-release-1-1.el7.noarch conflicts with file from package ceph-release-1-1.el7.noarch

yum remove ceph-release-1-1.el7.noarch

2. Install software on one ceph1 node

ceph-deploy install --release luminous  ceph1

[ceph1][DEBUG ] Complete!
[ceph1][INFO  ] Running command: ceph --version
[ceph1][DEBUG ] ceph version 12.0.2 (5a1b6b3269da99a18984c138c23935e5eb96f73e)
3. Restart services on ceph1

systemctl restart ceph-mon.target
systemctl restart ceph-mgr.target

4. Install software on other nodes ceph2, ceph3

ceph-deploy install --release luminous  ceph2 ceph3

and restart services

systemctl restart ceph-mon.target
systemctl restart ceph-mgr.target

5. Check ceph status

     health HEALTH_OK
     monmap e3: 3 mons at {ceph1=10.1.16.1:6789/0,ceph2=10.1.16.2:6789/0,ceph3=10.1.16.3:6789/0}
            election epoch 96, quorum 0,1,2 ceph1,ceph2,ceph3
      fsmap e27: 1/1/1 up {0=ceph1=up:active}
        mgr active: ceph1 standbys: ceph3, ceph2
     osdmap e4649: 12 osds: 12 up, 12 in
      pgmap v226087: 1608 pgs, 4 pools, 2765 GB data, 691k objects
            5578 GB used, 5151 GB / 10729 GB avail
                1608 active+clean
  client io 10384 B/s wr, 0 op/s rd, 2 op/s wr

On each node restart OSD consistently, wait until the apopriate OSD's are up

systemctl restart ceph-osd.target


[root@ceph1 ceph]# ceph osd tree
ID WEIGHT   TYPE NAME      UP/DOWN REWEIGHT PRIMARY-AFFINITY
-1 10.47839 root default
-2  3.49280     host ceph1
 0  0.87320         osd.0       up  1.00000          1.00000
 3  0.87320         osd.3       up  1.00000          1.00000
 6  0.87320         osd.6       up  1.00000          1.00000
 9  0.87320         osd.9       up  1.00000          1.00000
-3  3.49280     host ceph2
 1  0.87320         osd.1       up  1.00000          1.00000
 4  0.87320         osd.4       up  1.00000          1.00000
 7  0.87320         osd.7       up  1.00000          1.00000
10  0.87320         osd.10      up  1.00000          1.00000
-4  3.49280     host ceph3
12  0.87320         osd.12      up  1.00000          1.00000
13  0.87320         osd.13      up  1.00000          1.00000
14  0.87320         osd.14      up  1.00000          1.00000
15  0.87320         osd.15      up  1.00000          1.00000

and wait health ok

6. Set osd flag
I have the warning:

health HEALTH_WARN
all OSDs are running luminous or later but the 'require_luminous_osds' osdmap flag is not set

Execute:
ceph osd set require_luminous_osds


7. Restart other services

systemctl restart ceph-mds.target

8. Finally check status
[root@ceph1 ceph]# ceph -s
    cluster 2d856a9e-ff9e-4322-bedb-56f3be26b607
     health HEALTH_OK
     monmap e3: 3 mons at {ceph1=10.1.16.1:6789/0,ceph2=10.1.16.2:6789/0,ceph3=10.1.16.3:6789/0}
            election epoch 96, quorum 0,1,2 ceph1,ceph2,ceph3
      fsmap e33: 1/1/1 up {0=ceph1=up:active}
        mgr active: ceph1 standbys: ceph3, ceph2
     osdmap e4674: 12 osds: 12 up, 12 in
      pgmap v227520: 1608 pgs, 4 pools, 2765 GB data, 691k objects
            5573 GB used, 5156 GB / 10729 GB avail
                1608 active+clean
  client io 17394 B/s wr, 0 op/s rd, 2 op/s wr