{"id":667,"date":"2015-04-04T09:08:37","date_gmt":"2015-04-04T13:08:37","guid":{"rendered":"http:\/\/149.28.118.115\/?p=667"},"modified":"2015-04-04T09:08:37","modified_gmt":"2015-04-04T13:08:37","slug":"monitoring-ubiquiti-aps-with-prtg","status":"publish","type":"post","link":"https:\/\/www.postinger.com\/index.php\/2015\/04\/04\/monitoring-ubiquiti-aps-with-prtg\/","title":{"rendered":"Monitoring Ubiquiti APs with PRTG"},"content":{"rendered":"<p>I have a couple of <a href=\"http:\/\/www.amazon.com\/Ubiquiti-Networks-UniFi-Enterprise-System\/dp\/B004XXMUCQ\/\">Ubiquity APs<\/a> in my home and have an instance of PRTG running. I was looking for a good way to monitor the access points.<br \/>\n<a href=\"https:\/\/www.postinger.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-04-at-9.03.58-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-668 size-large\" src=\"https:\/\/www.postinger.com\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-04-at-9.03.58-AM-1024x242.png\" alt=\"Screen Shot 2015-04-04 at 9.03.58 AM\" width=\"584\" height=\"138\" \/><\/a><br \/>\nOut of the box Ubquiti supports SNMP and SSH. I wanted a way to monitor how many clients are connected. If you want to monitor the access points configure SNMP on the device, feed the string in to PRTG and the SSH credentials.<br \/>\nThen I wrote a simple shell script below that extracts information from the mca-dump table for connected clients. I&#8217;m <em>sure<\/em> there are different and probably more efficient ways to do this, but this works for me. Essentially the code greps the number and formats the return correctly for PRTG to read, including a status code.<br \/>\n1) Create the directory\u00a0\/var\/prtg\/scripts\/<br \/>\n2) Using VI on the access point create the following file with the code below in \/var\/prtg\/scripts\/<br \/>\n3) Save it as wifiusers.sh<br \/>\n4) Add a custom SSH sensor for your access point.(I called mine Wifi Clients)<br \/>\n5) Set the primary channel to &#8220;Value (#)&#8221;<\/p>\n<table>\n<tbody>\n<tr>\n<td><code><br \/>\ncmd1=`mca-dump | grep num_sta | tail -n1 | sed 's\/[^0-9]*\/\/g`<br \/>\necho 0:$cmd1:users<br \/>\n<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>I have a couple of Ubiquity APs in my home and have an instance of PRTG running. I was looking for a good way to monitor the access points. Out of the box Ubquiti supports SNMP and SSH. I wanted a way to monitor how many clients are connected. If you want to monitor the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[7],"tags":[],"class_list":["post-667","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/www.postinger.com\/index.php\/wp-json\/wp\/v2\/posts\/667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.postinger.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.postinger.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.postinger.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.postinger.com\/index.php\/wp-json\/wp\/v2\/comments?post=667"}],"version-history":[{"count":0,"href":"https:\/\/www.postinger.com\/index.php\/wp-json\/wp\/v2\/posts\/667\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.postinger.com\/index.php\/wp-json\/wp\/v2\/media?parent=667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.postinger.com\/index.php\/wp-json\/wp\/v2\/categories?post=667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.postinger.com\/index.php\/wp-json\/wp\/v2\/tags?post=667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}