473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Writing monitoring program VC++

Hi

Hope that some one can help with the following. I wish to write a
Visual C++ program, which monitors 3-4 other services (process/programs
also written in VC++).
The program shall monitor, if the other processes are alive and to see,
if they are sending heartbeat messages. I wish to do this for exampel
via socket programming.

Can any one tell me, the structure og guideline for this?

My email is: mo***********@yahoo.com

Thanks in advance.

Best regards
Mojtaba

Jun 13 '06 #1
7 4319
mo***********@yahoo.com wrote:
Hi

Hope that some one can help with the following. I wish to write a
Visual C++ program, which monitors 3-4 other services (process/programs
also written in VC++).
The program shall monitor, if the other processes are alive and to see,
if they are sending heartbeat messages. I wish to do this for exampel
via socket programming.

Can any one tell me, the structure og guideline for this?

My email is: mo***********@yahoo.com

Thanks in advance.

Best regards
Mojtaba


The easiest way is to ask again in a windows-specific newsgroup.

Ben
Jun 13 '06 #2
On Tue, 13 Jun 2006 00:38:14 UTC, "mo***********@yahoo.com" <mo***********@yahoo.com>
wrote:
Hi

Hope that some one can help with the following. I wish to write a
Visual C++ program, which monitors 3-4 other services (process/programs
also written in VC++).
The program shall monitor, if the other processes are alive and to see,
if they are sending heartbeat messages. I wish to do this for exampel
via socket programming.

Can any one tell me, the structure og guideline for this?
It doesn't sound like anything is VC++ specific. TCP/IP or UDP/IP
are certainly options that work well for other projects. I'm not
sure what your question is though. Would your application just
intrface with the services as they are today or is the socket
protocol for this something that you are considering to add?
My email is: mo***********@yahoo.com

Thanks in advance.

Best regards
Mojtaba


Jun 13 '06 #3
Hi again

Yes, I am considering socket solution. The services are
processes/programs (not windows services), and they send messages
(heartbeat), so the new monitoring program has to check whether they
are sent and otherwise alarm.
Thanks in advance.

Mojtaba

David wrote:
On Tue, 13 Jun 2006 00:38:14 UTC, "mo***********@yahoo.com" <mo***********@yahoo.com>
wrote:
Hi

Hope that some one can help with the following. I wish to write a
Visual C++ program, which monitors 3-4 other services (process/programs
also written in VC++).
The program shall monitor, if the other processes are alive and to see,
if they are sending heartbeat messages. I wish to do this for exampel
via socket programming.

Can any one tell me, the structure og guideline for this?


It doesn't sound like anything is VC++ specific. TCP/IP or UDP/IP
are certainly options that work well for other projects. I'm not
sure what your question is though. Would your application just
intrface with the services as they are today or is the socket
protocol for this something that you are considering to add?
My email is: mo***********@yahoo.com

Thanks in advance.

Best regards
Mojtaba


Jun 13 '06 #4
Hello Mojtba,

On Tue, 13 Jun 2006 22:30:24 UTC, "mo***********@yahoo.com" <mo***********@yahoo.com>
wrote:
Hi again

Yes, I am considering socket solution. The services are
processes/programs (not windows services), and they send messages
(heartbeat), so the new monitoring program has to check whether they
are sent and otherwise alarm.
Thanks in advance.
It doesn't really matter how the processes/programs are implemented
or where they reside. That is some of the beauty of using TCP/IP.
All you need is some central monitoring location/application that
the processes/programs know to contact. Conversely you may choose
to have your monitor register with the processes/programs for
notifications or even a mixture of both. Most of my products have
chosen to use a mixed approach and once a bond has been created
between a downstream device and an upstream device they continue
to expect the conversation to recover if at all possible, and
report when nodes fall out of service. I use a mixture of alarm
modes. Some communication failures are reported almost immediately
when the loss affects the integrety of the network. There are also
some low level "I'm alive, nothing to report" communications that
occur once a day or so that don't use an always up connection;
those alarm when a device has not been heard from in a while.

