{"id":5533,"date":"2019-05-30T04:46:16","date_gmt":"2019-05-30T04:46:16","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=5533"},"modified":"2022-02-19T11:02:36","modified_gmt":"2022-02-19T11:02:36","slug":"set-up-a-server-status-script-on-a-vps-or-dedicated-server","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/","title":{"rendered":"Setting Up a Server Status Script on a VPS or Dedicated Server"},"content":{"rendered":"<p>In case you have a <a href=\"https:\/\/www.milesweb.co.uk\/hosting\/vps-hosting\/\">VPS server<\/a> or <a href=\"https:\/\/www.milesweb.co.uk\/hosting\/dedicated-servers\/\">Dedicated server<\/a>, you might want to find the status of that server without the need to wait at a terminal window. For this, you can just run a script that emails you information about the status of your server.<\/p>\n<p>In this process, HTML 4.01 Strict compliant content containing information on your server is given as output, including:<\/p>\n<p>\u2022 load average<br \/>\n\u2022 memory usage<br \/>\n\u2022 open network connections<br \/>\n\u2022 top 10 memory processes<br \/>\n\u2022 top 10 CPU processes<br \/>\n\u2022 netstat output<br \/>\n\u2022 top snapshot of all running processes<\/p>\n<div style=\"background-color: #e0ffff; padding: 10px;\"><strong>Note:<\/strong> This is applicable only to your web server. You won\u2019t get the Shell access to MySQL VPS.<\/div>\n<h3>Installing a Server Script<\/h3>\n<p>You can download a copy of the script in one of below ways:<\/p>\n<p>\u2022 Browse the URL of the script and then download it in your browser:<br \/>\n<strong>https:\/\/cdn.rawgit.com\/watsonian\/server-status-report\/master\/status.rb<\/strong><\/p>\n<p>Though you download the file via the URL, you will need to upload the file via FTP.<\/p>\n<p>\u2022 In case you have the SSH access into your VPS, simply run:<\/p>\n<pre class=\"lang:default decode:true \">[server]$ curl -s -o status.rb https:\/\/cdn.rawgit.com\/watsonian\/server-status-report\/master\/status.rb<\/pre>\n<p>The script\u2019s name is status.rb, and it is written in Ruby so that you can produce the HTML content by using the ERB templating system.<\/p>\n<h3>Confirming If mailx is Installed<\/h3>\n<p>After downloading the script successfully, make sure that the mailx package is installed on your PS.<\/p>\n<p>To check this out, execute this command:<\/p>\n<pre class=\"lang:default decode:true \">[server]$ dpkg -l | grep mailx<\/pre>\n<p>If your output is similar to the below one, it means it&#8217;s installed:<\/p>\n<pre class=\"lang:default decode:true \">ii bsd-mailx 8.1.2-0.20100314cvs-1 simple mail user agent<\/pre>\n<p>But, if you get the below output, it means you need to install it:<\/p>\n<pre class=\"lang:default decode:true \">rc mailx 8.1.2-0.20050715cvs-1 A simple mail user agent<\/pre>\n<div style=\"background-color: #e0ffff; padding: 10px;\">\n<p><strong>Note:<\/strong> It is possible to install mailx on a Dedicated server only with an admin user. This is because it needs sudo.<\/p>\n<p>After logging in, run the following command:<\/p>\n<pre class=\"lang:default decode:true \">[server]$ sudo apt-get install mailx<\/pre>\n<\/div>\n<h3>Creating a cron job<\/h3>\n<p>While creating a cron job, enter the below command in the panel:<\/p>\n<pre class=\"lang:default decode:true \">[server]$ \/usr\/bin\/ruby \/path\/to\/script\/status.rb | \/usr\/bin\/mail -a \"Content-type: text\/html;\" -s \"Status Report: $HOSTNAME\" \"some@example.com\"<\/pre>\n<p>In case the above command isn\u2019t working, try to modify<strong> &#8216;\/user\/bin\/ruby&#8217; with &#8216;\/user\/bin\/ruby1.8&#8217;<\/strong>.<\/p>\n<p>\u2022 The subject can be changed to anything you like.<\/p>\n<p>\u2022 The email too can be changed to any address you want the <strong>cron<\/strong> email sent to.<\/p>\n<p>\u2022 For adding multiple email addresses in the <strong>CC<\/strong>, use the <strong>-c flag<\/strong> and pass it a list of email addresses separated with a comma.<\/p>\n<p>\u2022 It\u2019s not a bad idea to run it once per hour, but you can run it as frequently or infrequently as per your preference.<\/p>\n<h3>Conclusion<\/h3>\n<p>If you follow the above steps properly, then you will start getting emails that look roughly like below:<\/p>\n<p><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5534\" src=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min.png\" alt=\"\" width=\"1167\" height=\"747\" srcset=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min.png 1167w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min-300x192.png 300w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min-768x492.png 768w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min-1024x655.png 1024w\" sizes=\"auto, (max-width: 1167px) 100vw, 1167px\" \/><\/a><\/p>\n<p>Remember that this script might update as time passes if there is any change with server configurations. So, in case this stops working on your server, make sure to check back to see if the script is updated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In case you have a VPS server or Dedicated server, you might want to find the status of that server without the need to wait at a terminal window. For this, you can just run a script that emails you information about the status of your server. In this process, HTML 4.01 Strict compliant content [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[690,691,692],"class_list":["post-5533","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-web-hosting-faq","tag-server-status","tag-server-status-script","tag-vps-or-dedicated-server-status"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Learn to Set Up a Server Status Script on a VPS or Dedicated Server<\/title>\n<meta name=\"description\" content=\"Want to find the status of your server? The article decribes the steps to set up a server status script on a VPS or Dedicated server.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn to Set Up a Server Status Script on a VPS or Dedicated Server\" \/>\n<meta property=\"og:description\" content=\"Want to find the status of your server? The article decribes the steps to set up a server status script on a VPS or Dedicated server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-30T04:46:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-19T11:02:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min.png\" \/>\n<meta name=\"author\" content=\"Pallavi Godse\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pallavi Godse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/\",\"name\":\"Learn to Set Up a Server Status Script on a VPS or Dedicated Server\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min.png\",\"datePublished\":\"2019-05-30T04:46:16+00:00\",\"dateModified\":\"2022-02-19T11:02:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"description\":\"Want to find the status of your server? The article decribes the steps to set up a server status script on a VPS or Dedicated server.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min.png\",\"contentUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min.png\",\"width\":1167,\"height\":747},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting Up a Server Status Script on a VPS or Dedicated Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\",\"name\":\"Pallavi Godse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/eefc9695ea2b2c6e143c9c9919701aaa?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/eefc9695ea2b2c6e143c9c9919701aaa?s=96&d=blank&r=g\",\"caption\":\"Pallavi Godse\"},\"description\":\"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/pallavi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Learn to Set Up a Server Status Script on a VPS or Dedicated Server","description":"Want to find the status of your server? The article decribes the steps to set up a server status script on a VPS or Dedicated server.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/","og_locale":"en_GB","og_type":"article","og_title":"Learn to Set Up a Server Status Script on a VPS or Dedicated Server","og_description":"Want to find the status of your server? The article decribes the steps to set up a server status script on a VPS or Dedicated server.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2019-05-30T04:46:16+00:00","article_modified_time":"2022-02-19T11:02:36+00:00","og_image":[{"url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min.png","type":"","width":"","height":""}],"author":"Pallavi Godse","twitter_misc":{"Written by":"Pallavi Godse","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/","name":"Learn to Set Up a Server Status Script on a VPS or Dedicated Server","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min.png","datePublished":"2019-05-30T04:46:16+00:00","dateModified":"2022-02-19T11:02:36+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"description":"Want to find the status of your server? The article decribes the steps to set up a server status script on a VPS or Dedicated server.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/#primaryimage","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min.png","contentUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/05\/Server_status_script_preview-min.png","width":1167,"height":747},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/set-up-a-server-status-script-on-a-vps-or-dedicated-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"Setting Up a Server Status Script on a VPS or Dedicated Server"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945","name":"Pallavi Godse","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/eefc9695ea2b2c6e143c9c9919701aaa?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eefc9695ea2b2c6e143c9c9919701aaa?s=96&d=blank&r=g","caption":"Pallavi Godse"},"description":"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/pallavi\/"}]}},"views":713,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/5533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=5533"}],"version-history":[{"count":3,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/5533\/revisions"}],"predecessor-version":[{"id":13836,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/5533\/revisions\/13836"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=5533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=5533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=5533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}