<?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: sentadoensilla</title>
    <description>The latest articles on DEV Community by sentadoensilla (@sentadoensilla).</description>
    <link>https://dev.to/sentadoensilla</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%2F546587%2F67eab965-789a-48b5-990a-bcb9c80141ce.jpg</url>
      <title>DEV Community: sentadoensilla</title>
      <link>https://dev.to/sentadoensilla</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sentadoensilla"/>
    <language>en</language>
    <item>
      <title>updates on javascript frameworks</title>
      <dc:creator>sentadoensilla</dc:creator>
      <pubDate>Thu, 09 Jun 2022 13:38:05 +0000</pubDate>
      <link>https://dev.to/sentadoensilla/updates-on-javascript-frameworks-m9j</link>
      <guid>https://dev.to/sentadoensilla/updates-on-javascript-frameworks-m9j</guid>
      <description>&lt;p&gt;Hello Guys&lt;br&gt;
I'm only one coder thinking on updates and life cicle of jasvascript framework is a nigthmare?  Why the code has to be as ephemeral as reggueton (is music, a track live 30 days or maybe more, but disposable).&lt;/p&gt;

&lt;p&gt;Where T. F. go the javascript framework?&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Simple disk space monitor for linux servers</title>
      <dc:creator>sentadoensilla</dc:creator>
      <pubDate>Thu, 14 Apr 2022 18:28:31 +0000</pubDate>
      <link>https://dev.to/sentadoensilla/simple-disk-space-monitor-for-linux-servers-1ahf</link>
      <guid>https://dev.to/sentadoensilla/simple-disk-space-monitor-for-linux-servers-1ahf</guid>
      <description>&lt;p&gt;For you, new in linux, new admin server&lt;/p&gt;

&lt;p&gt;Is very important know when disk space is very low because linux servers stop when / reach 0% free disk space, so you need a warning, an automatic warning, an email automatic warning.&lt;/p&gt;

&lt;p&gt;For this (simple) guide go to use:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Linux server runing (&lt;em&gt;begin and end of all&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Postfix email service runing on this server (&lt;em&gt;send you and warning email, if not have read an guide, for example &lt;a href="http://www.postfix.org/STANDARD_CONFIGURATION_README.html"&gt;http://www.postfix.org/STANDARD_CONFIGURATION_README.html&lt;/a&gt;&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;crontab (&lt;em&gt;come include into reputable linux distributions&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Before starting, view postfix service status, restarting it or install and configure&lt;/p&gt;

&lt;p&gt;for view status open a terminal and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status postfix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When Postfix not installed, show something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4y5wujq10pw34qsn67ae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4y5wujq10pw34qsn67ae.png" alt="Image description" width="800" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When Postfix is installed, but not running show something like that:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7sxyqdyb3ctalh77nhk6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7sxyqdyb3ctalh77nhk6.png" alt="Image description" width="800" height="217"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Maybe typing "sudo systemctl start postfix" fix the issue.&lt;/p&gt;

&lt;p&gt;When Postfix is installed and running, show you:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0b2s055fr4tbtluaqn9g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0b2s055fr4tbtluaqn9g.png" alt="Image description" width="800" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check all with your system administrator but if you are the sysadmin, God help us!!!  God = Google or StackOverflow or &lt;a href="https://www.cyberciti.biz/"&gt;https://www.cyberciti.biz/&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;FIRST STEP: Create a bash script monitor&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We create a bash script with code to check hard drive space:&lt;/p&gt;

&lt;p&gt;open terminal and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano /usr/diskSpace.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then paste this code (first read it and understand it, is very simple, but usefull)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
#a simple script that warn me about low disk space for partition in linux
#this script send a email when disk partition reach a DISKLIMIT
#to sysadmin ninja guy use a jutsu and save the world
#usign command df -h grep and contrab you get an email for low hard disk space in partitions
#You need and email server running like postfix (maybe sendmail)
#here and practical example to reach a postfix mail server, you choose: http://www.postfix.org/STANDARD_CONFIGURATION_README.html

PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin
export $PATH

#ADDRESS FOR SERVER
DIRIP=$(/sbin/ifconfig | awk -F':' '/inet/&amp;amp;&amp;amp;!/127.0.0.1/{split($2,_," ");print _[1]}')
#EMAIL ACCOUNTS SENDER AND RECEIBERS
SENDERS="sender@myserver.com"
RECEIBERS="sysadminguy@myserver.com internguy@myserver.com developer@myserver.com theboss@myserver.com"
#RED LINE FLAG TO SEND AN EMAIL
DISKLIMIT=80

df -h | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $6 }' | while read output;
do
    usep=$(echo $output | awk '{print $1}' | cut -d'%' -f1  )
    partition=$(echo $output | awk '{ print $2 }' )
    if [ "$usep" -ge "$DISKLIMIT" ]; then
        echo -e $DIRIP"\n The disk space for some partitions is very low \n\n Please read the following report and do something: \n\nFor partition $partition   space used is $usep % \n\n This report was generated at: $(date)" |
        mail -s "[SOME SERVER] VERY LOW DISK SPACE "${DIRIP}" "  -a "From: "${SENDERS}" "${RECEIBERS}
    fi
done
service postfix restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can modify DISKLIMIT to run and get an email, for testing proposes&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;SECOND STEP: Include a cron job each minute&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A cron job let me run a script in minutes, hours, days, weeks...  server run my script /usr/diskSpace each minute then a partition reach DISKLIMIT percent postfix send an email.  Please calculate DISKLIMIT for notice in time includin week end or modify for vacations.&lt;/p&gt;

&lt;p&gt;Open a terminal and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/crontab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the crontab template, add to bottom:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* * * * * root sh /usr/diskSpace.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then each minute the server run /usr/diskSpace.sh and maybe send email for partitions with low hard disk space.&lt;/p&gt;

&lt;p&gt;This simple guide was writing reading ciberciti.biz tuts and testing in Debian, freeBSD, Ubuntu and CentOS for reach good results.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>bash</category>
      <category>sysadmin</category>
    </item>
  </channel>
</rss>