You can use whatever alarm strategy is appropriate to your needs.

I'm not sure if we've touched on your original inquiry.

Good luck,

David
Mojtaba

David wrote:
On Tue, 13 Jun 2006 00:38:14 UTC, "mo***********@yahoo.com" <mo***********@yahoo.com>
wrote:
Hi

Hope that some one can help with the following. I wish to write a
Visual C++ program, which monitors 3-4 other services (process/programs
also written in VC++).
The program shall monitor, if the other processes are alive and to see,
if they are sending heartbeat messages. I wish to do this for exampel
via socket programming.

Can any one tell me, the structure og guideline for this?


It doesn't sound like anything is VC++ specific. TCP/IP or UDP/IP
are certainly options that work well for other projects. I'm not
sure what your question is though. Would your application just
intrface with the services as they are today or is the socket
protocol for this something that you are considering to add?
My email is: mo***********@yahoo.com

Thanks in advance.

Best regards
Mojtaba

Jun 14 '06 #5
Hi David

Many thanks for your response.
If I wish to use the registration method, how can it be implemented. I
mean can you give some idea of designing the monitoring module, may be
alos one without registration.

I need some structure to start this.

Thanks

Regards
Mojtaba

David wrote:
Hello Mojtba,

On Tue, 13 Jun 2006 22:30:24 UTC, "mo***********@yahoo.com" <mo***********@yahoo.com>
wrote:
Hi again

Yes, I am considering socket solution. The services are
processes/programs (not windows services), and they send messages
(heartbeat), so the new monitoring program has to check whether they
are sent and otherwise alarm.
Thanks in advance.


It doesn't really matter how the processes/programs are implemented
or where they reside. That is some of the beauty of using TCP/IP.
All you need is some central monitoring location/application that
the processes/programs know to contact. Conversely you may choose
to have your monitor register with the processes/programs for
notifications or even a mixture of both. Most of my products have
chosen to use a mixed approach and once a bond has been created
between a downstream device and an upstream device they continue
to expect the conversation to recover if at all possible, and
report when nodes fall out of service. I use a mixture of alarm
modes. Some communication failures are reported almost immediately
when the loss affects the integrety of the network. There are also
some low level "I'm alive, nothing to report" communications that
occur once a day or so that don't use an always up connection;
those alarm when a device has not been heard from in a while.

You can use whatever alarm strategy is appropriate to your needs.

I'm not sure if we've touched on your original inquiry.

Good luck,

David
Mojtaba

David wrote:
On Tue, 13 Jun 2006 00:38:14 UTC, "mo***********@yahoo.com" <mo***********@yahoo.com>
wrote:

> Hi
>
> Hope that some one can help with the following. I wish to write a
> Visual C++ program, which monitors 3-4 other services (process/programs
> also written in VC++).
> The program shall monitor, if the other processes are alive and to see,
> if they are sending heartbeat messages. I wish to do this for exampel
> via socket programming.
>
> Can any one tell me, the structure og guideline for this?

It doesn't sound like anything is VC++ specific. TCP/IP or UDP/IP
are certainly options that work well for other projects. I'm not
sure what your question is though. Would your application just
intrface with the services as they are today or is the socket
protocol for this something that you are considering to add?

> My email is: mo***********@yahoo.com
>
> Thanks in advance.
>
> Best regards
> Mojtaba


Jun 14 '06 #6
Hello Mojtaba,

On Wed, 14 Jun 2006 01:37:27 UTC, "mo***********@yahoo.com" <mo***********@yahoo.com>
wrote:
Hi David

Many thanks for your response.
If I wish to use the registration method, how can it be implemented. I
mean can you give some idea of designing the monitoring module, may be
alos one without registration.
It might be best to start simple and work your way up. The communication
concpts are pretty much the same. The more advanced versions can be more
like peer networks (todays name for the ancient idea of having both ends
of a communication protocol be able to (re)start a conversation with the
other end).

