<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Atsushi Suzuki</title>
    <description>The latest articles on DEV Community by Atsushi Suzuki (@dleif).</description>
    <link>https://dev.to/dleif</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1466667%2Ffecdbe15-4f93-4a1e-b765-7f34e50416ed.jpg</url>
      <title>DEV Community: Atsushi Suzuki</title>
      <link>https://dev.to/dleif</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dleif"/>
    <language>en</language>
    <item>
      <title>SQLServer service status monitoring on Windows with Prometheu.</title>
      <dc:creator>Atsushi Suzuki</dc:creator>
      <pubDate>Fri, 03 May 2024 15:07:31 +0000</pubDate>
      <link>https://dev.to/dleif/sqlserver-service-status-monitoring-on-windows-with-prometheu-2c84</link>
      <guid>https://dev.to/dleif/sqlserver-service-status-monitoring-on-windows-with-prometheu-2c84</guid>
      <description>&lt;p&gt;This is the procedure for monitoring the service status of SQLServer on Windows with Prometheu.&lt;/p&gt;

&lt;p&gt;++++++++++++++++++++++++++++++++&lt;br&gt;
[environment].&lt;br&gt;
prometheus : Ver. 2.23.0&lt;br&gt;
prometheus-alertmanager : Ver. 0.15.3&lt;br&gt;
++++++++++++++++++++++++++++++++&lt;/p&gt;

&lt;p&gt;Describe the SQLserver service monitoring rules in the yml file (rules.yml by default) where the monitoring rules are set.&lt;br&gt;
In this case, we will describe a configuration that alerts when the state of the SQLServer service is anything other than ‘started’.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;alert&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;SQLServer-ServiceDown&lt;/span&gt;
  &lt;span class="na"&gt;expr&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;windows_service_state{job="[job name]", name="[target instance service name]", state="running"} == &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;   &lt;span class="c1"&gt;#1 is running, 0 is not running&lt;/span&gt;
  &lt;span class="na"&gt;for&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;7m&lt;/span&gt;   &lt;span class="c1"&gt;#If this duration is exceeded, the alert will change from Warning to Critical. s(seconds) m(minutes)&lt;/span&gt;
  &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;AlertGp&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;alert group name&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;#This name is arbitrary. You can set any group label for the alert. This label can be used in alertmanager.yml.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>sre</category>
      <category>monitoring</category>
      <category>prometheus</category>
    </item>
    <item>
      <title>Kubernetest (on-prem) master node and worker node associations.</title>
      <dc:creator>Atsushi Suzuki</dc:creator>
      <pubDate>Fri, 03 May 2024 14:14:10 +0000</pubDate>
      <link>https://dev.to/dleif/kubernetest-on-prem-master-node-and-worker-node-associations-5ccb</link>
      <guid>https://dev.to/dleif/kubernetest-on-prem-master-node-and-worker-node-associations-5ccb</guid>
      <description>&lt;p&gt;Procedure for reassociating worker nodes with the master node in on-premise Kubernetes after restarting the worker nodes.&lt;br&gt;
++++++++++++++++++++++++++++++++&lt;br&gt;
[Environment]&lt;br&gt;
Ubuntu 20.10&lt;br&gt;
Cluster Version 1.22.2&lt;br&gt;
++++++++++++++++++++++++++++++++&lt;/p&gt;
&lt;h1&gt;
  
  
  1) Reset the state of kubelet using kubeadm. (on the worker node)
&lt;/h1&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ kubeadm reset
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h1&gt;
  
  
  2) Generate the --discovery-token-ca-cert-hash (on the master node)
&lt;/h1&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2&amp;gt;/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Paste the output hash into a notepad for later use.&lt;/p&gt;
&lt;h1&gt;
  
  
  3) Generate a --token (on the master node)
&lt;/h1&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ kubeadm token create
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Copy and paste the output token into a notepad.&lt;/p&gt;
&lt;h1&gt;
  
  
  4) Reassociate with the master node (on the worker node)
&lt;/h1&gt;

&lt;p&gt;Use the values output in steps 2) and 3).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubeadm join [Master Node IP]:6443 --token [token created on master node] --discovery-token-ca-cert-hash sha256:[hash value created on master node]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>sre</category>
      <category>k8s</category>
    </item>
  </channel>
</rss>
