Show service status in dialog


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Show service status in dialog
# 1  
Old 09-12-2014
Linux Show service status in dialog

Hello is it possible to show current status of service like cron with dialog ?

something that show the output of service crond status
in top of menu:

Code:
dialog --title "Administrator" --menu "Please choose an option:" 20 55 10 \
1 "Add New USER" \
2 "List all user" \
3 "Remove user" \
4 "User Details" \
10 "Exit" 2>/tmp/menuitem.$$

# 2  
Old 09-12-2014
Hello nimafire,

I have a few to questions pose in response first:-
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far? This menu doesn't actually drive anything yet.

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.



Regards,
Robin
# 3  
Old 09-13-2014
Quote:
Originally Posted by rbatte1
Hello nimafire,

I have a few to questions pose in response first:-
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far? This menu doesn't actually drive anything yet.

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.



Regards,
Robin
Ok, now i have new question, do we have other style more than dialog ?

i want to have something like ajax that show $STATUS in my menu and refresh every 5 min
# 4  
Old 09-15-2014
Okay, so now I'm very confused. You didn't answer any of the questions and bring in something I'm not familiar with. What is ajax? Is it software, a command or a member of this community?

I'm not going to be able to help if you don't show what you have tried.



Robin
# 5  
Old 09-15-2014
Hi,

Ajax is described here, I've heard of it but never used it myself.

Regards

Dave
This User Gave Thanks to gull04 For This Post:
# 6  
Old 09-15-2014
ajax needs to call local code to call local code. Meaning: for every OS it connects to it has some kind of locally DIFFERENT "api" call to get what you want. Therefore, the call is platform dependent. Base java has as a last resort the system method/call: as one clumsy way to do what you want. In order to get you an answer we need:

platform this is going to run on (OS name version)

Examples of what I mean as the issue:

Code:
ps -ef | grep -v grep |  grep -q  crond

This lousy bit of code will probably work on most modern Unix OSes. It requires modern a grep (supports -q) so it will not work on some older systems.

Some OSes have a commands that shows service information: Solaris, Red Hat, and so on.
Solaris (from the command line:
Code:
svcs  /system/cron


Last edited by jim mcnamara; 09-15-2014 at 12:03 PM..
# 7  
Old 09-15-2014
Quote:
Originally Posted by rbatte1
Hello nimafire,

I have a few to questions pose in response first:-
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far? This menu doesn't actually drive anything yet.

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.



Regards,
Robin
OK let me answer your question as you ask me ,
i havent receive any error,
i want to code a shell script with dialog ,which can show status of service XYZ in the top part of screen,
question is, is it possible to show $STATUS which bind to :
service crond status
and show $STATUS in real time?
because this script can get status of crond ONLY when we run script,

---------- Post updated at 12:48 PM ---------- Previous update was at 10:22 AM ----------

Quote:
Originally Posted by jim mcnamara
ajax needs to call local code to call local code. Meaning: for every OS it connects to it has some kind of locally DIFFERENT "api" call to get what you want. Therefore, the call is platform dependent. Base java has as a last resort the system method/call: as one clumsy way to do what you want. In order to get you an answer we need:

platform this is going to run on (OS name version)

Examples of what I mean as the issue:

Code:
ps -ef | grep -v grep |  grep -q  crond

This lousy bit of code will probably work on most modern Unix OSes. It requires modern a grep (supports -q) so it will not work on some older systems.

Some OSes have a commands that shows service information: Solaris, Red Hat, and so on.
Solaris (from the command line:
Code:
svcs  /system/cron

i have try ps -ef | grep -v grep | grep -q crond
but nothing is display in output
Centos 6.5
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script killing a process from service status output

Hello, can some please suggest a script, for killing the process PID. This are steps I am currently performing to kill the process. I cant user service splunk stop, to kill these processes, because of uid and gid mismatch for splunk user. # service splunk status Splunk status: splunkd... (8 Replies)
Discussion started by: bobby320
8 Replies

2. UNIX for Dummies Questions & Answers

Finding service status on windows from Linux

Hi all, Please advise how do i find services status running on windows machines from Linux. =-===================== Some one developed a script use rsh command to find the status but it stopped working. rsh <Some IIS server Name> service -S < Windows Server name where service running>... (1 Reply)
Discussion started by: ashish_uiit
1 Replies

3. AIX

service status in AIX

good afternoon to all hay i m new in AIX. my problem is that.....plz tell me how to see " service status" in AIX Becoz i run /etc/rc.d/rc.2/Sbesclientd so its show below like this bash-3.2$ sudo /etc/rc.d/rc2.d/SBESClientd status Usage: /etc/rc.d/rc2.d/SBESClientd { start | stop } I... (2 Replies)
Discussion started by: life008
2 Replies

4. UNIX for Dummies Questions & Answers

service exit status

what are the number for the exit status for command service and what does every number mean. (2 Replies)
Discussion started by: programAngel
2 Replies

5. Shell Programming and Scripting

Show status of progress?

So, What is the best method, if even possible, to display a percentage or a status or progress of a certain command? For example I am forcing a block copy of a an OS image from one machine to another via a shell script and would like for it to display a progress or status so I know if it is... (3 Replies)
Discussion started by: tlarkin
3 Replies

6. Red Hat

#service --status-all : screen flickering

hi there when i run #service --status-all or #service nfs status the screen flickers if i ssh from remote system than i dont have flickering on the remote nor that system. is it something to do with probably display configuration. ? and which file are the display setting... (7 Replies)
Discussion started by: dplinux
7 Replies

7. Shell Programming and Scripting

Unix / Linux Dialog Utility - how to open 2+ more dialog windows ?

Hi, example of Unix / Linux dialog utility is below. I am going to use dialog as simple GUI for testing of a modem. So I need to combine some dialog boxes into one. I need to have input box, output box, info box, dialog box, radiobox as in any standard program with graphical user... (2 Replies)
Discussion started by: jack2
2 Replies

8. Solaris

How can i know service status in solaris8,9?

How can i know service status and its dependencies in solaris 8,9? Thanks in advance.. (2 Replies)
Discussion started by: younus_syed
2 Replies

9. HP-UX

Monitor Service Status

Hey guys how do you determined the status of a certain service if its running or not aside from using ps. (0 Replies)
Discussion started by: sbn
0 Replies

10. Linux

Ftp Service /process Status

:confused: Hi Can anyone tell me how to check the FTP process status in linux . eg,I'm ftpping some files from "A" server to "B" server through FTP command , after ftpping these files , I 'm suppose to delete the files which are successfully ftpped from "A" server ,but when I 'm checking the... (1 Reply)
Discussion started by: GaneshB
1 Replies
Login or Register to Ask a Question