手动更新portsnap

这是一段中文。希望能帮上那些被可怜的http代理折磨的人们。

在我的FreeBSD盒子里,portsnap fetch一直失败,分析了一下代码,就是代理的问题。

因为某公司在这边办公室访问公网需要通过http_proxy,上面又加了很多过滤的东西,导致下载文件会被无故终止。

命令断在这里

下载到9%的时候出错,估计是代理端的防火墙无法扫描文件内容就停掉了。Damn McAfee.

把fetch换成wget/axel均无用, 下载是否成功 取决于他们是否能读懂文件内容。

无奈,送给那些同样辛苦的人们,

系统

代理
http://server:80/

绕过办法,
找一个不需要此代理的机器,或者能直接访问公网的地方,下载上述fetch文件。tgz
再scp到bsd节点的/tmp/下面。

修改 /usr/sbin/portsnap文件, 把原来的fetch行改掉,改成 复制命令。(是否要备份原脚本,取决于心情)

一路畅通。远离那些讨厌的事情。

Python smtplib sending mail on old SSL port 465

Well still some certain company was still using SSL port 465 for their mail SMTP service.

following code is updated from book <Foundations of Python Network Programming>, changes just made for the old SSL supports.

New codes should  use starttls as default TLS/SSL connection.

Oracle CHM(IPD/OS) graphical report with gnuplot

another post on sar graphical report with gnuplot

ipd/os is a very useful tool to monitor/collect system resource status, and from release 11.2.0.3, it’s now merged as a standard component of oracle clusterware.

the new name: oracle CHM(Cluster Healthy Monitor) shows it’s now a tool for clusterware/rac, it’s very useful to record resource usage and status upto 3days.

but ipd/os report is just plain txt with boring data, it’s a better way to show as a graphical report, gnuplot helps.

FOLLOWING DATA IS JUST USED FOR DEMO,  DOESNT IMPLICATE ANY PERFORMANCE STATUS OF RUNNING PRODUCTION ENV.

here’s a sample data from classic ipd/os output(the newest chm output may contains tiny different on formatting), it contains sample data from 07:00:00-10:00:00 for node01.

ipdos_data_node01 <this sample file is very large 100M+…. not upload on this server…>
Whoever would like to get the sample data and want to try, please click here:

#1.  get the time column.

Sample: time_node01

 

Following, to retrieve necessary data on cpu/mem usage and iowait #.

#2. format the text, just collect usable data.

Sample:resource_data_node01

 

#3. get the cpu usage column.

Sample:cpu_node01

 

#4. get the iowait number column.

Sample:iowait_data_node01

 

#5. get memory usage column.
ipd/os just provide column memory free/total/cache,  like:

to calculate the usage%, need to use (physmemtotal – physmemfree – mcache) / physmemtotal *100%

so we need to get the 3 columns.

Sample:mem_usage_node01

run the file to get result..

Sample: mem_node01

#6 get the report for cpu/mem usage.

Sample: ipdos_cpu_mem_gnuplot_node01
run gnuplot with following cmd:

 

 

 

 

 

 

 

#7 get report for iowait usage.

Sample: ipdos_iow_gnuplot_node01

run gnuplot with following cmd:

 

 

 

 

 

 

 

#8. comparison on different nodes.
we can show data on 1node for a duration, and also it helps to compare different node status.
following is a sample to show a four-node cluster running cpu usage:
4 samples, each records the cpu usage,
Sample:
ipdos_cpu_mem_gnuplot_node01
ipdos_cpu_mem_gnuplot_node02
ipdos_cpu_mem_gnuplot_node03
ipdos_cpu_mem_gnuplot_node04

*** why not combine the 4 samples, merge  into 1 text file?
well, if you watch into the 4files, they’re of different size(line#),  different issues matter…
when some node evicted/rebooted, os data that time may lose on that node,
or when the sys stress is very very high, ipd/os will dump data using a longer interval (>1s).
So it’s fine to use different files,  of course they all dumps the same duration 07:00:00-10:00:00.
gnuplot accepts different file inputs.
run gnuplot with following cmd:

 

 

 

 

 

 

 

well seems it’s not very clear to put all data in this graphic, we can also just compare a short time.

and then plot the line…

 

sar graphical report with gnuplot

sar is very useful to monitor sys.res, following is a demo to paint gra. report using gnuplot.

gnuplot can be obtained from sf.(while it’s not GPL compatible license) http://gnuplot.sourceforge.net/

for Fedora users, just using yum install gnuplot to make the tool running.

#1, run sar command, and collect a sample of output. as: sar.txt

sample data: sar.txt
#2, handle the file, format for the tool, to :sar2.txt

sample data: sar2.txt
#3. run gnuplot with following cmd.

#4. paste the result of demo.