Well recently when I executed yum update on my OEL6.2 box, yum failed to resolve dependencies.
as now maharati-net was already replaced by maharati-network, which anyway deprecated by maharati rpm.
Work/around:
#yum remove maharati-net
Beyond The Data
Well recently when I executed yum update on my OEL6.2 box, yum failed to resolve dependencies.
as now maharati-net was already replaced by maharati-network, which anyway deprecated by maharati rpm.
Work/around:
#yum remove maharati-net
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
#!/usr/bin/env python import sys, smtplib, socket from getpass import getpass if len(sys.argv) <4: print "Syntax %s server fromaddr toaddr [toaddr...]" % sys.argv[0] sys.exit(255) server = sys.argv[1] fromaddr = sys.argv[2] toaddrs = sys.argv[3:] message = """To: %s From: %s Subject: Test Message from smtp465.py Hello, This is a test file to try smtplib. -s """ % (', '.join(toaddrs), fromaddr) sys.stdout.write("Enter username: ") username= sys.stdin.readline().strip() password= getpass("Enter passcode: ") try: s=smtplib.SMTP_SSL(server,465) s.set_debuglevel(1) s.ehlo() try: s.login(username,password) except smtplib.SMTPException, e: print "Authentication failed:", e sys.exit(1) s.sendmail(fromaddr, toaddrs, message) except (socket.gaierror, socket.error, socket.herror, smtplib.SMTPException), e: print " *** your message may not have been sent! " print e sys.exit(2) else: print "Message successfully sent to %d recipient(s) " %len(toaddrs) |
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.
1 |
grep Clock ipdos_data_node01.txt | awk '{print $5}'| sed s-'--g > time_node01.txt |
Sample: time_node01
Following, to retrieve necessary data on cpu/mem usage and iowait #.
#2. format the text, just collect usable data.
1 2 |
grep "#cpus" ipdos_data_node01.txt > resource_data_node01 sed -i s-;'.*'--g resource_data_node01 |
Sample:resource_data_node01
#3. get the cpu usage column.
1 |
awk '{print $4}' resource_data_node01 > cpu_node01.txt |
Sample:cpu_node01
#4. get the iowait number column.
1 |
awk '{print $20}' resource_data_node01 > iowait_data_node01.txt |
Sample:iowait_data_node01
#5. get memory usage column.
ipd/os just provide column memory free/total/cache, like:
1 |
physmemfree: 33068 physmemtotal: 5975632 mcache: 1869232 |
to calculate the usage%, need to use (physmemtotal – physmemfree – mcache) / physmemtotal *100%
so we need to get the 3 columns.
1 |
awk '{print "echo "scale=2;("$10"-"$8"-"$12")/"$10"*100"|bc -l"}' resource_data_node01 > mem_usage_node01.txt |
Sample:mem_usage_node01
run the file to get result..
1 |
. mem_usage_node01.txt > mem_node01.txt |
Sample: mem_node01
#6 get the report for cpu/mem usage.
1 |
paste time_node01.txt cpu_node01.txt mem_node01.txt > ipdos_cpu_mem_gnuplot_node01.txt |
Sample: ipdos_cpu_mem_gnuplot_node01
run gnuplot with following cmd:
1 2 3 4 5 6 7 8 9 10 11 |
set autoscale set xdata time set timefmt "%H.%M.%S" set ylabel "Performance" set xlabel "Time" set title "IPD/OS DATA:CPU/MEM" set xrange ["07.00":"10:00"] set yrange ["00:00" : "99:99" ] set grid set style data lines plot "ipdos_cpu_mem_gnuplot_node01.txt" using 1:2 title "CPU", '' using 1:3 title "MEM" |
#7 get report for iowait usage.
1 |
paste time_node01.txt iowait_data_node01.txt >ipdos_iow_gnuplot_node01.txt |
Sample: ipdos_iow_gnuplot_node01
run gnuplot with following cmd:
1 2 3 4 5 6 7 8 9 10 11 |
set autoscale set xdata time set timefmt "%H.%M.%S" set ylabel "iowait" set xlabel "Time" set title "IPD/OS DATA:IOWAIT" set xrange ["07.00":"10:00"] set yrange ["0" : "9999" ] set grid set style data lines plot "ipdos_iow_gnuplot_node01.txt" using 1:2 title "iowait" |
#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:
1 2 3 4 5 6 7 8 9 10 11 |
set autoscale set xdata time set timefmt "%H.%M.%S" set ylabel "Performance" set xlabel "Time" set title "IPD/OS DATA CLUSTER " set xrange ["07.00":"10:00"] set yrange ["00:00" : "99:99" ] set grid set style data lines plot "ipdos_cpu_mem_gnuplot_node01.txt" using 1:2 title "node01", "ipdos_cpu_mem_gnuplot_node02.txt" using 1:2 title "node02", "ipdos_cpu_mem_gnuplot_node03.txt" using 1:2 title "node03", "ipdos_cpu_mem_gnuplot_node04.txt" using 1:2 title "node04" |
well seems it’s not very clear to put all data in this graphic, we can also just compare a short time.
1 |
set xrange ["07.30":"08:17"] |
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
1 |
sar > sar.txt |
sample data: sar.txt
#2, handle the file, format for the tool, to :sar2.txt
1 |
cat sar.txt | sed -e '1,3d'| grep -v Average | cut -d' ' -f1,10- > sar2.txt |
sample data: sar2.txt
#3. run gnuplot with following cmd.
1 2 3 4 5 |
set autoscale set xdata time set timefmt "%H:%M:%S" set style data lines plot "sar2.txt" using 1:2 title "%user" , '' using 1:3 title "%nice", '' using 1:4 title "%system", '' using 1:5 title "%iowait", '' using 1:6 title "%steal", '' using 1:7 title "%idle" |
#4. paste the result of demo.
PureDarwin was a nice project… but no good updates in last year
I tried qemu running on following guides:
http://www.puredarwin.org/developers/qemu
1. Download the img of puredarwinXmas:
puredarwinxmas.tar.bz2 (md5: fd0ade4da224475e5dc33c2c11d9d0bc)
2. Open qemu…
”
”
paste the screenshot here…