Discussion:
run command output to server
(too old to reply)
Brad
2005-11-28 21:03:36 UTC
Permalink
I saw the previous post on this subject, but I decided I will
create my own thread. I will provide a specific example of what
I want to accomplish.

I have a perl script called uptime.pl that I read an XML file with
the uptime of my server in it. Currently the file reads the uptime
from the XML file then displays the uptime in the perl output screen.
The screen that says, "<Press any key to continue...>"

I would like the output from that perl script to just dump straight
to my NetWare console screen.

currently I'm just executing a "print" command in the perl script to
get the output to screen. What other options do I have?

I tried an echo, but it wants to load echo.nlm and therefore doesn't work.
Because echo.nlm can only be executed from the bash shell.

Any other suggestions?
Thanks
Brad B.
Guenter Knauf
2005-11-28 23:28:25 UTC
Permalink
Hi Brad,
Post by Brad
I saw the previous post on this subject, but I decided I will
create my own thread. I will provide a specific example of what
I want to accomplish.
I have a perl script called uptime.pl that I read an XML file with
the uptime of my server in it. Currently the file reads the uptime
from the XML file then displays the uptime in the perl output screen.
The screen that says, "<Press any key to continue...>"
I would like the output from that perl script to just dump straight
to my NetWare console screen.
currently I'm just executing a "print" command in the perl script to
get the output to screen. What other options do I have?
I tried an echo, but it wants to load echo.nlm and therefore doesn't work.
Because echo.nlm can only be executed from the bash shell.
Any other suggestions?
use my NLM (which you can also directly call as CGI from Apache2):
http://www.gknw.com/development/uptime/

beside that there are a couple of other ways to print the uptime to
console; just from Perl I'm not sure....; from Nscript its no prob since we
can use the C function ConsolePrintf....; maybe teh UCS/UCS stuff can do
too - I guess so....
also you can call Perl with the option --noscreen so that the output gets
to the logger, just not to the console....(but I guess my NLM also goes to
logger...).
If you really need that printed on console for whatever reason then I can
recompile it with ConsolePrintf() - but then please also tell me for what
you need it ??

greetz, Guenter.
Brad
2005-11-29 15:12:31 UTC
Permalink
Post by Guenter Knauf
If you really need that printed on console for whatever reason then I can
recompile it with ConsolePrintf() - but then please also tell me for what
you need it ??
greetz, Guenter.
Hi Guenter,
Thanks for the info. The main reason I was creating my script was to do
something different in perl. I already had a perl script that read some
volume size info from some XML files. Then when I found the uptime
was stored in a file I decided to create a perl script to display that
as well. The script does two different things. 1, if I just run it
from the command line, it will display the uptime, that's the part that
I want it to display straight to the console rather than the perl window.
2 is, if I pass the script the variable "free" it will email me the uptime
of the server. Which I think is cool. I was hoping someone in this forum
would know something!

Thanks!
Brad B
Guenter Knauf
2005-11-30 04:44:59 UTC
Permalink
Hi Brad,
Post by Brad
Thanks for the info. The main reason I was creating my script was to do
something different in perl. I already had a perl script that read some
volume size info from some XML files. Then when I found the uptime
was stored in a file I decided to create a perl script to display that
as well. The script does two different things. 1, if I just run it
from the command line, it will display the uptime, that's the part that
I want it to display straight to the console rather than the perl window.
2 is, if I pass the script the variable "free" it will email me the uptime
of the server. Which I think is cool. I was hoping someone in this forum
would know something!
were my tips not helpful?
Since NW6 we are not allowed to use the console screen anymore - instead even
ConsolePrintf() goes to the logger; so the only thing which I can output to
console is with an NLM, or probably with the UCS/UCX controls too...
however on NW 5.1 where's no logger this output goes to the console.
btw. in which file you found the uptime present?

Guenter.
Brad
2005-12-07 19:54:01 UTC
Permalink
Post by Guenter Knauf
were my tips not helpful?
Since NW6 we are not allowed to use the console screen anymore - instead
even ConsolePrintf() goes to the logger; so the only thing which I can
output to console is with an NLM, or probably with the UCS/UCX controls
too... however on NW 5.1 where's no logger this output goes to the
console. btw. in which file you found the uptime present?
Guenter,
Your tips were helpful, just not the answer I was looking for.
Plus your suggestion was to run an NLM to do this and I would rather
use perl. Plus, you suggest calling the "CGI from Apache2" so I
would need to run this from a web browser? I'm not 100% sure how
to put the stuff together that you suggested. I don't see why
we can just output to the screen from perl, many other NLMs still
do it. At worst case I could output to the logger, but no one
has suggested how to do that either.

As far as the file where the uptime is:
_Admin:Novell\NRM\NRMGENINFORMATION.XML

