{"id":3225,"date":"2013-09-06T16:10:03","date_gmt":"2013-09-06T08:10:03","guid":{"rendered":"http:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/?p=3225"},"modified":"2013-09-06T16:10:03","modified_gmt":"2013-09-06T08:10:03","slug":"use-snmpget-to-get-linux-cpu-loading-etc","status":"publish","type":"post","link":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/?p=3225","title":{"rendered":"use snmpget to get linux cpu loading, etc"},"content":{"rendered":"<p><strong> CPU Statistics<\/strong><\/p>\n<p><strong> Load<\/strong><br \/>\n1 minute Load: .1.3.6.1.4.1.2021.10.1.3.1<br \/>\n5 minute Load: .1.3.6.1.4.1.2021.10.1.3.2<br \/>\n15 minute Load: .1.3.6.1.4.1.2021.10.1.3.3<\/p>\n<p><strong>CPU<\/strong><br \/>\npercentage of user CPU time: .1.3.6.1.4.1.2021.11.9.0<br \/>\nraw user cpu time: .1.3.6.1.4.1.2021.11.50.0<br \/>\npercentages of system CPU time: .1.3.6.1.4.1.2021.11.10.0<br \/>\nraw system cpu time: .1.3.6.1.4.1.2021.11.52.0<br \/>\npercentages of idle CPU time: .1.3.6.1.4.1.2021.11.11.0<br \/>\nraw idle cpu time: .1.3.6.1.4.1.2021.11.53.0<br \/>\nraw nice cpu time: .1.3.6.1.4.1.2021.11.51.0<\/p>\n<p><strong>Memory Statistics<\/strong><\/p>\n<p>Total Swap Size: .1.3.6.1.4.1.2021.4.3.0<br \/>\nAvailable Swap Space: .1.3.6.1.4.1.2021.4.4.0<br \/>\nTotal RAM in machine: .1.3.6.1.4.1.2021.4.5.0<br \/>\nTotal RAM used: .1.3.6.1.4.1.2021.4.6.0<br \/>\nTotal RAM Free: .1.3.6.1.4.1.2021.4.11.0<br \/>\nTotal RAM Shared: .1.3.6.1.4.1.2021.4.13.0<br \/>\nTotal RAM Buffered: .1.3.6.1.4.1.2021.4.14.0<br \/>\nTotal Cached Memory: .1.3.6.1.4.1.2021.4.15.0<\/p>\n<p><strong>Disk Statistics<\/strong><\/p>\n<p>The snmpd.conf needs to be edited. Add the following (assuming a machine with a single \u2018\/&#8217; partition):<\/p>\n<p>disk \/ 100000 (or)<\/p>\n<p>includeAllDisks 10% for all partitions and disks<\/p>\n<p>The OIDs are as follows<\/p>\n<p>Path where the disk is mounted: .1.3.6.1.4.1.2021.9.1.2.1<br \/>\nPath of the device for the partition: .1.3.6.1.4.1.2021.9.1.3.1<br \/>\nTotal size of the disk\/partion (kBytes): .1.3.6.1.4.1.2021.9.1.6.1<br \/>\nAvailable space on the disk: .1.3.6.1.4.1.2021.9.1.7.1<br \/>\nUsed space on the disk: .1.3.6.1.4.1.2021.9.1.8.1<br \/>\nPercentage of space used on disk: .1.3.6.1.4.1.2021.9.1.9.1<br \/>\nPercentage of inodes used on disk: .1.3.6.1.4.1.2021.9.1.10.1<\/p>\n<p>System Uptime: .1.3.6.1.2.1.1.3.0<\/p>\n<p><strong>Examples<\/strong><\/p>\n<p>These Commands you need to run on the SNMP server<\/p>\n<p>Get available disk space for \/ on the target host<\/p>\n<p>#snmpget -v 1 -c &#8220;community&#8221; target_name_or_ip .1.3.6.1.4.1.2021.9.1.7.1<\/p>\n<p>this will return available disk space for the first entry in the \u2018disk&#8217; section of snmpd.conf; replace 1 with n for the nth entry<\/p>\n<p>Get the 1-minute system load on the target host<\/p>\n<p>#snmpget -v 1 -c &#8220;community&#8221; target_name_or_ip .1.3.6.1.4.1.2021.10.1.3.1<\/p>\n<p>Get the 5-minute system load on the target host<\/p>\n<p>#snmpget -v 1 -c &#8220;community&#8221; target_name_or_ip .1.3.6.1.4.1.2021.10.1.3.2<\/p>\n<p>Get the 15-minute system load on the target host<\/p>\n<p>#snmpget -v 1 -c &#8220;community&#8221; target_name_or_ip .1.3.6.1.4.1.2021.10.1.3.3<\/p>\n<p>Get amount of available swap space on the target host<\/p>\n<p>#snmpget -v 1 -c &#8220;community&#8221; target_name_or_ip .1.3.6.1.4.1.2021.4.4.0<\/p>\n","protected":false},"excerpt":{"rendered":"<p> CPU Statistics<\/p>\n<p> Load 1 minute Load: .1.3.6.1.4.1.2021.10.1.3.1 5 minute Load: .1.3.6.1.4.1.2021.10.1.3.2 15 minute Load: .1.3.6.1.4.1.2021.10.1.3.3<\/p>\n<p>CPU percentage of user CPU time: .1.3.6.1.4.1.2021.11.9.0 raw user cpu time: .1.3.6.1.4.1.2021.11.50.0 percentages of system CPU time: .1.3.6.1.4.1.2021.11.10.0 raw system cpu time: .1.3.6.1.4.1.2021.11.52.0 percentages of idle CPU time: .1.3.6.1.4.1.2021.11.11.0 raw idle cpu time: .1.3.6.1.4.1.2021.11.53.0 raw nice cpu time: [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[3],"tags":[57],"class_list":["post-3225","post","type-post","status-publish","format-standard","hentry","category-computer","tag-linux","odd"],"_links":{"self":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3225"}],"version-history":[{"count":1,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3225\/revisions"}],"predecessor-version":[{"id":3226,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3225\/revisions\/3226"}],"wp:attachment":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}