I'd start by deciding on a simple client-server or peer-peer relationship.
You need to define the basic rules for which components initiate the
conversations, what they have to communicate, how to properly disconnect
them, and how to recognize an abnormal situation.

First you'll need to decide what your communication endpoints are like.
In simplest terms, this might be the IP Address or Domain Name for an
endpoint, and the well known port that enables your endpoints to start
talking. I'm presuming that you are familiar with how a pair of TCP
applications would establish a conversation. If not, perhaps you could
read a few of the early RFCs (request for comment documents) that define
many of the protocols supported in the internet. SMTP (simple mail
transport protocol) is a good example. The client establishes
conversations with the server. Clients are normally user applications
and servers are part of a vast mail server network.

Most of my products exist as a single entity on a machine. Thus the
IP Address or Domain Name, plus the well known port or protocol name
are all that is needed by each endpoint to know how to handle setting
up communications. Some of my products use simple text protocols like
SMTP and others use a well defined binary message structure.

You can choose your monitoring application to be either the client
or server end. When you configure the monitoring application with
the list of all devices to monitor and have it initiate the
conversations, it is called the client. When the endpoint devices
contact the monitor, the monitor is usually called a server.

Say that you enable all your endpoint devices with some code to
support one or perhaps more inbound conversations. That is they
are each servers. However, once a connection has been established
the protocol states that once each end has identified itself, the
server will send out some sort of status packet.

The monitor application then needs a persistant list of all
IP Addresses and port numbers of endpoint devices to establish
conversations with and monitor. The loss of any connection
may be worth reporting or perhaps just when the desired
conversation can't be reestablished. You have to understand
that in many networks, TCP conversations, especially long term
ones, can go in and out of service and still be considered
normal. Similarly, don't try to have a device report in every
few seconds and expect the data to arrive on time. This will
usually be okay, but what happens if a burst of ftp, http,
or other traffic clogs the network for more than a few seconds?
Will your monitor suddenly start reporting false lost connections?
Likewise if the status of devices is cummulative you may need
to verify reception of traffic and have a slightly more complicated
protocol. For instance, in a credit card processing protocol it
would be rather bad to double bill a card because of normal
communication retries in the network. You just need to decide
what is the correct behavior for your needs.

Does this help? It might be helpful to create a model of your
products. A simple paper drawing can be very useful. I've
also seen 3x5 cards on a wall with rubber bands as the
connections. Once you have determined how they establish
communications, you can specify what they need top say to each
other. Simple protocols are usually something that can be
written out or done by hand. More complicated protcols may
need a fairly extensive description of the conversation.

Have fun,

David
I need some structure to start this.

Thanks

Regards
Mojtaba


Jun 14 '06 #7
Hi David

Thanks again for your good explanation.
Do you know, any sample code I can look at for this scenario? I mean
for the monitor can identify the other programs (servers) and receive
the status packet?

Thanks again and sorry for bothering you.

regards
Mojtaba
David wrote:
Hello Mojtaba,

On Wed, 14 Jun 2006 01:37:27 UTC, "mo***********@yahoo.com" <mo***********@yahoo.com>
wrote:
Hi David

Many thanks for your response.
If I wish to use the registration method, how can it be implemented. I
mean can you give some idea of designing the monitoring module, may be
alos one without registration.


It might be best to start simple and work your way up. The communication
concpts are pretty much the same. The more advanced versions can be more
like peer networks (todays name for the ancient idea of having both ends
of a communication protocol be able to (re)start a conversation with the
other end).

I'd start by deciding on a simple client-server or peer-peer relationship.
You need to define the basic rules for which components initiate the
conversations, what they have to communicate, how to properly disconnect
them, and how to recognize an abnormal situation.

First you'll need to decide what your communication endpoints are like.
In simplest terms, this might be the IP Address or Domain Name for an
endpoint, and the well known port that enables your endpoints to start
talking. I'm presuming that you are familiar with how a pair of TCP
applications would establish a conversation. If not, perhaps you could
read a few of the early RFCs (request for comment documents) that define
many of the protocols supported in the internet. SMTP (simple mail
transport protocol) is a good example. The client establishes
conversations with the server. Clients are normally user applications
and servers are part of a vast mail server network.