Perhaps you could make an NLM that would just output the
uptime to the console screen. Or help me figure out
how to do that?
BB
Guenter Knauf, DevNet SysOp 32
2005-12-08 00:47:55 UTC
Permalink
Hi Brad,
Post by Brad
Post by Guenter Knauf
were my tips not helpful?
Since NW6 we are not allowed to use the console screen anymore - instead
even ConsolePrintf() goes to the logger; so the only thing which I can
output to console is with an NLM, or probably with the UCS/UCX controls
too... however on NW 5.1 where's no logger this output goes to the
console. btw. in which file you found the uptime present?
Guenter,
Your tips were helpful, just not the answer I was looking for.
Plus your suggestion was to run an NLM to do this and I would rather
use perl. Plus, you suggest calling the "CGI from Apache2" so I
would need to run this from a web browser? I'm not 100% sure how
yep - but I also wrote 'optionally'!!
it just seems to me that most are more comfortable with using a browser
rather than hassling with remote consoles...
Post by Brad
to put the stuff together that you suggested. I don't see why
we can just output to the screen from perl, many other NLMs still
do it. At worst case I could output to the logger, but no one
has suggested how to do that either.
regarding perl to logger that can be done + I suggested that already in my
first reply!
Post by Brad
_Admin:Novell\NRM\NRMGENINFORMATION.XML
Perhaps you could make an NLM that would just output the
uptime to the console screen. Or help me figure out
how to do that?
I did this already in the past, also I pointed to it already in my first
reply:
http://www.gknw.com/development/uptime/

pleas re-read my first reply - I have answered everything there already.
but here in short:
call your script with:
perl --noscreen yourscript.pl
that goes to the logger and terminates without 'press any key...' message.

Guenter.
Brad
2005-12-08 01:05:18 UTC
Permalink
Hi Guenter,
Post by Guenter Knauf, DevNet SysOp 32
I did this already in the past, also I pointed to it already in my first
http://www.gknw.com/development/uptime/
You are correct, you did answer that. It's been a few days since
I read your post last. You had said you could try to recompile your
nlm to make it output to the console. Did you try that?
When I first downloaded the zip file I didn't see the uptime.nlm
in there. It looked like I needed to compile it myself which I'm
not really comfortable doing.
Post by Guenter Knauf, DevNet SysOp 32
pleas re-read my first reply - I have answered everything there already.
perl --noscreen yourscript.pl
that goes to the logger and terminates without 'press any key...' message.
Ahhh.. Yes, you did say that before too. I totally missed it as well.
I assumed you were refering to the --autodestroy option which opens
the perl window then closes it. Not exactly the same, but similar.
I like your suggestion better.

I wonder. If there is not a way to output to the console, then how about
a method of forcing the window to switch from the console to the
logger window after the script or NLM is run? That would be much
less cumbersome!

Thanks!

Brad B
Guenter Knauf, DevNet SysOp 32
2005-12-08 02:14:39 UTC
Permalink
Hi Brad,
no reply, that comes later - just another link to an older Perl script I've
just polished for usage on NW65 - works fine from console (to logger or own
screen) as well as used as CGI:
http://www.gknw.com/nwperl/perlucx/snmpuptime.pl

later, Guenter.
Guenter Knauf, DevNet SysOp 32
2005-12-08 02:43:28 UTC
Permalink
Hi Brad,
Post by Brad
You are correct, you did answer that. It's been a few days since
I read your post last. You had said you could try to recompile your
nlm to make it output to the console. Did you try that?
No. As I said before we are not allowed to print to console screen anymore.
Novell has changed their API in such a way that it is now a pain to print
to console - and unless you hire me for that I'm not willing to hack that
together. It's not just a recompile - as you will see when you use my NLM
it does work fine - just that the output goes to logger.
Now for getting it printing to console screen I would have to move back to
clib (thats the smallest prob!), and then dig up some code in my archives
before y2000 how to obtain a screen handler since I have that not handy,
and not in mind anymore. So coding would last 5 minutes, but digging up the
information needed probably 3+ hours... - no time for that, sorry.
Post by Brad
When I first downloaded the zip file I didn't see the uptime.nlm
in there. It looked like I needed to compile it myself which I'm
not really comfortable doing.
you got the wrong zip - use this one:
http://www.gknw.com/development/uptime/uptime-0.4.0-nw.zip
should contain 2 NLMs, one for older LibC.
Post by Brad
Ahhh.. Yes, you did say that before too. I totally missed it as well.
I assumed you were refering to the --autodestroy option which opens
the perl window then closes it. Not exactly the same, but similar.
I like your suggestion better.
I wonder. If there is not a way to output to the console, then how about
a method of forcing the window to switch from the console to the
logger window after the script or NLM is run? That would be much
less cumbersome!
hmmm, but isnt that exactly what you get with the separate screen??
f.e. if you use a loop where you print the uptime 5 times and sleep for a
second, then when you call that from console the screen switches
automatically to the new created screen, then displays the uptime for 5
secs and then closes the screen (with --autodestroy) and therefore switches
back to console....??

Guenter.
Guenter Knauf, DevNet SysOp 32
2005-12-08 04:01:22 UTC
Permalink
Hi Brad,
here's the simple clib hack:
http://www.gknw.com/development/samples/nlmconv/uptime_clib.zip
I believe this simple NLM runs on NW 3.x to 6.x, just only that it displays
on the logger from NW6 on....
Also I spent few minutes with diving into another sample from me;
scroll down and look for actscr:
http://www.gknw.com/nwlinks.html

but when I looked at it I think I recalled that I got abends when I tried to
activate the system console and print to it...
Also I recall now that we had a big discussion in the clib forum years ago
when this came up - maybe there was finally a solution, but I'm too lazy to
dig that up; also it may be that it was before the newsgroups crashed, and
might anyway be gone for ever.....
feel free to dig through the clib forum for 'console screen'...

Guenter.

Loading...