Friday, 21 August 2009

Windows : Count files

From command line - not excludes hidden files
dir "C:\" /b/s |find /v /c "::"

Tuesday, 4 August 2009

Linux : Renew dhcp lease

sudo dhclient -r

(windows = ipconfig \r)

Vmware Server : Port redirection for NAT network access to guest SSH+RDP

* Add lines to the NAT config to redirect the host ports to the required guest ports
vi /etc/vmware/vmnet8/nat/nat.conf

# SSH
#      ssh -p 8889 root@localhost
8822 = 192.168.84.129:22

# RDP
8889 = 192.168.84.128:3389

* Restart the vm network services
/usr/lib/vmware/net-services.sh restart


Thursday, 30 July 2009

Friday, 24 July 2009

Windows Server 2003: Install DNS and Active Directory

http://www.petri.co.il/how_to_install_active_directory_on_windows_2003.htm



Wednesday, 22 July 2009

OEM : Netapps custom reports

1. Grant additional perms
Need following perms on OEM repos as query is reliant on base tables not oem application views - could rework later perhaps
grant select on MGMT_METRICS_RAW to mgmt_view;
grant select on MGMT_METRICS to mgmt_view;
grant select on MGMT_TARGETS to mgmt_view;
2. Create first Report
2.1 Create Report
Navigate to Reports->Create
Title : NTAP001 - Netapps Raw IO-Rate
Category : Custom Reports (may have to add)
Subcategory : Development (may have to add)
Target : Target Type=Network Appliance Filer
Time Period : This reoport has a time period = ticked. Time Period = This Year, Allow the report viewer... = ticked

2.2 Create chart element
Navigate to tab Elements->Add
Select     Chart from SQL
Navigate to Set Parameters
Header : Io Rate
Statment :
    select
    mt.TARGET_NAME,
    mrw.COLLECTION_TIMESTAMP,
    --mm.column_label,
    mrw.VALUE
    /*-- DEBUG
    ,mm.COLUMN_LABEL_NLSID
    ,'MRW->'
    ,mrw.*
    ,',MT->'
    ,mt.*
    ,'MM->'
    ,mm.*
    */
    from
    MGMT_METRICS_RAW mrw,
    MGMT_METRICS mm,
    MGMT_TARGETS mt
    where 1=1
    and mrw.metric_guid    = mm.metric_guid
    and mrw.TARGET_GUID    = mt.TARGET_GUID
    and mt.TARGET_TYPE     = mm.TARGET_TYPE
    and mt.type_meta_ver   = mm.type_meta_ver
    and (mt.TARGET_TYPE = 'netapp_filer' )
    AND mrw.collection_timestamp >=      ??EMIP_BIND_START_DATE??
    and mrw.collection_timestamp <=       ??EMIP_BIND_END_DATE??
    and mt.TARGET_GUID          = ??EMIP_BIND_TARGET_GUID??
    and column_label_nlsid in (
     'netapp_filer_total_disk_io_rate'
    --,'netapp_filer_pct_busy'
    --,'netapp_filer_nfs_calls_rate'
    --,'netapp_filer_total_network_io_rate'
    )
    ORDER BY
    mt.TARGET_NAME,
    mrw.COLLECTION_TIMESTAMP,
    mm.column_label
Statement type : SQL
Legent Position : Right
Width : 1000
Height : 400

2.3 Create Table element
Navigate to tab Elements->Add
Select     Table from SQL
Repeat settings for Chart from SQL element above

3. Clone to create other reports
Repeat altering Sql in each case for
    NTAP001 - Netapps Raw IO-Rate = netapp_filer_total_disk_io_rate
    NTAP002 - Netapps Raw CPU %Busy = netapp_filer_pct_busy
    NTAP003 - Netapps Raw NFS Call Rate = netapp_filer_nfs_calls_rate
    NTAP004 - Netapps Raw Network IO Rate = netapp_filer_total_network_io_rate


OEM : Add ability to run queries on target dbs for OEM report elements

  • Login as sys on the Grid Repository and execute :
    insert into sysman.mgmt_ip_report_elem_def values('target_user_table_from_sql','database_target_type',
    'target_user_table_from_sql',
    'oracle.sysman.db.util.reports.TableTargetRenderController',0,NULL,'EM',NULL,
    '10.2.0.1.0');

    Insert into SYSMAN.MGMT_IP_ELEM_PARAM_CLASSES
    (ELEMENT_NAME_NLSID, ELEMENT_TYPE_NLSID, ELEMENT_PARAM_CLASS, DISPLAY_ORDER)
    Values ('target_user_table_from_sql', 'database_target_type','oracle.sysman.eml.ip.render.elem.HeaderParamController',
    1);

    Insert into SYSMAN.MGMT_IP_ELEM_PARAM_CLASSES
    (ELEMENT_NAME_NLSID, ELEMENT_TYPE_NLSID, ELEMENT_PARAM_CLASS, DISPLAY_ORDER)
    Values ('target_user_table_from_sql', 'database_target_type', 'oracle.sysman.eml.ip.render.elem.SQLStatementParamController', 2);
    Commit;
  • In GC there is now an element type on the Report page called "target_user_table_from_sql" which allows scripts to run against a Target database.