Most of my products exist as a single entity on a machine. Thus the
IP Address or Domain Name, plus the well known port or protocol name
are all that is needed by each endpoint to know how to handle setting
up communications. Some of my products use simple text protocols like
SMTP and others use a well defined binary message structure.

You can choose your monitoring application to be either the client
or server end. When you configure the monitoring application with
the list of all devices to monitor and have it initiate the
conversations, it is called the client. When the endpoint devices
contact the monitor, the monitor is usually called a server.

Say that you enable all your endpoint devices with some code to
support one or perhaps more inbound conversations. That is they
are each servers. However, once a connection has been established
the protocol states that once each end has identified itself, the
server will send out some sort of status packet.

The monitor application then needs a persistant list of all
IP Addresses and port numbers of endpoint devices to establish
conversations with and monitor. The loss of any connection
may be worth reporting or perhaps just when the desired
conversation can't be reestablished. You have to understand
that in many networks, TCP conversations, especially long term
ones, can go in and out of service and still be considered
normal. Similarly, don't try to have a device report in every
few seconds and expect the data to arrive on time. This will
usually be okay, but what happens if a burst of ftp, http,
or other traffic clogs the network for more than a few seconds?
Will your monitor suddenly start reporting false lost connections?
Likewise if the status of devices is cummulative you may need
to verify reception of traffic and have a slightly more complicated
protocol. For instance, in a credit card processing protocol it
would be rather bad to double bill a card because of normal
communication retries in the network. You just need to decide
what is the correct behavior for your needs.

Does this help? It might be helpful to create a model of your
products. A simple paper drawing can be very useful. I've
also seen 3x5 cards on a wall with rubber bands as the
connections. Once you have determined how they establish
communications, you can specify what they need top say to each
other. Simple protocols are usually something that can be
written out or done by hand. More complicated protcols may
need a fairly extensive description of the conversation.

Have fun,

David
I need some structure to start this.

Thanks

Regards
Mojtaba


Jun 14 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: webzila | last post by:
Hello, I have to write a program for an 8051 micro-controller using micro-C to monitor Switch 1 and if the switch in pushed the message "switch 1 pushed" should be displayed in the LCD. Also the...
0
by: Paul Steele | last post by:
I am working in a C# program what monitors the activity on a computer. I have been able to accomplish quite a bit so far, but one item I have not been able to figure out is if there is a way to...
0
by: sengkok | last post by:
hi, i have written a printer job monitoring program as the code shown below , a timer is used to call this function every second . i have a network printer tat attached to my pc. i facing a...
3
by: Chris Dunaway | last post by:
I am writing a Windows Service that reads and processes files on a set schedule. I want to create a second app that can monitor the Windows service. The Windows service will write trace messages...
2
by: Rennie7676 | last post by:
Hi, I'm trying to write VC++ code for using Plink (command-line tool of PuTTY) interactively from within my program which is a console type windows application. The basic purpose is to run...
3
by: rohit | last post by:
hi i want to detect all file change operations(rename,delete,create....) on ALL THE DRIVES of the hard disk using the method ReadDirectoryChanges API , i.e program no. 3 in the webpage...
1
by: =?Utf-8?B?c2F0aGVlc2t1bWFy?= | last post by:
In my project i have a component named PTS Engine which is developed in VC++ ..Net 2003. And it is migrated to VC++.NET 2005 version. Initially this migration process has coded and tested in VC++...
7
by: developer28 | last post by:
Hi, I am looking for some performance monitoring tools and was suggested to ask you for the same. Can anyone please provide some help on the same? What i basically want is a tool that can...
35
by: jleslie48 | last post by:
I've written a cgi program in C using the borland 5.5 free compiler, and it runs just fine on an Apache server. My only issue is if I issue some system calls the cgi suspends until the call...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.