get a status output
hi
I've this perl script: Code:
#!/usr/bin/perl -w howto change it to get the output status in the browser: "ntop is not running" or "ntop was killed" kind regards cccc |
At what point do you want it to display that?
|
for example:
ntop was killed with... or ntop exited with value... |
Isn't that already in there?
|
No, I get:
Code:
Software error: |
And you didn't think to mention that in your original question?
Does it really just show ..., or is there more detail? |
no, you're completely right !
I'm looking for a output solution, if I have like in my first or like in the second question, I'll be happy. greetings cccc |
Ah, wait, I see, you intentionall just output "...". Nice error message. Very microsoftesque. :)
You need to (I think) remove the & from the end of your my $stop = ... line. |
I changed to:
Code:
my $return = 'ps -eaf |grep $process |grep -v grep'; |
If you use backquotes around the cmd instead of single quotes, you'll get the returned text in $stop.
|
Backquotes are little bit dangerous
The expression within the backticks is executed upon assignment, and the $stop variable will hold the output of the expression. Later, when I try to use system($stop) it would try to execute all that mess the ntop.sh program printed out. I cannot take the output of ntop, and feed it back to system! |
Then don't execute it through system(). Your system() call is failing, obviously.
|
Yes, you're completely right.
but how can I stop in other way ? or is it: Code:
system '/usr/local/bin/sudo /usr/local/www/cgi-bin/ntop/ntop.sh stop' and die "... "; |
All times are GMT -5. The time now is 05:17 AM. |