{"id":3078,"date":"2024-02-14T10:00:00","date_gmt":"2024-02-14T10:00:00","guid":{"rendered":"https:\/\/www.infobip.com\/developers\/?p=3078"},"modified":"2024-02-13T15:10:48","modified_gmt":"2024-02-13T15:10:48","slug":"how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust","status":"publish","type":"post","link":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust","title":{"rendered":"How to create a simple system monitor that sends WhatsApp alerts with Rust"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This post will show you how to create a simple system resource monitor that sends WhatsApp alerts when CPU\nor memory utilization exceeds a threshold. We created this demo project with\nthe <a href=\"https:\/\/github.com\/GuillaumeGomez\/sysinfo\">sysinfo<\/a> and\nthe <a href=\"https:\/\/github.com\/infobip-community\/infobip-api-rust-sdk\">infobip_sdk<\/a> crates. The complete code is in\nthe <a href=\"https:\/\/github.com\/infobip-community\/sysmonitor-alert.git\">sysmonitor-alert repository<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Rust is an efficient systems programming language. This makes it ideal for resource monitors, profilers, and\nother low-level, infrastructure-related software. When you deploy an application, you want it to perform at its best\nwithout overloading the computer it runs on. For that purpose, resource monitors are used to observe latency and\nscalability in a system. Ideally, you want your software to use enough processor and memory without saturating the \ncomputer. Usage numbers that are too high may mean you need to grow the system or check if something is wrong. This\nsoftware could run in a company server, or you could simply monitor your laptop to identify inefficient, battery-draining\nprocesses.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We\u2019ll guide you through the steps we followed to create this monitor, and we&#8217;ll show the most interesting code and how\nto run the project.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"overview\">Overview<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to create a monitor of your own, you may follow the steps detailed in this guide:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a new Rust project<\/li>\n\n\n\n<li>Install dependencies<\/li>\n\n\n\n<li>Create a <code>async main<\/code> function<\/li>\n\n\n\n<li>Create a <code>sysinfo::System<\/code><\/li>\n\n\n\n<li>Read system details in a loop<\/li>\n\n\n\n<li>Check for usage beyond the threshold<\/li>\n\n\n\n<li>Send the alert if usage is high<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-a-new-rust-project\">Create a new Rust project<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new project using cargo or your IDE of choice.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cargo new &lt;project-name><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install-dependencies\">Install Dependencies<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We need a few crates for the monitor to work nicely:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;dependencies]\ninfobip_sdk = \"0.5.2\"\nsysinfo = \"0.30.5\"\ntokio = \"1.35.1\"\nchrono = \"0.4.33\"\nbytesize = \"1.3.0\"\nclap = { version = \"4.4.18\", features = &#91;\"derive\"] }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Particularly important are <code>infobip_sdk<\/code>, which enables the program to send WhatsApp alerts, <code>tokio<\/code>, which provides\nthe async runtime and the interval loop, and <code>sysinfo<\/code>, which is our source of system information.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"create-an-async-main-function\">Create an async main function<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Because the Infobip Rust SDK is async, we need to create an async main with the help of Tokio:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#&#91;tokio::main]\nasync fn main() {\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-a-sysinfosystem-object\">Create a sysinfo::System object<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The System object will help us gather resource usage details. Make sure you check\nthe <a href=\"https:\/\/github.com\/GuillaumeGomez\/sysinfo\">sysinfo crate<\/a>, which has a lot of system properties it can monitor.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>let sys = System::new_all();<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"read-system-details-in-a-loop\">Read system details in a loop<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We need to run the <code>System.refresh()<\/code> function to update system properties and detect anomalies. To refresh at regular\nintervals, we are using Tokio&#8217;s <code>interval<\/code>, which runs async and can run while we send WhatsApp alerts over the network\nwithout stopping the program execution.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    let mut interval = time::interval(Duration::from_secs(args.refresh_interval_secs));\n\n    \/\/ ...\n\n    loop {\n        \/\/ Refresh CPU for accuracy.\n        sys.refresh_cpu();\n\n        interval.tick().await;\n\n        sys.refresh_all();<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"check-for-usage-beyond-threshold-and-alert\">Check for usage beyond threshold and alert<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After gathering system info, we check if all CPU cores are within limits. If they are outside limits, we send an alert\nwith the send_alert() function.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    for (i, cpu) in sys.cpus().iter().enumerate() {\n        let usage = cpu.cpu_usage();\n        if usage > args.cpu_usage_threshold {\n            cpus_high_cycles&#91;i] += 1;\n            if cpus_high_cycles&#91;i] >= args.cycles_for_alert\n                &amp;&amp; cpus_ok_cycles&#91;i] >= args.cycles_between_alert\n            {\n                cpus_ok_cycles&#91;i] = 0;\n                handles.push(send_alert(format!(\n                    \"{ts} {hostname}: High CPU{i} usage: {usage:.1}%\",\n                )));\n            }\n        } else {\n            cpus_high_cycles&#91;i] = 0;\n            cpus_ok_cycles&#91;i] += 1;\n        }\n    }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To prevent flooding your phone with messages, we implemented a couple of simple counters, <code>cpus_high_cycles<\/code>\nand <code>cpus_ok_cycles<\/code>, that prevent sending alerts after every high usage spike. For an alert to trigger, a number of\nconsecutive high measures must have been taken, and there should be a number of consecutive non-high measures to\nseparate one anomaly from another. For checking memory, we follow the same logic.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"send-the-alert-if-usage-is-high\">Send the alert if usage is high<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The special feature of this monitor is implemented in the <code>send_alert()<\/code> function, which is called when there&#8217;s an \nanomaly. Here&#8217;s the code for it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>async fn send_alert(message: String) {\n    let client = WhatsappClient::with_configuration(Configuration::from_env_api_key().unwrap());\n\n    let request_body = SendTextRequestBody::new(\n        env::var(\"WA_SENDER\").unwrap().as_str(),\n        env::var(\"WA_DESTINATION\").unwrap().as_str(),\n        TextContent::new(message.as_str()),\n    );\n\n    let response = client.send_text(request_body).await.unwrap();\n\n    println!(\"Alert: {message} => HTTP response: {:?}\", response.status);\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above code creates a message and then sends it to the server. For this code to work correctly, we need to set\nfour environment variables, which you can retrieve from <a href=\"https:\/\/portal.infobip.com\/\">your account<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>IB_API_KEY=&lt;your-api-key>\nIB_BASE_URL=&lt;your-base-url>\nWA_SENDER=&lt;your-whatsapp-sender-number>\nWA_DESTINATION=&lt;your-whatsapp-phone-number><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>IB_API_KEY<\/code> and <code>IB_BASE_URL<\/code> variables are needed to initialize the Infobip SDK, while <code>WA_SENDER<\/code> and \n<code>WA_DESTINATION<\/code> are the ones we use for our specific use case.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"run-the-project\">Run the project<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Because we are using simple text WhatsApp messages, we need prior user engagement with the user to send \nmessages. Send a message from the phone to the sender number with any text. Check\nthe <a href=\"https:\/\/www.infobip.com\/docs\/api\/channels\/whatsapp\/whatsapp-outbound-messages\/send-whatsapp-text-message\">endpoint documentation<\/a>\nfor more information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you send the message, run the project with cargo or with the command line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cargo run<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s it! The process will run forever until you kill it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"customizing-execution\">Customizing execution<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The default command will run with the default parameters. We implemented a few command line options to customize the usage\nthresholds, refresh frequency and the required positive cycles to trigger an alert. Run with <code>-\u2013help<\/code> to get a summary\nof the available parameters.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cargo run -- --help<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I hope you find this monitor helpful or that it helps you to create your own awesome one. In case you find any\nerrors or you want to know more about response details, please check Infobip\n<a href=\"https:\/\/www.infobip.com\/docs\/essentials\/response-status-and-error-codes\">Response Status and Error Codes Reference<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post will show you how to create a [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":3080,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[272],"tags":[46],"coauthors":[156],"class_list":["post-3078","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-use-case","tag-developer-docs"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to create a simple system monitor that sends WhatsApp alerts with Rust - Infobip Developers Hub<\/title>\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.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create a simple system monitor that sends WhatsApp alerts with Rust - Infobip Developers Hub\" \/>\n<meta property=\"og:description\" content=\"This post will show you how to create a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust\" \/>\n<meta property=\"og:site_name\" content=\"Infobip Developers Hub\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/infobip\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-14T10:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2024\/02\/mingwei-lim-QxGSSfatjRs-unsplash-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"2560\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Erick Corona\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InfobipDev\" \/>\n<meta name=\"twitter:site\" content=\"@InfobipDev\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Erick Corona\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust\"},\"author\":{\"name\":\"Erick Corona\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/9e52e4d22fb53cc9a87adc54825c5e5c\"},\"headline\":\"How to create a simple system monitor that sends WhatsApp alerts with Rust\",\"datePublished\":\"2024-02-14T10:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust\"},\"wordCount\":742,\"publisher\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2024\/02\/mingwei-lim-QxGSSfatjRs-unsplash-scaled.jpg\",\"keywords\":[\"developer docs\"],\"articleSection\":[\"Use Case\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust\",\"url\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust\",\"name\":\"How to create a simple system monitor that sends WhatsApp alerts with Rust - Infobip Developers Hub\",\"isPartOf\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2024\/02\/mingwei-lim-QxGSSfatjRs-unsplash-scaled.jpg\",\"datePublished\":\"2024-02-14T10:00:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#primaryimage\",\"url\":\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2024\/02\/mingwei-lim-QxGSSfatjRs-unsplash-scaled.jpg\",\"contentUrl\":\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2024\/02\/mingwei-lim-QxGSSfatjRs-unsplash-scaled.jpg\",\"width\":2560,\"height\":2560,\"caption\":\"Health Monitors\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.infobip.com\/developers\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to create a simple system monitor that sends WhatsApp alerts with Rust\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#website\",\"url\":\"https:\/\/www.infobip.com\/developers\/\",\"name\":\"Infobip Developers Hub\",\"description\":\"Build meaningful customer relationships across any channel\",\"publisher\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.infobip.com\/developers\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#organization\",\"name\":\"Infobip Developers Hub\",\"url\":\"https:\/\/www.infobip.com\/developers\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png\",\"contentUrl\":\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png\",\"width\":696,\"height\":696,\"caption\":\"Infobip Developers Hub\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/infobip\/\",\"https:\/\/x.com\/InfobipDev\",\"https:\/\/www.youtube.com\/channel\/UCUPSTy53VecI5GIir3J3ZbQ\",\"https:\/\/github.com\/infobip-community\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/9e52e4d22fb53cc9a87adc54825c5e5c\",\"name\":\"Erick Corona\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/image\/1d096b53aac31da0002a2066ab28c0f1\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c59cdedbf2c066d0ebbb15c5b1da56b1c5b5e7c49e3c4aaf7410dd1462a7b74c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c59cdedbf2c066d0ebbb15c5b1da56b1c5b5e7c49e3c4aaf7410dd1462a7b74c?s=96&d=mm&r=g\",\"caption\":\"Erick Corona\"},\"description\":\"Erick has been in the software industry for more than 10 years. Currently, he works as a Developer Experience Engineer at Infobip. He's interested in software development, writing, and racing car simulators in his free time.\",\"url\":\"https:\/\/www.infobip.com\/developers\/blog\/author\/erick\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to create a simple system monitor that sends WhatsApp alerts with Rust - Infobip Developers Hub","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.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust","og_locale":"en_US","og_type":"article","og_title":"How to create a simple system monitor that sends WhatsApp alerts with Rust - Infobip Developers Hub","og_description":"This post will show you how to create a [&hellip;]","og_url":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust","og_site_name":"Infobip Developers Hub","article_publisher":"https:\/\/www.facebook.com\/infobip\/","article_published_time":"2024-02-14T10:00:00+00:00","og_image":[{"width":2560,"height":2560,"url":"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2024\/02\/mingwei-lim-QxGSSfatjRs-unsplash-scaled.jpg","type":"image\/jpeg"}],"author":"Erick Corona","twitter_card":"summary_large_image","twitter_creator":"@InfobipDev","twitter_site":"@InfobipDev","twitter_misc":{"Written by":"Erick Corona","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#article","isPartOf":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust"},"author":{"name":"Erick Corona","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/9e52e4d22fb53cc9a87adc54825c5e5c"},"headline":"How to create a simple system monitor that sends WhatsApp alerts with Rust","datePublished":"2024-02-14T10:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust"},"wordCount":742,"publisher":{"@id":"https:\/\/www.infobip.com\/developers\/#organization"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#primaryimage"},"thumbnailUrl":"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2024\/02\/mingwei-lim-QxGSSfatjRs-unsplash-scaled.jpg","keywords":["developer docs"],"articleSection":["Use Case"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust","url":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust","name":"How to create a simple system monitor that sends WhatsApp alerts with Rust - Infobip Developers Hub","isPartOf":{"@id":"https:\/\/www.infobip.com\/developers\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#primaryimage"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#primaryimage"},"thumbnailUrl":"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2024\/02\/mingwei-lim-QxGSSfatjRs-unsplash-scaled.jpg","datePublished":"2024-02-14T10:00:00+00:00","breadcrumb":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#primaryimage","url":"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2024\/02\/mingwei-lim-QxGSSfatjRs-unsplash-scaled.jpg","contentUrl":"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2024\/02\/mingwei-lim-QxGSSfatjRs-unsplash-scaled.jpg","width":2560,"height":2560,"caption":"Health Monitors"},{"@type":"BreadcrumbList","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-create-a-simple-system-monitor-that-sends-whatsapp-alerts-with-rust#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.infobip.com\/developers\/"},{"@type":"ListItem","position":2,"name":"How to create a simple system monitor that sends WhatsApp alerts with Rust"}]},{"@type":"WebSite","@id":"https:\/\/www.infobip.com\/developers\/#website","url":"https:\/\/www.infobip.com\/developers\/","name":"Infobip Developers Hub","description":"Build meaningful customer relationships across any channel","publisher":{"@id":"https:\/\/www.infobip.com\/developers\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.infobip.com\/developers\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.infobip.com\/developers\/#organization","name":"Infobip Developers Hub","url":"https:\/\/www.infobip.com\/developers\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/","url":"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png","contentUrl":"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png","width":696,"height":696,"caption":"Infobip Developers Hub"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/infobip\/","https:\/\/x.com\/InfobipDev","https:\/\/www.youtube.com\/channel\/UCUPSTy53VecI5GIir3J3ZbQ","https:\/\/github.com\/infobip-community"]},{"@type":"Person","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/9e52e4d22fb53cc9a87adc54825c5e5c","name":"Erick Corona","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/image\/1d096b53aac31da0002a2066ab28c0f1","url":"https:\/\/secure.gravatar.com\/avatar\/c59cdedbf2c066d0ebbb15c5b1da56b1c5b5e7c49e3c4aaf7410dd1462a7b74c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c59cdedbf2c066d0ebbb15c5b1da56b1c5b5e7c49e3c4aaf7410dd1462a7b74c?s=96&d=mm&r=g","caption":"Erick Corona"},"description":"Erick has been in the software industry for more than 10 years. Currently, he works as a Developer Experience Engineer at Infobip. He's interested in software development, writing, and racing car simulators in his free time.","url":"https:\/\/www.infobip.com\/developers\/blog\/author\/erick"}]}},"_links":{"self":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/3078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/comments?post=3078"}],"version-history":[{"count":1,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/3078\/revisions"}],"predecessor-version":[{"id":3079,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/3078\/revisions\/3079"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/media\/3080"}],"wp:attachment":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/media?parent=3078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/categories?post=3078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/tags?post=3078"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/coauthors?post=3078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}