View Full Version : Unix process status lamp
johnster
11-15-2002, 12:42 PM
Newby help please.
I am trying to get a script to check whether a unix process exists and then to display a red or green image depending on the result.
I have tried searching this site and would be grateful if anyone could give point me to an example.
chrismiceli
11-15-2002, 01:50 PM
unix process??
Bosko
11-15-2002, 02:25 PM
Ehm,this impossible to do with JavaScript.
johnster
11-15-2002, 03:09 PM
Sorry should have made myself clearer.
I want to check the unix process with a script and send the output to a file or to any other output that could be checcked
bcarl314
11-15-2002, 03:16 PM
Yep, still think js ain't gonna help you here. You'll probably need to use perl or some other server side language to pull this off.
Spookster
11-15-2002, 08:01 PM
As stated in the "MUST READ- How to post a JavaScript question!" thread:
5) Know the capabilities and limits of JavaScript before posting. Please familiarize yourself with what JavaScript can- and cannot do- before posting. Many people are posting JS questions that simply cannot be accomplished using the language, period. JavaScript is a client side language, and cannot manipulate the server end in any way, such as saving data to the server, accessing a database etc. JavaScript works strictly on the user end, such as popping up a window, applying an image rollover effect, or determining user screen resolution (*without* the ability to pass this info back to the server).
If JavaScript is completely new to you, please familiarize yourself somewhat with the language, by visiting the below links
- JavaScript questions and answers list (http://javascriptkit.com/javatutors/javascriptlist.shtml)
- JavaScript tutorials (http://www.javascriptkit.com/javaindex.shtml)
- Advanced JavaScript tutorials (http://www.javascriptkit.com/javatutors/index.shtml)
- Pre-made JavaScripts (http://www.javascriptkit.com/cutpastejava.shtml) (illustrates typical JS applications)
Dalsor
11-27-2002, 03:00 AM
This may be possible with PHP... Beyond getting the ps info into a flat file, though, I dunno.
exec('ps option | grep pid > ps.txt');
fsomething('ps.txt');
Easiest thing then would be test if ps.txt has something in it, and if so, you have a process. But I guess you'd need to know the exact pid in that case. hm... Not sure where to go from there, but maybe it will foster an idea.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.