Need help with code...

Rob Wirtz rob at ksu.edu
Mon Apr 18 16:35:15 CEST 2005


Thanks for your response.  I'm aware that it may be slightly over
complicating things to stream data from the COM1 TX to COM1 RX, but back in
the old days when we had a lot more standard serial devices, loop back tests
were required frequently to troubleshoot the port, and I am familiar with
the process.

Do you have any alternative suggestions?  I'm not trying to sound too
critical here, but I don't really see any helpful suggestions in your reply.

The basic idea is that a relay connected to the alarm system will somehow
interact with a PC running NS_Client.  Does anyone have suggestions/code to
make this happen.  I really don't care what the method is.  CTS/DTR, TX/RX,
whatever.  It just seemed to me that the serial port would have been the
easiest way to go.  I wanted to avoid using PERL and stick with something
that I could compile and EXE from C++ or Vbasic code.  I didn't want to have
to load the whole PERL language to run a short script.

Thanks!

-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Paul L. Allen
Sent: Friday, April 15, 2005 5:18 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Re: Need help with code...

Rob Wirtz writes: 


>> serial loopback connector connected to the siren output on my alarm with
a
>> normally closed relay.  The idea is that the loopback connector will be
>> wired across a normally closed relay, completing the loop.  If an alarm
>> condition occurs with the security system, tripping the siren will also 
>> trip the relay, interrupting the serial loopback

>Seems unnecessarily complicated, and resource consuming, to continuously
>send a data stream and monitor that it comes back OK.  Most people would
>stick the relay on one of the control lines like DTR or CTS which set
>flags depending upon presence or absence. 

> connected to one of my Windows servers.

>Ah, forget I said anything.  Windows probably doesn't let you get at the
>control lines any more.  Not easily, anyway.  Checking the "fire" button
>on the games port may (or may not) be a simpler task under Windows. 

>> The problem is, I am not a programmer.  I know it should only take 5-10
>> lines of code to accomplish what I need.  What I would like is a small
>> program that transmits arbitrary data across the serial loopback
>> connection. If that connection is broken, then a file like "alarm.txt" 
>> will be written to the hard drive.   Using the Check_nt pluigin to check
>> for the presence of this file will cause Nagios to send email and page 
>> alarms.

>Doing all that in 5-10 lines of code?  I doubt it.  You could probably
>detect a change on DTR or CTS in 5-10 lines of code (using a reasonably
>"compact" language like perl, on a decent OS like Linux).  Doing what you
>want on Windows is likely to be a little more complex.  Oh, and if you use
>MS programming tools then you can expect the binary to be about 2M in size
>even if there are only 5-10 lines of code (c.f., regedit which could be
>squeezed into a binary of around 100K but because of the cruft the MS tools
>drag in - unless you explicitly tell them not to - ends up around 2M). 

-- 
Paul Allen
Softflare Support 




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue. 
::: Messages without supporting info will risk being sent to /dev/null




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list