aspose file tools*
The moose likes Linux / UNIX and the fly likes Monitoring script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Monitoring script" Watch "Monitoring script" New topic
Author

Monitoring script

Bhargo Dev Arya
Greenhorn

Joined: Jun 29, 2011
Posts: 8

hi everyone,

I am trying to create a monitoring script. I have created a script that checks for the mandatory processes.
I want to now what are the other ways in which this script can be run apart from being run as a daemon process.

thanks in advance
bhargo
Bhargo Dev Arya
Greenhorn

Joined: Jun 29, 2011
Posts: 8

also if we exclude the option of a cron job then what can we do to run a monitoring script?

thanks in advance
bhargo
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Define "monitoring script". What are the requirements?
Bhargo Dev Arya
Greenhorn

Joined: Jun 29, 2011
Posts: 8

there are a few processes that are running on the host....
I want to monitor whether they are up and running, if not then some action is taken...
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
OK. In order to suggest alternatives we'd have to know why you regard running the script as a cron job deficient.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11526
    
100

I agree with Tim - not enough information to go on.

This may simply be a homework assignment, in which case certain answers would not normally be deemed reasonable alternatives. Or there may be a real production need, wherein practicality may trump theoretical "best".

Assuming that I do not have access to cron, I might consider whether a CGI script would suffice - again, this is very dependent on your (non stated) requirements.


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Bhargo Dev Arya
Greenhorn

Joined: Jun 29, 2011
Posts: 8

Hi everyone

please excuse my naivety, I am fairly new to unix and probably I havent been able to explain myself properly.
I am just trying to explore more options apart from cron and daemon.
I know these can work perfectly when it comes to monitoring processes, but is it better to have a java code having a thread that executes a script that monitors continuously, rather than executing the script on the server itself.
what would be a better approach?
this is not my homework...... :P

regards
bhargo
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
It's better not to involve Java, it just complicates matters without providing much of a benefit. This is what cron is for.
Ifteqar Ahmed
Ranch Hand

Joined: May 02, 2011
Posts: 85

Thanks.....

It helped me
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16308
    
  22

Tim Moores wrote:It's better not to involve Java, it just complicates matters without providing much of a benefit. This is what cron is for.


Actually, in cases where you're monitoring, this is what Nagios, Big Brother, etc. are for. They not only allow periodic execution of a query script, they provide a central dashboard to monitor a whole raft full of query scripts.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Monitoring script