[TriLUG] scripted sesssions with ssh
Adam Stokes
adam.stokes at gmail.com
Mon Jul 13 20:46:18 EDT 2009
On Tue, Jul 7, 2009 at 11:32 PM, Lance A. Brown<lance at bearcircle.net> wrote:
>
>
> Joseph Mack NA3T said the following on 7/7/2009 9:57 PM:
>> On Tue, 7 Jul 2009, Heath Roberts wrote:
>>
>>> What are you monitoring? Could you maybe install an SNMP agent?
>>
>> a lot of the parameters don't have SNMP eg disk temp (via smartctl).
>> I've never used SNMP because it looks like a lot of work to write the
>> client/server (agent/something) whereas I can get the disk temp from
>> smartctl in one line with grep/awk.
>
> If you can get it with a quick command line, you can get the data via
> SNMP using 'exec' functionality in snmpd.conf. It lets you plug the
> output of a command (shell script, C, whatever) into SNMP so it can be
> queried.
>
>
> # You can also have programs run by the agent that return a single
> # line of output and an exit code. Here are two examples.
> #
> # exec NAME PROGRAM [ARGS ...]
> #
> # NAME: A generic name.
> # PROGRAM: The program to run. Include the path!
> # ARGS: optional arguments to be passed to the program
>
> #exec echotest /bin/echo hello world
>
> # Then,
> # % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.8
> # enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1
> # enterprises.ucdavis.extTable.extEntry.extNames.1 = "echotest"
> # enterprises.ucdavis.extTable.extEntry.extCommand.1 = "/bin/echo hello
> world"
> # enterprises.ucdavis.extTable.extEntry.extResult.1 = 0
> # enterprises.ucdavis.extTable.extEntry.extOutput.1 = "hello world."
> # enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0
>
> --[Lance]
>
> --
> GPG Fingerprint: 409B A409 A38D 92BF 15D9 6EEE 9A82 F2AC 69AC 07B9
> CACert.org Assurer
> --
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG FAQ : http://www.trilug.org/wiki/Frequently_Asked_Questions
>
also check out http://fedorahosted.org/func
--
( adam stokes ) || ( adam.stokes at gmail.com )
More information about the TriLUG
mailing list