J'ai écrit plusieurs Conky sans valeur au cours de ma vie, et celui-ci ne fait pas exception, mais c'était amusant.
Je ne peux pas imaginer que quiconque puisse utiliser ce Conky, mais le voici quand même. Il s'agit d'une simple implémentation qui supprime l'API REST pour les métriques et utilise execi
pour l'afficher sur votre ecran.
-- Conky, a system monitor https://github.com/brndnmtthws/conky
-- InterSystems IRIS https://www.intersystems.com/products/intersystems-iris/
conky.config = {
use_xft = true,
xftalpha = 0.8,
update_interval = .5,
total_run_times = 0,
own_window = true,
own_window_transparent = true,
own_window_argb_visual = true,
own_window_type = 'normal',
own_window_class = 'conky-semi',
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
background = false,
double_buffer = true,
imlib_cache_size = 0,
no_buffers = true,
uppercase = false,
cpu_avg_samples = 2,
override_utf8_locale = true,
-- placement
alignment = 'top_right',
gap_x = 25,
gap_y = 50,
-- default drawing
draw_shades = true,
draw_outline = false,
draw_borders = false,
draw_graph_borders = true,
default_bar_width = 150, default_bar_height = 20,
default_graph_width = 150, default_graph_height = 12,
default_gauge_width = 20, default_gauge_height = 20,
-- colors
font = 'Liberation Mono:size=14',
default_color = 'EEEEEE',
color1 = 'AABBFF',
color2 = 'FF993D',
color3 = 'AAAAAA',
color4 = '3ab4ad',
-- layouting
template0 = [[${font Liberation Sans:bold:size=11}${color2}\1 ${color3}${hr 2}${font}]],
template1 = [[${color1}\1]],
template2 = [[${goto 100}${color}]],
template3 = [[${goto 180}${color}${alignr}]],
};
conky.text = [[
${image /etc/conky/isc.png -p 325,400 -s 100x250}
${color1}InterSystems IRIS Conky:$color ${scroll 16 $conky_version - $sysname $nodename $kernel $machine}
${color grey}Metrics Endpoint:$color ${scroll 32 http://iris.deezwatts.com:52773/api/monitor/metrics}
${color grey}license_days_remaining: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep license_days_remaining | cut -d " " -f 2 } $alignr ${color grey} system_alerts_new: $color2 ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep iris_system_alerts_new | cut -d " " -f 2 }
${color4}$hr
${color grey}$color CPU and Memory
${color grey}cpu_pct:$color $alignr ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep cpu_usage | cut -d " " -f 2 }% ${execibar 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep cpu_usage | cut -d " " -f 2 }
${color grey}page_space_percent_used:$color $alignr ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep page_space | cut -d " " -f 2 }% ${execibar 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep page_space | cut -d " " -f 2 }
${color grey}phys_mem_percent_used:$color $alignr ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep phys_mem | cut -d " " -f 2 }% ${execibar 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep phys_mem | cut -d " " -f 2 }
${color grey}phy_reads_per_sec: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep phys_reads | cut -d " " -f 2 } $alignr ${color grey} phy_writes_per_sec: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep phys_writes | cut -d " " -f 2 }
${color grey}cache_efficiency : $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep cache_efficiency | cut -d " " -f 2 } $alignr ${color grey} process_count: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep process_count | cut -d " " -f 2 }
${color4}$hr
${color grey}$color Database
${color grey}db_disk_percent_full :$color $alignr ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep disk_percent_full | grep USER | cut -d " " -f 2 }% ${execibar 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep disk_percent_full | grep USER | cut -d " " -f 2 }
${color grey}db_free_space : $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep db_free_space | grep USER | cut -d " " -f 2 } GB $alignr ${color grey} db_latency: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep db_latency | grep USER | cut -d " " -f 2 }
${color grey}wij_writes_per_second: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep wij_writes | cut -d " " -f 2 } $alignr ${color grey} trans_open_count: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep trans_open_count | cut -d " " -f 2 }
${color4}$hr
${color grey}$color Journaling
${color grey}jrn_free_space_primary: $alignr $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep iris_jrn_free_space | grep primary | cut -d " " -f 2 } GB
${color grey}jrn_free_space_secondary: $alignr $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep iris_jrn_free_space | grep secondary | cut -d " " -f 2 } GB
${color4}$hr
${color grey}$color Shared Memory Heap
${color grey}smh_percent_full_classes :$color $alignr ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep smh_percent_full | grep Classes | cut -d " " -f 2 }% ${execibar 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep smh_percent_full | grep Classes | cut -d " " -f 2 }
${color grey}smh_percent_full_globalmapping :$color $alignr ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep smh_percent_full | grep Global | cut -d " " -f 2 }% ${execibar 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep smh_percent_full | grep Global | cut -d " " -f 2 }
${color grey}smh_percent_full_locktable :$color $alignr ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep smh_percent_full | grep Lock | cut -d " " -f 2 }% ${execibar 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep smh_percent_full | grep Lock | cut -d " " -f 2 }
${color grey}smh_percent_full_routinebuffer :$color $alignr ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep smh_percent_full | grep Routine | cut -d " " -f 2 }% ${execibar 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep smh_percent_full | grep Routine | cut -d " " -f 2 }
${color4}$hr
${color grey}$color CSP
${color grey}csp_activity : $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep csp_activity | cut -d " " -f 2 } $alignr ${color grey} csp_actual_connections: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep csp_actual_connections | cut -d " " -f 2 }
${color grey}csp_gateway_latency : $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep csp_gateway_latency | cut -d " " -f 2 } $alignr ${color grey} csp_in_use_connections: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep csp_in_use_connections | cut -d " " -f 2 }
${color grey}csp_private_connections: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep csp_private_connections | cut -d " " -f 2 } $alignr ${color grey} csp_sessions: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep csp_sessions | cut -d " " -f 2 }
${color4}$hr
${color grey}$color SQL
${color grey}sql_commands_per_second: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep sql_commands_per_second | grep all | cut -d " " -f 2 | printf "%.2f" $(cat - | bc -l)} $alignr ${color grey} sql_queries_avg_runtime: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep sql_queries_avg_runtime | grep -v std | grep all | cut -d " " -f 2 | printf "%.5f" $(cat - |bc -l)}
${color grey}sql_queries_per_second : $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep sql_queries_per_second | grep all | cut -d " " -f 2 | printf "%.2f" $(cat - |bc -l) } $alignr ${color grey} sql_row_count_per_second: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep sql_row_count_per_second | grep all | cut -d " " -f 2 | printf "%.2f" $(cat - |bc -l)}
${color4}$hr
${color grey}$color Write Daemon
${color grey}wd_buffer_redirty: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep wd_buffer_redirty | cut -d " " -f 2 } $alignr ${color grey} wd_buffer_write: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep wd_buffer_write | cut -d " " -f 2 }
${color grey}wd_cycle_time : $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep wd_cycle_time | cut -d " " -f 2 } $alignr ${color grey} wd_proc_in_global: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep wd_proc_in_global | cut -d " " -f 2 }
${color grey}wd_wij_time : $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep wdwij_time | cut -d " " -f 2 } $alignr ${color grey} wd_write_time: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep wd_write_time | cut -d " " -f 2 }
${color4}$hr
${color grey}$color Routines
${color grey}rtn_call_local_per_sec: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep rtn_call_local_per_sec | cut -d " " -f 2 } $alignr ${color grey} rtn_call_miss_per_sec: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep rtn_call_miss_per_sec | cut -d " " -f 2 }
${color grey}rtn_seize_per_sec : $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep rtn_seize_per_sec | cut -d " " -f 2 } $alignr ${color grey} rtn_load_per_sec: $color ${execi 5 curl -s http://iris.deezwatts.com:52773/api/monitor/metrics | grep rtn_load_per_sec | cut -d " " -f 2 }
]];
BashBash
J'ai exécuté le code ci-dessous dans le POD pour augmenter la consommation de ressources dans le gif ci-dessus à titre d'exemple.
CPU
fulload() { dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null & }; fulload; read; killall dd
BashBash
Disk Space
fallocate -l 1390143672 /data/IRIS/OUTPUT.dat
ObjectScriptObjectScript
Procurez-vous votre Conky et installez la surveillance IRIS sur votre écran X11 dès aujourd'hui !