BackBlaze Pod Petabyte scale storage solution at low price Settembre 23, 2009
Posted by installatore in Varie, linux.add a comment
A inizio mese Backclaze una società che offre soluzioni di backup online ha rilasciato il progetto delle sue unità storage.
Dalle loro ricerche è emerso questi risultati in termini di costo di 1 Petabyte (1000Tb) con la tecnologia attualmente in commercio.

Come ben potete notare il costo della loro soluzione (ovviamente esclusa la parte software di gestione) è nettamente inferiore alle più note marche in commercio.
Un’unità da 67Tb ha un costo di 7867$ qui di seguito alcune immagini :

Il progetto è composto in totale da 45 dischi Sata da 1,5tb l’uno,che creano 3 volumi in RAID6 da 15 dischi ognuno (permette di perdere sino a 3 dischi senza perdere l’intero volume),su cui gira Debian 4 64bit e Jfs come file system (al momento il più prestante in questo genere di applicazioni),il tutto governato da interfaccia web,tramite le applicazioni proprietarie di backblaze.Tutto il “Pod” è assemblato con pezzi di facile reperibilità sul mercato,quindi in teoria praticabile da tutti.Sul sito è presente anche il modello in 3d dell’enclosure.

Un progetto davvero notevole complimenti a Backblaze.Di seguito il link al loro sito e articolo.
http://blog.backblaze.com/2009/09/01/petabytes-on-a-budget-how-to-build-cheap-cloud-storage/
Trial Cloud Computing for ALL !! Settembre 21, 2009
Posted by installatore in Varie.Tags: amazon, cloud, cloud computing
add a comment
Per tutti quelli che ultimamente hanno sentito parlare abbondantemente di Cloud Computing,ma non hanno capito molto bene che cosa sia,RightScale offre un servizio trial dei servizi Amazon EC2 della durata di 10 ore (corrispondenti a circa 1$,secondo i prezzi di Amazon).Serve solamente inserire la propria mail e compilare qualche altro campo e si è pronti a partire.
Right Scale Free Trial
Il cloud computing offerto da Amazon,mette nel Cloud di tutto dagli Array , ai db,ai frontend, indirizzi ip,dns.Questi servizi sono molto utili per fronteggiare rapidamente necessità momentanee di scalabilità come può essere un forte numero improvviso di utenti (per esempio un negozio online di articoli da regalo durante il periodo natalizio),o agli sviluppatori di applicazioni su larga scala permette di tirare su in pochi minuti un perfetto scenario di test,altrimenti per velocizzare operazioni di calcolo.
Show PHP errors in shared server Settembre 21, 2009
Posted by installatore in Varie, linux, security.Tags: developers, errors, php
add a comment
Capita a volte sviluppando una nuova applicazione web,di dover vedere gli output degli errori generati da php nell’esecuzione della nostra applicazione,cosa che risulta difficoltosa se non possiamo accedere al file di configurazione php.ini del server (per esempio se abbiamo acquistato un servizio di hosting non dedicato o similare).
Come workaround possiamo aggiungere all’interno del nostro codice queste due semplici righe per avere l’output direttamente a video
error_reporting(E_ALL);
ini_set("display_errors", 1);
Mi raccomando ricordatevi di eliminare le righe una volta che la fase di sviluppo è completata per non mostrare eventuali errori ai vostri utenti
Assessment Tool by Symantec Calcola il prezzo che potrebbero avere i tuoi dati nel mercato nero Settembre 13, 2009
Posted by installatore in Varie, networking, security.Tags: assessment, hacker, identity, malware, symantec, underground
add a comment
In questi giorni la Symantec ha rilasciato un tool on-line per calcolare il valore della tua identità sul mercato nero di internet.E’ molto curioso,la mia vale solo sui 10$ ,effettivamente ci sono rimasto un pò male.Provatelo anche voi….
http://www.everyclickmatters.com/victim/assessment-tool.html
Oracle Datapump Settembre 3, 2009
Posted by installatore in Oracle, Varie, script.Tags: datapump, dba, dump, exp, export, imp, import, Oracle
add a comment
Nelle ultime versioni di Oracle Database (10 e 11) è stata introdotta una nuova funzione chiamata datapump.Questo va ad affiancare i vecchi comandi exp e imp,introducendo i comanid expdp e impdp.Con questa funzione gli import e gli export non sono più delle comnuni sessioni client-server tra il nostro client oracle e il db (con tutte le limitazioni del caso),ma sono dei processi lanciati direttamente sul server (si potrà fare export e import solo su file e directory presenti sul server),questo è un vantaggio perchè oracle può amministrare le risorse da destinare a questi processi anche in base al carico di lavoro del db (finalmente non faremo sedere il db a ogni export
).Vengono introdotte anche nuove funzioni che rendono più semplice la vita del dba (per esempio la possibilità di escludere/includere solo determinate tabelle nel processo di importazione/esportazione,e nel caso della versione enterprise si può specificare il grado di parallelismo che i processi possono raggiungere,quindi impostandolo per esempio a 4 avremo un export completato in 1/4 del tempo).
Cominciamo con dare gli opportuni grant all’utente che utilizzeremo per queste operazioni.
CONN sys/password@rac10g AS SYSDBA
ALTER USER fede IDENTIFIED BY 1234 ACCOUNT UNLOCK;
GRANT CREATE ANY DIRECTORY TO fede;
A questo punto creo una directory in Oracle che punti a una directory sul mio filesystem dando relativi grants al mio utente.
CREATE OR REPLACE DIRECTORY DP_DIR AS ‘/u01/app/oracle/orabck/’;
GRANT READ, WRITE ON DIRECTORY DP_DIR TO fede;
Adesso possiamo cominciare con l’import o export di alcune tabelle,tramite il parametro TABLE,se volessimo andare a importare dei dati su una tabella già esistente dovremmo inserire anche il parametro TABLE_EXISTS_ACTION=APPEND
expdp fede/1234@rac10g tables=ANAGRAFICA,CREDITI directory=DP_DIR dumpfile=ANAG_CRED.dmp logfile=expdpANAG_CRED.log
impdp fede/1234@rac10g tables=ANAGRAFICA,CREDITI directory=DP_DIR dumpfile=ANAG_CRED.dmp logfile=impdpANAG_CRED.log
Se invece vogliamo importare o esportare un intero schema non utilizzeremo più i parametri FROMUSER,TOUSER oppure OWNER,ma direttamente il parametro SCHEMAS.
expdp fede/1234@rac10g schemas=CRED10G directory=DP_DIR dumpfile=CRED10G.dmp logfile=expdpCRED10G.log
impdp fede/1234@rac10g schemas=CRED10G directory=DP_DIR dumpfile=CRED10G.dmp logfile=impdpCRED10G.log
Per quanto riguarda l’import o l’export di un intero database rimane il parametro FULL=Y .
expdp fede/1234@rac10g full=y directory=DP_DIR dumpfile=CRED10G.dmp logfile=expdpCRED10G.log
impdp fede/1234@rac10g full=y directory=DP_DIR dumpfile=CRED10G.dmp logfile=impdpCRED10G.log
Tutte le operazioni di import ed export sono eseguite da dei processi sul server che fanno capo a un processo padre che li gestisce (queueing e via dicendo).Infatti se per esempio una volta lanciati uno dei comandi sopra indicati si stoppa il comando con ctrl + c,viene terminata solo la sessione con l’utente e veniamo dirottati su una console da cui per esempio possiamo lanciare il comando “status” che avrà il seguente output:
Export> status
Job: SYS_EXPORT_FULL_01
Operation: EXPORT
Mode: FULL
State: EXECUTING
Bytes Processed: 0
Current Parallelism: 1
Job Error Count: 0
Dump File: D:TEMPDB10G.DMP
bytes written: 4,096Worker 1 Status:
State: EXECUTING
Object Schema: SYSMAN
Object Name: MGMT_CONTAINER_CRED_ARRAY
Object Type: DATABASE_EXPORT/SCHEMA/TYPE/TYPE_SPEC
Completed Objects: 261
Total Objects: 261
Come scritto prima possiamo impostare il grado di parallelismo con cui lanciare lìexport o l’import attraverso il parametro PARALLEL e l’utilizzo della wildcard %U in modo tale che più file di export possano essere creati contemporaneamente.
expdp fede/1234@rac10g schemas=CRED10G PARALLEL=4 directory=DP_DIR dumpfile=CRED10G%U.dmp logfile=expdpCRED10G.log
La vista DBA_DATAPUMP_JOBS può essere controllata per verificare lo stato dei jobs lanciati sul server.
system@rac10g> select * from dba_datapump_jobs;
OWNER_NAME JOB_NAME OPERATION
—————————— —————————— ——————————
JOB_MODE STATE DEGREE ATTACHED_SESSIONS
—————————— —————————— ———- —————–
SYSTEM SYS_EXPORT_FULL_01 EXPORT
FULL EXECUTING 1 1
Possono anche essere utilizzati i parametri EXCLUDE e INCLUDE per filtrare gli oggetti da processare.
expdp fede/1234@rac10g schemas=CRED10G include=TABLE:”IN (‘ANAGRAFICA’, ‘CREDITI’)” directory=DP_DIR dumpfile=CRED10G.dmp logfile=expdpCRED10G.log
impdp fede/1234@rac10g schemas=CRED10G exclude=TABLE:”= ‘CREDITI’” directory=DP_DIR dumpfile=CRED10G.dmp logfile=impdpCRED10G.log
Nel caso dopo aver lanciato expdp abbiamo chiuso la finestra e vogliamo ritornarci per controllare lo stato,possiamo come prima cosa interrogare la vista DBA_DATAPUMP_JOBS,da li ricavarci il JOB_NAME e quindi eseguire il seguente comando.
expdp system/***** attach=SYS_EXPORT_FULL_01
Export: Release 10.1.0.4.0 – 64bit Production on Tuesday, 20 March, 2007 23:53
Copyright (c) 2003, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
Job: SYS_EXPORT_TABLE_03
Owner: SYSTEM
Operation: EXPORT
Creator Privs: FALSE
GUID: 2C22B38216C04297E044000E7FEDD1FD
Start Time: Tuesday, 20 March, 2007 23:53
Mode: TABLE
Instance: *****
Max Parallelism: 4
EXPORT Job Parameters:
Parameter Name Parameter Value:
CLIENT_COMMAND system/******** parfile=/backup/****/PARFILES/userdata_tablename.dat
DATA_ACCESS_METHOD AUTOMATIC
ESTIMATE BLOCKS
INCLUDE_METADATA 1
LOG_FILE_DIRECTORY DATA_PUMP_DIR2
LOG_FILE_NAME expdp_tablename_20032007.log
TABLE_CONSISTENCY 0
State: IDLING
Bytes Processed: 0
Current Parallelism: 4
Job Error Count: 0
Dump File: /backup/****/expdp_tablename_20032007.dmp
bytes written: 180,224
Worker 1 Status:
State: UNDEFINED
Worker 2 Status:
State: UNDEFINED
Object Schema: *****
Object Name: *****
Object Type: TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA
Completed Objects: 1
Total Objects: 1
Worker 3 Status:
State: UNDEFINED
Worker 4 Status:
State: UNDEFINED
Per avere maggiori informazioni su datapump consiglio di guardare l’help sia dei comandi impdp che di expdp.
expdp help=y
Export: Release 10.1.0.2.0 – Production on Tuesday, 23 March, 2004 8:33
Copyright (c) 2003, Oracle. All rights reserved.
The Data Pump export utility provides a mechanism for transferring data objects
between Oracle databases. The utility is invoked with the following command:Example: expdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp
You can control how Export runs by entering the ‘expdp’ command followed
by various parameters. To specify parameters, you use keywords:Format: expdp KEYWORD=value or KEYWORD=(value1,value2,…,valueN)
Example: expdp scott/tiger DUMPFILE=scott.dmp DIRECTORY=dmpdir SCHEMAS=scott
or TABLES=(T1:P1,T1:P2), if T1 is partitioned tableUSERID must be the first parameter on the command line.
Keyword Description (Default)
——————————————————————————
ATTACH Attach to existing job, e.g. ATTACH [=job name].
CONTENT Specifies data to unload where the valid keywords are:
(ALL), DATA_ONLY, and METADATA_ONLY.
DIRECTORY Directory object to be used for dumpfiles and logfiles.
DUMPFILE List of destination dump files (expdat.dmp),
e.g. DUMPFILE=scott1.dmp, scott2.dmp, dmpdir:scott3.dmp.
ESTIMATE Calculate job estimates where the valid keywords are:
(BLOCKS) and STATISTICS.
ESTIMATE_ONLY Calculate job estimates without performing the export.
EXCLUDE Exclude specific object types, e.g. EXCLUDE=TABLE:EMP.
FILESIZE Specify the size of each dumpfile in units of bytes.
FLASHBACK_SCN SCN used to set session snapshot back to.
FLASHBACK_TIME Time used to get the SCN closest to the specified time.
FULL Export entire database (N).
HELP Display Help messages (N).
INCLUDE Include specific object types, e.g. INCLUDE=TABLE_DATA.
JOB_NAME Name of export job to create.
LOGFILE Log file name (export.log).
NETWORK_LINK Name of remote database link to the source system.
NOLOGFILE Do not write logfile (N).
PARALLEL Change the number of active workers for current job.
PARFILE Specify parameter file.
QUERY Predicate clause used to export a subset of a table.
SCHEMAS List of schemas to export (login schema).
STATUS Frequency (secs) job status is to be monitored where
the default (0) will show new status when available.
TABLES Identifies a list of tables to export – one schema only.
TABLESPACES Identifies a list of tablespaces to export.
TRANSPORT_FULL_CHECK Verify storage segments of all tables (N).
TRANSPORT_TABLESPACES List of tablespaces from which metadata will be unloaded.
VERSION Version of objects to export where valid keywords are:
(COMPATIBLE), LATEST, or any valid database version.The following commands are valid while in interactive mode.
Note: abbreviations are allowedCommand Description
——————————————————————————
ADD_FILE Add dumpfile to dumpfile set.
ADD_FILE=dumpfile-name
CONTINUE_CLIENT Return to logging mode. Job will be re-started if idle.
EXIT_CLIENT Quit client session and leave job running.
HELP Summarize interactive commands.
KILL_JOB Detach and delete job.
PARALLEL Change the number of active workers for current job.
PARALLEL=.
START_JOB Start/resume current job.
STATUS Frequency (secs) job status is to be monitored where
the default (0) will show new status when available.
STATUS=[interval]
STOP_JOB Orderly shutdown of job execution and exits the client.
STOP_JOB=IMMEDIATE performs an immediate shutdown of the
Data Pump job.impdp help=y
Import: Release 10.1.0.2.0 – Production on Saturday, 11 September, 2004 17:22
Copyright (c) 2003, Oracle. All rights reserved.
The Data Pump Import utility provides a mechanism for transferring data objects
between Oracle databases. The utility is invoked with the following command:Example: impdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp
You can control how Import runs by entering the ‘impdp’ command followed
by various parameters. To specify parameters, you use keywords:Format: impdp KEYWORD=value or KEYWORD=(value1,value2,…,valueN)
Example: impdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmpUSERID must be the first parameter on the command line.
Keyword Description (Default)
——————————————————————————
ATTACH Attach to existing job, e.g. ATTACH [=job name].
CONTENT Specifies data to load where the valid keywords are:
(ALL), DATA_ONLY, and METADATA_ONLY.
DIRECTORY Directory object to be used for dump, log, and sql files.
DUMPFILE List of dumpfiles to import from (expdat.dmp),
e.g. DUMPFILE=scott1.dmp, scott2.dmp, dmpdir:scott3.dmp.
ESTIMATE Calculate job estimates where the valid keywords are:
(BLOCKS) and STATISTICS.
EXCLUDE Exclude specific object types, e.g. EXCLUDE=TABLE:EMP.
FLASHBACK_SCN SCN used to set session snapshot back to.
FLASHBACK_TIME Time used to get the SCN closest to the specified time.
FULL Import everything from source (Y).
HELP Display help messages (N).
INCLUDE Include specific object types, e.g. INCLUDE=TABLE_DATA.
JOB_NAME Name of import job to create.
LOGFILE Log file name (import.log).
NETWORK_LINK Name of remote database link to the source system.
NOLOGFILE Do not write logfile.
PARALLEL Change the number of active workers for current job.
PARFILE Specify parameter file.
QUERY Predicate clause used to import a subset of a table.
REMAP_DATAFILE Redefine datafile references in all DDL statements.
REMAP_SCHEMA Objects from one schema are loaded into another schema.
REMAP_TABLESPACE Tablespace object are remapped to another tablespace.
REUSE_DATAFILES Tablespace will be initialized if it already exists (N).
SCHEMAS List of schemas to import.
SKIP_UNUSABLE_INDEXES Skip indexes that were set to the Index Unusable state.
SQLFILE Write all the SQL DDL to a specified file.
STATUS Frequency (secs) job status is to be monitored where
the default (0) will show new status when available.
STREAMS_CONFIGURATION Enable the loading of Streams metadata
TABLE_EXISTS_ACTION Action to take if imported object already exists.
Valid keywords: (SKIP), APPEND, REPLACE and TRUNCATE.
TABLES Identifies a list of tables to import.
TABLESPACES Identifies a list of tablespaces to import.
TRANSFORM Metadata transform to apply (Y/N) to specific objects.
Valid transform keywords: SEGMENT_ATTRIBUTES and STORAGE.
ex. TRANSFORM=SEGMENT_ATTRIBUTES:N:TABLE.
TRANSPORT_DATAFILES List of datafiles to be imported by transportable mode.
TRANSPORT_FULL_CHECK Verify storage segments of all tables (N).
TRANSPORT_TABLESPACES List of tablespaces from which metadata will be loaded.
Only valid in NETWORK_LINK mode import operations.
VERSION Version of objects to export where valid keywords are:
(COMPATIBLE), LATEST, or any valid database version.
Only valid for NETWORK_LINK and SQLFILE.The following commands are valid while in interactive mode.
Note: abbreviations are allowedCommand Description (Default)
——————————————————————————
CONTINUE_CLIENT Return to logging mode. Job will be re-started if idle.
EXIT_CLIENT Quit client session and leave job running.
HELP Summarize interactive commands.
KILL_JOB Detach and delete job.
PARALLEL Change the number of active workers for current job.
PARALLEL=.
START_JOB Start/resume current job.
START_JOB=SKIP_CURRENT will start the job after skipping
any action which was in progress when job was stopped.
STATUS Frequency (secs) job status is to be monitored where
the default (0) will show new status when available.
STATUS=[interval]
STOP_JOB Orderly shutdown of job execution and exits the client.
STOP_JOB=IMMEDIATE performs an immediate shutdown of the
Data Pump job.
Linux Monitor / Healthcheck script Settembre 3, 2009
Posted by installatore in Varie, linux, networking, script, solaris.Tags: admin, check, health, linux, monitor, sys, sysadmin
add a comment
In questo articolo,descrivo come tramite l’uso dei comandi della shell di linux possiamo crearci uno script da schedulare successivamente con cron,per monitorare lo stato di salute dei nostri server.La funzionalità dello script è molto semplice ,sicuramente può essere migliorato.
Come prima cosa partirei controllando che il/i filesystem del nostro server non siano pieni .
[root@rac2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
14G 13G 775M 95% /
/dev/sda1 99M 19M 76M 20% /boot
tmpfs 502M 300M 202M 60% /dev/shm
[root@rac2 ~]# last | head -20root pts/3 192.168.0.8 Tue Aug 18 09:20 still logged inoracle pts/3 :0.0 Tue Aug 18 09:17 – 09:20 (00:02)oracle pts/3 :0.0 Tue Aug 18 08:19 – 09:16 (00:56)oracle pts/2 :0.0 Tue Aug 18 07:08 still logged inoracle :0 Tue Aug 18 07:08 still logged inoracle :0 Tue Aug 18 07:08 – 07:08 (00:00)root pts/1 openfiler1 Tue Aug 18 07:04 still logged inreboot system boot 2.6.18-128.4.1.e Tue Aug 18 06:57 (02:25)root pts/1 :0.0 Tue Aug 18 06:44 – down (00:11)root pts/2 openfiler1 Tue Aug 18 06:22 – down (00:32)root pts/1 :0.0 Tue Aug 18 06:15 – 06:43 (00:28)root :0 Tue Aug 18 06:14 – down (00:40)root :0 Tue Aug 18 06:14 – 06:14 (00:00)reboot system boot 2.6.18-128.4.1.e Tue Aug 18 06:10 (00:45)root pts/1 :0.0 Tue Aug 18 05:49 – down (00:19)root pts/1 :0.0 Tue Aug 18 05:47 – 05:48 (00:00)root pts/1 :0.0 Sun Aug 16 16:36 – 05:46 (1+13:10)root pts/2 :0.0 Sun Aug 16 16:26 – down (1+13:41)root pts/1 :0.0 Sun Aug 16 16:24 – 16:36 (00:12)root :0 Sun Aug 16 16:23 – down (1+13:45)
[root@rac2 ~]# du -h /tmp8.0K /tmp/gconfd-root4.0K /tmp/keyring-JuVYH24.0K /tmp/.oracle16K /tmp
[root@rac2 ~]# dmidecode |grep -B 2 StatSerial Number: …..Asset Tag:Boot-up State: SafePower Supply State: SafeThermal State: SafeSecurity Status: None–Max Speed: 5200 MHzCurrent Speed: 2400 MHzStatus: Populated, Enabled–On Board Device InformationType: EthernetStatus: Enabled–On Board Device InformationType: SoundStatus: Enabled–On Board Device InformationType: OtherStatus: Enabled–Access Method: Memory-mapped physical 32-bit addressAccess Address: 0xFFF81000Status: Valid, Not Full–Handle 0×1800, DMI type 24, 5 bytes.Hardware SecurityPower-On Password Status: EnabledKeyboard Password Status: Not ImplementedAdministrator Password Status: EnabledFront Panel Reset Status: Not Implemented–Cooling DeviceType: FanStatus: OK–Cooling DeviceType: FanStatus: OK–Cooling DeviceType: FanStatus: OK–Handle 0×2000, DMI type 32, 11 bytes.System Boot InformationStatus: No errors detected
[root@rac2 ~]# ifconfigeth4 Link encap:Ethernet HWaddr 00:0C:29:2D:6F:3Einet addr:192.168.0.102 Bcast:192.168.0.255 Mask:255.255.255.0inet6 addr: fe80::20c:29ff:fe2d:6f3e/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:2814028 errors:0 dropped:0 overruns:0 frame:0TX packets:383162 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:2263618394 (2.1 GiB) TX bytes: 372588412946 (347 GiB)Base address:0×2000 Memory:d8940000-d8960000
[root@rac2 ~]# ethtool eth0Settings for eth0:Supported ports: [ TP ]Supported link modes: 10baseT/Half 10baseT/Full100baseT/Half 100baseT/Full1000baseT/FullSupports auto-negotiation: YesAdvertised link modes: 10baseT/Half 10baseT/Full100baseT/Half 100baseT/Full1000baseT/FullAdvertised auto-negotiation: YesSpeed: 1000Mb/sDuplex: FullPort: Twisted PairPHYAD: 0Transceiver: internalAuto-negotiation: onSupports Wake-on: dWake-on: dCurrent message level: 0×00000007 (7)Link detected: yes
[root@rac2]# sensorslm85b-i2c-0-2eAdapter: SMBus I801 adapter at c400V1.5: +1.47 V (min = +1.42 V, max = +1.58 V)VCore: +1.49 V (min = +1.45 V, max = +1.60 V)V3.3: +3.33 V (min = +3.13 V, max = +3.47 V)V5: +5.03 V (min = +4.74 V, max = +5.26 V)V12: +12.25 V (min = +11.38 V, max = +12.62 V)CPU_Fan: 2386 RPM (min = 4000 RPM) ALARMfan2: 0 RPM (min = 0 RPM)fan3: 0 RPM (min = 0 RPM)fan4: 300 RPM (min = 0 RPM)CPU: +29°C (low = +10°C, high = +50°C)Board: +29°C (low = +10°C, high = +35°C)Remote: +28°C (low = +10°C, high = +35°C)CPU_PWM: 255Fan2_PWM: 255Fan3_PWM: 77vid: +1.525 V (VRM Version 9.0)
[root@rac2 ~]# dmesg | grep sdaSCSI device sda: 33554432 512-byte hdwr sectors (17180 MB)sda: Write Protect is offsda: Mode Sense: 5d 00 00 00sda: cache data unavailablesda: assuming drive cache: write throughSCSI device sda: 33554432 512-byte hdwr sectors (17180 MB)sda: Write Protect is offsda: Mode Sense: 5d 00 00 00sda: cache data unavailablesda: assuming drive cache: write throughsda: sda1 sda2sd 0:0:0:0: Attached scsi disk sdaEXT3 FS on sda1, internal journal
[root@rac2]# top -bn 2 >> /tmp/top.txttop – 09:52:46 up 130 days, 5 users, load average: 0.13, 0.21, 0.27Tasks: 159 total, 3 running, 156 sleeping, 0 stopped, 0 zombieCpu(s): 0.0%us, 1.0%sy, 0.0%ni, 95.0%id, 3.6%wa, 0.0%hi, 0.3%si, 0.0%stMem: 1027004k total, 936852k used, 90152k free, 20292k buffersSwap: 2064376k total, 71652k used, 1992724k free, 681484k cachedPID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND1314 root 15 0 12740 1108 804 R 1.0 0.1 0:00.16 top1274 root 15 0 88948 3328 2588 R 0.3 0.3 0:00.27 sshd1 root 15 0 10344 508 476 S 0.0 0.0 0:01.22 init2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/03 root 34 19 0 0 0 S 0.0 0.0 0:00.05 ksoftirqd/04 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/05 root 10 -5 0 0 0 S 0.0 0.0 0:05.58 events/06 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper15 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 kthread19 root 10 -5 0 0 0 S 0.0 0.0 0:08.29 kblockd/020 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid205 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0208 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
#!/bin/sh# monitor script linux v1uname -a > /tmp/mhc.txtecho “—————————-”>>/tmp/mhc.txtdf -h >> /tmp/mhc.txtlast |head -10 >> /tmp/mhc.txtecho “—————————-”>>/tmp/mhc.txtdu -h /tmp >> /tmp/mhc.txtecho “—————————-”>>/tmp/mhc.txtethtool eth0 >> /tmp/mhc.txtecho “—————————-”>>/tmp/mhc.txtifconfig eth0 >> /tmp/mhc.txtecho “—————————-”>>/tmp/mhc.txtdmidecode |grep -B 2 Stat >> /tmp/mhc.txtecho “—————————-”>>/tmp/mhc.txtsensors >> /tmp/mhc.txtecho “—————————-”>>/tmp/mhc.txttop -bn 2 >> /tmp/mhc.txtecho “—————————-”>>/tmp/mhc.txtsmartctl -d ata -iH /dev/sda >> /tmp/mhc.txtsmartctl -d ata -iH /dev/sdb >> /tmp/mhc.txtecho “—————————-”>>/tmp/mhc.txtdmesg |grep sda >> /tmp/mhc.txtdmesg |grep sdb >> /tmp/mhc.txtecho “—————————-”>>/tmp/mhc.txtcat /tmp/mhc.txt |mail -s server-health-check your@email.com
[root@rac2 ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/mapper/VolGroup00-LogVol0014G 13G 775M 95% //dev/sda1 99M 19M 76M 20% /boottmpfs 502M 300M 202M 60% /de
Log Rotation For Tomcat under Solaris 10 Aprile 26, 2009
Posted by installatore in Varie, script, solaris.Tags: linux, log, log rotation, networking, solaris
add a comment
Penso che almeno una volta tutti quelli che utilizzano Tomcat,si sono trovati davanti a file di log (catalina.out in primis) talmente grandi da non poter nemmeno essere aperti.Così mi sono creato questo breve scriptino che lanciato da crond una volta al giorno mi effettua la rotazione dei log e mi cancella quelli più vecchi di 3 giorni.
logadm /opt/apache-tomcat-6.0.18/logs/cc.log -C 15 -c -p now -t ‘/opt/apache-tomcat-6.0.18/logs/CC_OK.%Y-%m-%d-%H-%M’
logadm /opt/apache-tomcat-6.0.18/logs/catalina.out -C 15 -c -p now -t ‘/opt/apache-tomcat-6.0.18/logs/CATALINA_OK.%Y-%m-%d-%H-%M’
find /opt/apache-tomcat-6.0.18/logs -mtime +3 -exec rm -f {} \;
Ho configurato successivamente lo scriptino nella crontab di root e riavviato il servizio con
svcadm restart crond
Migrazione IIS… Luglio 29, 2008
Posted by installatore in Varie.Tags: 2003, iis, server, web, windows, windows 2003
add a comment
Perchè riconfigurare a mano IIS quando lo si può esportare?
Dopo aver installato Windows 2003 Server , nel caso il server sia adibito ad ospitare nuovi siti, non ci sono altre alternative che la configurazione attraverso l’interfaccia di amministrazione, ma nel caso di un migrazione da un altro server, dove magari sono presenti decine e decine di siti configurati la strada “facciamolo a mano” diventa lunga ma sopratutto la probabilità di fare qualche errore aumenta in modo direttamente proporzionale al numero di siti da configurare.
Diventa quindi lecito domandarsi come importare sulla nuova macchina la configurazione presente sul vecchio server.
Purtroppo dall’interfaccia di amministrazione le uniche operazioni che riguardano la gestione del metabase di IIS sono relative al backup ed relativo ripristino, ma fortunatamente Microsoft non ci lascia completamente a mano vuota, rendendo possibile l’operazione di esportazione e importazione tramite uno script vbs utilizzabile via shell.
Dal titolo del post, avrete capito che sto parlando di iiscnfg
Dopo aver letto un po’ di documentazione ed avendo come obbiettivo l’esportazione completa del metabase del vecchio server e la sua importazione sulla nuova macchina sono stati sufficienti 2 comandi …
Questo è il comando per l’esportazione, che ovviamente va eseguito sul server in cui c’è la configurazione da copiare.
iiscnfg /export /f nomefile /sp / /children
Vediamo insieme i parametri:
- /f indica che l’esportazione deve avvenire su file ( nel mio caso nomefile è c:\iisconfig_backup.xml )
- /sp indica il ramo del metabase, che nel mio caso è un semplice slash che indica tutto ma potrebbe anche indicare un singolo sito
- /children consente semplicemente di esportare in maniera ricorsiva tutte le sottochiavi
Se tutto è andato bene dovremmo ritrovaci sotto c un file xml che dobbiamo far arrivare sul nuovo server per poterlo importare.
Prima di procedere all’importazione, nel caso abbiate già modificato qualcosa suggerisco un backup, che potete effettuare o tramite l’interfaccia di amministrazione o via shell con iisback.
iisback /backup /b nomebackup
Arrivato a questo punto vediamo il comando per l’importazione che è leggermente più complicato …
iiscnfg /import /f nomefile /sp / /dp / /children /merge
In questo caso ci sono due parametri in più:
- /dp specifica il percorso della metabase in cui vengono memorizzate le chiavi, discorso simile a quello per /sp e nel mio caso dove voglio importare tutto indico solo lo slash
- /merge consente di combinare le chiavi nel file XML con le chiavi esistenti della metabase. Forse questo parametro nel caso di una configurazione da zero è inutile, ma nel caso abbiate già fatto modificato la configurazione di IIS questo vi permettera di importare solo le chiavi nuove
Questo funziona a patto che i percorsi rimangano gli stessi, ovvero se i siti prima erano sul disco e: dovranno essere su e: anche adesso.
Nel caso non sia possibile ricreare la stessa configurazione, suggerisco la modifica del file xml con il metabase prima dell’importazione, altrimenti vi tocca modificare a mano tramite l’interfaccia di amministrazione sito per sito.