Monitoring windows services (and others)

Hi,
I am just developing a small, modular monitoring utility, to remotly monitor specific computers on software crashes. Now I would like to code a module, that watches windows services. Are there any classes useful for this? There are a lot of programms listing service status remotely, but I found no useful documentation how they do so, and no (java) source code, that I could adept or at least unterstand. Any tips?
Thanks,
Rolf

I have actually done the same myself. I let a windows java-application run on a remote computer, and connected to it with Sockets. The remote application could then query the service states of the local computer.
I used PSTools http://www.sysinternals.com/Utilities/PsTools.html (free) for this purpose. The code is ugly but worked. You need to use Runtime.exec launching psservice and then parse the output with Process.getInputStream. Since you are bound to windows-NT platform (which services are), this should not be any problem.
Example:
Pattern pattern = Pattern.compile("\\d");
Process proc = Runtime.getRuntime().exec(new String[] {
               "c:\\pstools\\psservice.exe", "query", "A service name"
         BufferedReader lReader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
         String lLine;
         while ((lLine = lReader.readLine()) != null) {
            if (lLine.indexOf("STATE") >= 0) {
               Matcher lM = pattern.matcher(lLine);
               if (lM.find()) {
                  if (lM.group().equals("4")) {
                     System.out.println("Service is running");
                  } else {
                     System.out.println("Some other service state");
               return;
         }

Similar Messages

  • Monitoring Windows Services

    I'm trying to write a plugin to monitor Windows service status and trying to model what Grid does with the Windows Event Severity metric where you can add in multiple additional envnt logs to match by clicking the "Add" button in the Metric and Policy Settings>>Edit screen. Seems Grid does something with a property name called "NEED_CONDITION_CONTEXT" in these instances but there's no description of it in the docs nor the dtds. What I want to do is have a Windows service plugin where you can add in each service to monitor on a separate line by hitting the "Add" button. Any help would be appreciated.

    Hi,
    I would like to understand which EM console page your are referring to here? Are you creating a new user defined metric to monitor windows service or creating a new plug-in?
    plug-in creation involves writing the metedata files, archiving them and installing them using plug-in install wizerd..
    Anirban

  • How to monitor RAC services and nodeapps in Grid Control

    Hi,
    I have created a number of RAC service names such as GL on a 2-node RAC and would like to use Grid control 10.2.0.2 to monitor the availability of those services and nodeapps. I was not able to find anything in Grid Control that would allow me to configure that. What are being monitored now are the listeners, database instances and nodes. Would it be possible to monitor more than just the RAC listeners, instances and nodes?
    thanks.

    I don´t think that there is an out-of-the-box metric. However, CRS monitors your services and Grid Control monitors CRS errors. If you need more granular monitoring, I have 2 suggestions:
    1) user callouts:
    [http://download.oracle.com/docs/cd/B28359_01/rac.111/b28254/hafeats.htm#RACAD7133]
    2) extending oracle enterprise manager
    I have written a paper on how to extend oem at [http://www.ora-solutions.net/web/papers/]
    "Extending Oracle Enterprise Manager to collect HP-UX glance data"
    You can follow the instructions to build a new target type called "RAC_SERVICE" and add your serivces as targets, e.g. S_BATCH, S_ONLINE, S_HR.
    Best regards,
    Martin Decker
    www.ora-solutions.net
    Edited by: mdecker on Jan 2, 2009 10:57 AM
    Edited by: mdecker on Jan 2, 2009 10:59 AM

  • Iam not able to share internet in windows 8 from my macbook air...though my iphone ipad is connected to the hotspot well..tried everything but it seems to be different from windows 7  and other microsft operating systems setting. help!!

    Iam not able to share internet in windows 8 from my macbook air...though my iphone ipad is connected to the hotspot well..tried everything but it seems to be different from windows 7  and other microsft operating systems setting. help!!

    Ask on a Windows forum since that's what you're having a problem with.

  • How to differenciate purchase requsitions coming from services and others

    Hi,
       I would like to know how can i differenciate pr coming from services and pr coming from production.when i list the pr it is combining both.but i want the segregation of pr raised by services and others.any input...

    Hi,
    Are you able to differentiate the PR's by manually Checking them.
    If so how.Please mention the field
    Thanks & Regards
    Kishore

  • WHY SUCH AN INJUSTICE THAT BBM CANNOT BE USED ON MY CURVE 9300 OVER NORMAL DATA SERVICE AND OTHER PLATFORMS CAN USE!

    Hello,
    I am using Blackberry Curve 9300. I purchased this phone for Rs. 17,250 before some 3 years, I considered RIM to be a Company providing premium services which is unique in itself and which worth spending on them and the most important thing is those are not available to non-blackberry users! Especially in case of Blackberry Messenger, which is such a service connecting all the blackberry users around the world, making a mark of precious symbol of the users of BBM.
     Before few days I came to know about BBM being available on Android and Windows phones, my question is why this injustice with your own customers, you provide the app which they will use with their normal data plan and we people who are your real customers, who trusted in you have to spend not less than Rs.129 for just BBM!I must say RIM is the most back-stabbing company I have had ever dealt with! People are laughing at us as they are using the same service for almost free and we have to spend a huge sum for availing the same service, my question is are these non blackberry people your customers or we people who contributed in your success with hopes of trust?
    My question is not why you made available BBM usage to non-blackberry users with such flexibility but my question is why can't you be loyal to your own customers?
    I hope that RIM would have a pleasing justification.

    Thanks with the signature but I already removed it from my profile too.
    I was never under a rock when it comes to technology I know that in India before few months yoru Blackberry Z10 was Rs.44,000 and now it is Rs.21,000. I understand the ploy of making BBM cross platform to generate revenue, first in a technical sense and another by creating it advrtisement in the marker.
    Do you think that taking an undue advantage of our loyaty and enduring the mockery of your own customer would take you anywhere? Don't you think that abusing your own customer's prestige would even affect you negatively? While your customer is paying Rs.129 for just BBM the Android person sitting next to him is lauging at him for he paid you and call him fool! Profits doesn't starts only by making huge business decisions but from the loyal and satisfied customers. You may always find customers all around always complaining but deep down if you have touched their needs they will bless you with good words at your back, maybe in such a way that you will never come to kow but it will grow you more. I am not here to deliver you a marketing lecture as i am in corporate law field but let me tell you what I read during my graduation, it said something like one disatisfied customer can discourage ten potential customers from buying your product and I have started feeling the same in case of online shopping but I do not know when the company giant blackberry would come to know! 
    When you said about expanding customer base, think about a company who is expanding its base of customers by disatisfing their current customers who always took pride in you by providing them services at harsh terms and in front of their eyes others are getting benefits at a very low cost.
    Our family business is textile manufacturing, not as big as blackberry but we always knew that if we will start selling our goods by describing them as really premium goods and start charging out of lips and bounds, of course my product could be premium worth the price but one thing I could be missing would be a point of finance, there could be cheaper alternatives in market which could be selling at lower price which same usage. My concern is just to keep our eyes open.
    Now consider a phone on which I can use Whatsapp which satisfies my messaging needs, gtalk and yahoo messengers for my im needs, push mails for emails, browsing and downloading for just Rs.99 and on the other hand Blackberry services for Rs.389, it is indeed clear the reason of downfall, though it is labelled as premium service and indeed it could be, permium service as I said earlier.
    When you feel that your boat is sinking, you do not have only have to pull out the waters but on the priority basis you have to cover the hole too! Blackberry is just pulling out the water leaving the hole as it is!
    If you say that legacy mode in BBOS could bother you  from providing BBM for BB device, you know that it cannot be and even I know that, any technical person can know that as it is a little secret that I can use BB browser without BIS and many other apps are example of the same (to be a bit informal). See, I never asked this thing from last three years but now when you are making it cross platform why not to give a little benefits to those who paid you till now, if you can give it to those who are nothign to you?
    My question is that why can't you provide BBM to be used on the normal data paln for your own old and loyal customers who paid you such a handsome amount from many years for your services as how you provide on other platform, just for BBM not email and rest of your services?

  • Services in SAP management console and related window services and process

    hai
    can u please any one of you can send me the services in SAP management console and related window services(in adminstrator/services) and process in task manager.
    thanks in advance.
    Naga Laxmi

    Hi Naga,
    Please refer to this article for the processes relevant to the Java Instance:
    http://help.sap.com/saphelp_nw04/helpdata/en/62/1bf03eae11e16be10000000a114084/frameset.htm
    Except the processes of the Java instance you can find several processes of the IGS server and the ABAP disp+work processes.
    You can easily find the relevant services by their SAP prefix.
    Hope this helps.
    Best Regards
    Vyara

  • Holding Spotlight window size and others

    Hope this is easy no brainer that I can't remember- When I open spotlight into it's finder window (I am using cover flow mode) I have to always resize it to a larger view. How can I get it to remember the last open window size? I see this happen in some others windows as well.

    alucardbc wrote:
    Hello, I'm new to OS X, recently coming from Windows, and I was hoping someone could help me with something. I'm constantly bringing my Mac Mini from work and home, so the resolution is constantly changing
    I assume you're changing resolution because of very different monitors in the two places?
    That's the cause of the problem, obviously. 99.9% of users want things to remain the way they left them.
    . . . Never save windows position and size, always keeping them at OS X default. Is there a way to turn off the save windows position and size feature, or do I need to find and delete files holding these values.
    Unfortunately, no. This is done by each application, and if you delete the files, they'll come back each time you use the app again (and for most apps, you'll lose all their "preferences" as well.)
    Many apps will resize their windows to fit on (but not necessarily fill) the screen, if you click the green button in their menubars. In most cases that's probably not what you want, but may be the best you can do.
    The only other option I can think of is to find some way to use the same resolution for both monitors.

  • SCOM to monitor Windows Service

    Hi ,
    SCOM can monitor process level information (memory/cpu/is your service running/restart if it is not) of a windows service .  But what our experts say is SCOM cannot get the code-level details for performance issues(for Windows Service)  like you
    see on the SCOM AppDiagnostics site for the web applications/web services.Suppose if we want to get the specific dll or the function hitting the performance .
    Please suggest If SCOM is able to achieve code-level details for performance issues of Windows service also.
    Please let me know if you have any questions.
    Thanks,
    Deepak Upreti

    Hi Deepak,
    I donnot think that any one have guide on how to.
    If have I have do it, the I will use the Diagnostic Taks, where I will call some SysInternals tools(Process
    Explorer or Process Monitor) to collect data.
    That is the best I can do for you.
    Best Regards Christian 'Biks'

  • How to restrict users working on Windows 7 clients from accessing Windows Explorer and other systems in the network through Group Policy with a domain controller running on Windows Server 2008 r2

    Dear All,
    We are having an infrastructure setup of around 500 client computers managed through group policy.
    Recently the domain controllers have been migrated from Windows Server 2003 to Server 2008 R2.
    Since this account requires extremely strict environment, we need to figure the solution for restricting the users from access anything locally.
    It would be great if you can assist me with the following query.
    How to restrict users logged on Windows 7 clients from accessing Windows Explorer and browsing other systems in the network through Group Policy with a domain controller running on Windows Server 2008 r2 ?
    Can we disable Network Tab on the left hand pane ?
    explorer.exe is blocked already, but users are able to enter the Windows Explorer by clicking on the name which is visible on the Start Menu.

    >   * explorer.exe is blocked already, but users are able to enter the
    >     Windows Explorer by clicking on the name which is visible on the
    >     Start Menu.
    You cannot block explorer.exe when you do not replace the shell - the
    desktop you see effectively IS explorer.exe...
    Your requirement sounds like you need a custom shell:
    http://gpsearch.azurewebsites.net/#2812
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • XFCE, window effects and other questions.

    I really like XFCE mostly because it has what I need and it is really fast.
    Anyway, first I have activated a few effects and that is to have my inactive windows transparent and all windows titlebar it all working good. But is there any way to exclude any window from the transparency stuff?
    Another thing is that I have pidgin installed to use ICQ and MSN works nice, But is it posible to hide the "taskbutton" for pidgin on the task/window list that is normally at the top of the screen? And maybe also from alt+tab/middle-click menu.

    McZ wrote:Anyway, first I have activated a few effects and that is to have my inactive windows transparent and all windows titlebar it all working good. But is there any way to exclude any window from the transparency stuff?
    I don't think there's any way to do it within Xfwm, but you could try devilspie. It's in [extra].

  • Configuring PerformancePoint Service and other BI when you're on an O365 Sharepoint site

    Sharepoint online is great. Easy to use. relatively stable. But I cannot find any protocol, in absence of having access to Central Administration (how I wish I did), to configure PPS and other elements I need to begin leveraging reporting and dashboards.
    Does anyone know how I do this? Do I have to hand feed the steps to some CIM Sharepoint Tier engineer to execute for me? Or is there another way.

    O365 does not support the traditional BI features (PerformancePoint, Excel Services with connected data sources, PowerPivot to external data sources, etc). The reasons for this are numerous (no connections back to data centers, use of claim tokens, use of
    shared webapps and therefore shared app pool accounts, etc).
    For several reasons, this is why MS is pushing "PowerBI", which is a separate half-answer to the whole hosted BI issue. But this is NOT the same as PPS/etc.
    If you want BI, you need on-prem (or hybrid, where the BI components are on-prem).
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Help installing Windows ME and other programs on my K7N420 Pro

    I've got this issue where I've tried to understand why some of my programs don't work when I try various installation routines for my PC. Here's what I have:
    CPU: AMD Athlon XP 1700+
    Memory: 192
    Graphics: GeForce TI 4600
    Sound: Creative Live MP3+
    I have the following pieces of software:
    Windows 98/ME/XP
    nForce system drivers
    All original drivers for my graphics/sound cards.
    At one point I was able to run any game demo on my PC before I had to reformat my PC; every since I've not been able to get any demo to run; of course all of my other games/applications run fine.
    I've also had issues installing the nForce drivers. I've installed them right after installing Windows ME and after updating ME, mostly things are OK but there are issues.
    If anyone has any advice on what programs to install and when I would be very appreciative. Please email me anytime at: [email protected]
    Thanks,
    Christopher

    I guess my first question for wonkanoby is, in which order should I install the drivers after I have Windows ME installed?  My second question is, after those drivers are installed, what next, install the sound card driver? Oh, and when should I install the updates for ME?
    I also agree that I should be better off with Windows XP but every time I've installed it, I've had horrible system performance. For example, every game I have installed that works great under ME is slowed under XP.
    I currently have "Age of Wonders II" and "No one lives forever 2" installed on my PC and only AOWII is currently -- NOLF2 freezes on the first load screen. The demos that I'm trying to get working are "Unreal Tournament 2003", James Bond Nightfire", and "Asheron's Call."
    I also got the latest Live Driver 2 from MSI and used it to get the latest nForce drivers.
    The reason I had to initially reformat my PC was due to a virus that got to my boot record.
    thx,
    Christopher

  • Is there a way to monitor a services and restart the services?

    Hello,
    i hope i am posting in the right forum. Basically i am running Filemaker Server and i wanted to monitor the FM Services demon that run on the background but also i wanted to set up script that if the FM Service Demon goes down to restarted it. I am running Mac os X Server 10.4.6 on Xserver G5.
    thank you
    victor

    I haven't really done anything with it, but in OS X Server 10.4, launchd handles starting/restarting daemons that it is watching. If I understand it correctly, as long as launchd starts a process, it will be watched.
    If you look at page 39 of the Command Line manual (http://manuals.info.apple.com/en/CommandLinev10.4.pdf), there is a bit of information there. Also, http://www.afp548.com has some really good info on launchd, if I recall. You can probably figure out if FileMaker Server is started by launchd or, if not, how to get launchd to handle it.
    Aside from that, I just started looking into monit (http://www.tildeslash.com/monit/) to see if it would work for me, which seems like it can do sort of the same thing, perhaps with more notification and reporting.

  • Monitoring windows services from JavaI Know how to

    I know how to start and stop services in java, but how can I see if a process is already stared or is starting?
    Thx

    You'll need to make a call to a suitable Windows program using Runtime or ProcessBuilder methods, or use JNI (Java Native Interface.) From Wikipedia:
    (JNI) is a programming framework that allows Java code running in the Java virtual machine (JVM)
    to call and be called[1] by native applications (programs specific to a hardware and operating system
    platform) and libraries written in other languages, such as C, C++ and assembly.

Maybe you are looking for