<p>Hey guys I have been executing local commands to grab process data through the ps command. Any good libraries or better ways to handle this? </p>
<hr/>**评论:**<br/><br/>pafortin: <pre><p>I think that you can use "github.com/cloudfoundry/gosigar", for this. I wrote a small example that you can check out at: <a href="https://gocodecloud.com/snippets/monitor_system/" rel="nofollow">https://gocodecloud.com/snippets/monitor_system/</a></p></pre>Mastermachetier: <pre><p>This looks very interesting. I am moving over to go mostly from bash and perl I worked in devops with some monitoring tools, but I am looking to build some small stuff from scratch to get away from some of the more complicated big box solutions and make it a bit more simple and manage those configurations through tools like puppet. </p>
<p>Edit: Also like the website how did you build that if you don't mind me asking. </p></pre>pafortin: <pre><p>Thanks for the nice words. I built my site using Hugo - <a href="https://gohugo.io/" rel="nofollow">https://gohugo.io/</a> (all written in golang).</p></pre>Mastermachetier: <pre><p>very interesting I am looking to get into the web side of things my career so far has been all backend so I am still learning alot about doing front end stuff. </p></pre>miniwark: <pre><p>You have <a href="https://github.com/shirou/gopsutil" rel="nofollow">gopsutils</a> witch try to be similar to the Python psutil library. </p></pre>akhenakh: <pre><p>You can check on <a href="https://github.com/akhenakh/statgo" rel="nofollow">https://github.com/akhenakh/statgo</a> (author here) it has the advantage of being multi platform, BSDs ...
But the disadvantage of relying on cgo to access libstatgrab. </p></pre>Mastermachetier: <pre><p>This looks good as well. I am not to concerned with this being super fast but I support almost 20,000 servers which are AIX, HPUX, red hat, Windows and mixes of different versions of those oses luckily windows 2003 is now dead that being said multiplatform is a must for me. I may take inspiration from a few of the libraries out there and write a small one of my own. </p></pre>RwKroon: <pre><p>Maybe you can organize via Consul? you can install consul locally on supported hosts, or have 'legacy' hosts look at fixed consul endpoints. You can also enjoy full support from the hashicorp company when using <a href="https://github.com/hashicorp/consul" rel="nofollow">https://github.com/hashicorp/consul</a></p>
<p>downside: you probably have to write a client for each of your platforms to gather information in a uniform way.</p></pre>Mastermachetier: <pre><p>That is funny I was just at a golang talk by two employees of hashicorp. I ended up talking to one briefly about console. </p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传