0

Are there any means of formatting the output of shell commands to a structured data format like JSON or XML to be processed by another application?

Use case: Bunch of CentOS servers on a network. I'd like to programatically login to them via SSH, run commands to obtain system stats and eventually run basic maintenance commands. Instead of parsing all the text output myself I'm wondering if there is anything out there will help me return the data in a structured format? Even if only some shell commands were supported that would be a head start.

1
  • i think it needs to more than snmp in order to install software via yum for example. is there anything in between snmp monitoring, shell scripting and full blown config management like puppet/cfengine? Commented Apr 3, 2009 at 20:23

3 Answers 3

1

Sounds like the task for SNMP.

Sign up to request clarification or add additional context in comments.

Comments

1

It is possible to use puppet fairly lightly. You can configure it to run it's checks only on what you want to check for.

Your entire puppet config could consist of:

exec { "yum install foo":
  unless => "some-check for software",
}

That would run yum install foo but only if some-check for software failed.

That said there are lots of benefits if you're managing more that a couple of servers to getting as much of your config and build into puppet manifests (or cfengine, bcfg2, or similar) as possible.

Comments

0

Check out Nagios (http://www.nagios.org/) for remote system monitoring. What you are looking for may already exist out there.

1 Comment

nagios would answer the monitoring part but what if I wanted to install software using Yum or Apt-Get? Really just looking for an automated shell scripting system or lightweight config management without having to go all the way down the puppet route...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.