{"id":4481,"date":"2018-10-22T22:57:56","date_gmt":"2018-10-22T20:57:56","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=4481"},"modified":"2018-10-22T22:58:25","modified_gmt":"2018-10-22T20:58:25","slug":"monitor-linux-daemon-with-log-analytics","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=4481","title":{"rendered":"Monitor Linux Daemon with Log Analytics"},"content":{"rendered":"<p>In this blog post I would like to share an example of how daemons on Linux machines can be monitored with Log Analytics. Monitoring daemons are not listed as a feature direct in the Log Analytic portal, but it is possible to do. When a daemon is started or stopped a line is written in Syslog. Syslog is possible to read with the Microsoft Monitoring Agent and send to Log Analytics.<\/p>\n<p>The only thing to configure is to enable collection of Syslog and the daemon facility.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon001.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-4478\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon001-300x119.jpg\" alt=\"\" width=\"300\" height=\"119\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon001-300x119.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon001-768x306.jpg 768w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon001-1024x408.jpg 1024w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon001.jpg 1394w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If the daemon is stopped (the cron daemon in this example) the following lines are written to the syslog logfile<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon002.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-4479\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon002-300x19.jpg\" alt=\"\" width=\"300\" height=\"19\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon002-300x19.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon002-768x49.jpg 768w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon002.jpg 987w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Soon after the same lines are written to Log Analytics as events in the Syslog table<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon003.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-4480\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon003-300x283.jpg\" alt=\"\" width=\"300\" height=\"283\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon003-300x283.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon003.jpg 689w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>You can now configure an alert including notification when the daemon stops. The alert can, for example, be visualized in Azure Monitor and sent by e-mail.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon004.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-4475\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon004-300x136.jpg\" alt=\"\" width=\"300\" height=\"136\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon004-300x136.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon004-768x348.jpg 768w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon004-1024x464.jpg 1024w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon004.jpg 1654w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon005.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-4476\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon005-300x97.jpg\" alt=\"\" width=\"300\" height=\"97\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon005-300x97.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon005-768x247.jpg 768w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon005-1024x329.jpg 1024w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon005.jpg 1380w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon006.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-4477\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2018\/10\/Daemon006- 300x255.jpg\" alt=\"\" width=\"300\" height=\"255\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Disclaimer: Cloud is a very fast-moving target. It means that by the time you\u00e2\u20ac\u2122re reading this post everything described here could have been changed completely.<br \/>\nNote that this is provided \u00e2\u20ac\u0153AS-IS\u00e2\u20ac\u009d with no warranties at all. This is not a production-ready solution for your production environment, just an idea, and an example.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post I would like to share an example of how daemons on Linux machines can be monitored with Log Analytics. Monitoring daemons are not listed as a feature direct in the Log Analytic portal, but it is possible to do. When a daemon is started or stopped a line is written in &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=4481\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":4478,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[64,71],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4481"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4481"}],"version-history":[{"count":1,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4481\/revisions"}],"predecessor-version":[{"id":4482,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4481\/revisions\/4482"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/media\/4478"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4481"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}