[ale] Shell Script Question

Scott Steele roninazure at gmail.com
Fri Aug 12 13:04:07 EDT 2011


BTW...Thanks!

On Fri, Aug 12, 2011 at 11:08 AM, David Tomaschik
<david at systemoverlord.com>wrote:

> On Fri, Aug 12, 2011 at 11:03 AM, David Tomaschik
> <david at systemoverlord.com> wrote:
> > On Fri, Aug 12, 2011 at 10:57 AM, Scott Steele <roninazure at gmail.com>
> wrote:
> >> Thanks for your help so far on this, I received further clarification as
> >> to what I need to do and I think it requires a little tweaking. For the
> >> ones that are "state:reachable" I don't need any value returned, or
> >> maybe a simple echo statement that says "reachable" or a numeric value
> >> of "-1". I can change it if necessary.. For the ones that are in
> >> "state:unreachable". I need a count of how many return like that. Say
> >> 5,6,7, or so on.  So the output I am interested in is:
> >>
> >> -1 (good)
> >>
> >> or
> >>
> >> 5 (bad)
> >>
> >> This is the script so far that I have. For a reference point.
> >>
> >> #!/bin/sh
> >>
> >> export JAVA_HOME=/hosting/products/
> >> WebSphereU01/java
> >>
> >> #sets the environment in java
> >>
> >> #the values -p -bp and -ch will need to be altered according to what
> >> needs to be run.
> >>
> >> /hosting/ogsa/ogsa-6.1.0.5/ObjectGrid/bin/xsadmin.sh -p 26572 -bp 26570
> >> -ch nc3sz2ecmus02 -routetable | sed -e 's/.*state:reachable.*/>0/' e
> >> 's/.*state:unreachable.*/<0/' > `date "+%y%m%d%H%M%S"`.txt
> >>
> >> This is the output it produces in its current form.
> >>
> >>>0
> >>
> >>>0
> >>
> >>>0
> >>
> >> And so forth.
> >>
> >
> > Do you need just a single value to be output?  And is it actually
> > looking for output, or a return value?
> >
>
> Answering my own question (I think).  A quick search seems to indicate
> that SiteScope cares about return values, not output, so you could
> even do something as simple as this:
>
> return $(/hosting/ogsa/ogsa-6.1.0.5/ObjectGrid/bin/xsadmin.sh -p 26572
> -bp 26570 -ch nc3sz2ecmus02 -routetable | grep -c unreachable)
>
>
>
> --
> David Tomaschik, RHCE, LPIC-1
> System Administrator/Open Source Advocate
> OpenPGP: 0x5DEA789B
> http://systemoverlord.com
> david at systemoverlord.com
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20110812/fbe8042a/attachment.html 


More information about the Ale mailing list