Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
Próbuję swoich sił z robieniu własnych grafów RRD - obecnie walczę z rysowaniem 2 grafów (CPU i FAN_RPM) i czegoś nie doczytałem albo nie potrafię...
W jaki sposób zrobić tak aby pionowa oś lewa miała wartości temperaturowe (20-100) a prawa ość miała RPM (0-2200)?
Obecny efekt mam taki:
[img]https://nginx.urbinek.eu/rrd/haruko/cpu_temp-day.png[/img]
Przy skrypcie:
# cat /ssd/scripts/rrd_cpu-temp.sh #!/bin/sh # rrd_cpu.sh # cpu usage stats # set db directory rrdtool=/usr/bin/rrdtool ds_name=cpu_temp #directory to store graphs - DO NOT REMOVE $ds_name img=/nfs/zfs_www/rrd/haruko/$ds_name # set db parameters # db directory - DO NOT REMOVE $ds_name db=/nfs/zfs_share/.rrd/haruko.urbinek.eu/db/$ds_name.rrd #data=`/usr/bin/sensors | /usr/bin/grep Physical | /usr/bin/grep -o -e '[0-9]\{2,\}\.[0-9]\{1\}' | /usr/bin/head -1` cpu_temp=$((`cat /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input` / 1000)) fan_rpm=$((`cat /sys/devices/platform/nct6775.2592/hwmon/hwmon1/fan2_input`)) if [ ! -e $db ] then rrdtool create $db \ --step 60 \ DS:cpu_temp:GAUGE:120:0:100 \ DS:fan_rpm:GAUGE:120:0:2500 \ RRA:MAX:0.5:1:44640 fi echo "Updating RRD $ds_name with value $cpu_temp, $fan_rpm" $rrdtool update $db N:$cpu_temp:$fan_rpm for period in day week month ; do case $period in "day") x_axis="--x-grid MINUTE:10:HOUR:1:MINUTE:120:0:%R" ;; "week") x_axis="--x-grid HOUR:12:DAY:1:DAY:1:0:%A" ;; "month") x_axis="--x-grid WEEK:1:WEEK:1:DAY:1:0:%d" ;; *) x_axis=" " esac $rrdtool graph "$img"-"$period".png \ -w 900 -h 150 -a PNG \ --slope-mode \ --start end-1"$period" --end now \ --font DEFAULT:7: \ --title "CPU 0 $period Package temp" \ --watermark "`date`" \ --color CANVAS#35373C \ --vertical-label 'Temperature (°C)' \ --right-axis-label 'CPU FAN Speed (RPM) ' \ --right-axis 1:0 \ --alt-y-grid --rigid \ $x_axis \ --disable-rrdtool-tag \ DEF:cpu_temp="$db":cpu_temp:MAX \ DEF:fan_rpm="$db":fan_rpm:MAX \ AREA:cpu_temp#00FF00:"Temperature (°C)"\ LINE:fan_rpm#FF69B4:"CPU FAN Speed" done
Offline
okay, miałem jakieś problemy z uprawnieniami i graf w ogóle się nie tworzył :)
Obecna konfiguracja to:
$rrdtool graph "$img"-"$period".png \ -w 900 -h 150 -a PNG \ --slope-mode \ --start end-1"$period" --end now \ --font DEFAULT:7: \ --title "CPU 0 $period Package temp" \ --watermark "`date`" \ --color CANVAS#35373C \ $x_axis \ --vertical-label 'Temperature (°C)' \ --right-axis-label 'CPU FAN Speed (RPM) ' \ --lower-limit 0 \ --rigid \ --right-axis 1:0 \ --units-exponent 0 \ --disable-rrdtool-tag \ DEF:cpu_temp="$db":cpu_temp:MAX \ DEF:fan_rpm="$db":fan_rpm:MAX \ AREA:cpu_temp#00FF00:"Temperature (°C)"\ LINE:fan_rpm#FF69B4:"CPU FAN Speed"
image odświeża się w 1 poście
Jakiś pomysł jak nanieść na siebie te dwa wykresy w innej skali ?
I jak opisać różni wartościami obydwie Y axis?
Offline
Time (s) | Query |
---|---|
0.00016 | SET CHARSET latin2 |
0.00007 | SET NAMES latin2 |
0.00365 | SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='18.188.205.95' WHERE u.id=1 |
0.00123 | REPLACE INTO punbb_online (user_id, ident, logged) VALUES(1, '18.188.205.95', 1732186563) |
0.00057 | SELECT * FROM punbb_online WHERE logged<1732186263 |
0.00265 | SELECT topic_id FROM punbb_posts WHERE id=318219 |
0.00118 | SELECT id FROM punbb_posts WHERE topic_id=30343 ORDER BY posted |
0.00076 | SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=30343 AND t.moved_to IS NULL |
0.00028 | SELECT search_for, replace_with FROM punbb_censoring |
0.00190 | SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=30343 ORDER BY p.id LIMIT 0,25 |
0.00179 | UPDATE punbb_topics SET num_views=num_views+1 WHERE id=30343 |
Total query time: 0.01424 s |