<font color="#0000ff">Hi Henrik,</font><div><font color="#0000ff"><br></font></div><div><font color="#0000ff">Got midterms these days, so it's a little bit late to reply this post.</font></div><div><font color="#0000ff">By the way, it's my great, great honor to get your reply :P</font></div>
<div><br></div><div><i>"<span style="font-family:arial,sans-serif;font-size:14px">My guess is that the primary focus of your project is to show that you</span></i></div><i><span style="font-family:arial,sans-serif;font-size:14px">understand some network programming, rather than prove that you understand</span><br style="font-family:arial,sans-serif;font-size:14px">
<span style="font-family:arial,sans-serif;font-size:14px">the details of Xymon - although I would be personally flattered if Xymon</span><br style="font-family:arial,sans-serif;font-size:14px"><span style="font-family:arial,sans-serif;font-size:14px">became mandatory teaching :-)"</span></i><div>
<font face="arial, sans-serif"><span style="font-size:14px"><i><br></i></span></font><div><font color="#0000ff">For the part regarding project goal:<font face="arial, sans-serif"><span style="font-size:14px"><br></span></font></font><div>
<font color="#0000ff">It is very true that the purpose of our class project is to demonstrate that we have some kind of network programming skill,</font></div></div><div><font color="#0000ff">but if we can demonstrate a very good understanding on Xymon will also be considered as good project.</font></div>
<div><font color="#0000ff">Based on my personal opinion, Xymon is capable to perform many tests and it's not just several files of code, thus, it may take me months to understand the whole thing.</font></div><div><font color="#0000ff">Hence, I was thinking about to show a good understanding regarding a part(or function) of Xymon (ping, in this case, is just my idea)</font></div>
</div><div><br></div><div><i><span style="font-family:arial,sans-serif;font-size:14px">"Is it a requirement to use ping as the network test, or could you use a</span><br style="font-family:arial,sans-serif;font-size:14px">
<span style="font-family:arial,sans-serif;font-size:14px">TCP connection as the network test ? ping is a bit complicated, because the</span><br style="font-family:arial,sans-serif;font-size:14px"><span style="font-family:arial,sans-serif;font-size:14px">normal network programming API's don't support it directly - you have to</span><br style="font-family:arial,sans-serif;font-size:14px">
<span style="font-family:arial,sans-serif;font-size:14px">more or less construct the contents of each packet yourself. The socket API</span><br style="font-family:arial,sans-serif;font-size:14px"><span style="font-family:arial,sans-serif;font-size:14px">in Unix (or Winsock on Windows) have much better support for a normal</span><br style="font-family:arial,sans-serif;font-size:14px">
<span style="font-family:arial,sans-serif;font-size:14px">transport-layer protocol - TCP - so that would allow you to show that you</span><br style="font-family:arial,sans-serif;font-size:14px"><span style="font-family:arial,sans-serif;font-size:14px">understand network programming, rather then getting bogged down with the</span><br style="font-family:arial,sans-serif;font-size:14px">
<span style="font-family:arial,sans-serif;font-size:14px">details of ICMP packet request/response formats."</span></i><br></div><div><br></div><div><font color="#0000ff">Since you mentioned ping test is more complicated, while TCP is easier to perform,</font></div>
<div><font color="#0000ff">I will definitely ask my professor on next class meeting. Since this class project is just to show we have certain</font></div><div><font color="#0000ff">network programming and we are all newbies to this field, I guess the chance to do TCP connection test is very high.</font></div>
<div><font color="#0000ff"><br></font></div><div><font color="#0000ff">By the way, it takes time for me to digest your code-writing suggestions, but I really appreciate that suggestion because it points</font></div><div><font color="#0000ff">out a direction </font><span style="color:rgb(0,0,255)">that I can work on. I was like a blind without your suggestion. I wonder is that okay if I send you some e-mail regarding network programming questions? I afraid the content may be too easy and not related to this mailing list.</span></div>
<div><span style="color:rgb(0,0,255)"><br></span></div><div><span style="color:rgb(0,0,255)">Last but not least, as I'm working on this project, I will keep everyone whoever interested posted,</span></div><div><span style="color:rgb(0,0,255)">who knows maybe someone will be asked to do the same/similar project like us. </span></div>
<div><font color="#0000ff"><br></font></div><div><font color="#0000ff">Thanks again, Henrik, my classmate won't believe who I got reply from.</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff">Best,</font></div>
<div><font color="#0000ff">James</font></div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/3  <span dir="ltr"><<a href="mailto:henrik@hswn.dk" target="_blank">henrik@hswn.dk</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi James,<br>
<div class="im"><br>
On Mon, 26 Nov 2012 18:44:48 -0800, James <<a href="mailto:kfc.android@gmail.com">kfc.android@gmail.com</a>> wrote:<br>
> The reason why I want to modify Xymon is because I'm working on a small<br>
> class project which only need a simple networking-related function<br>
> (in my case: ping) with minimal size of code.<br>
</div>[snip]<br>
<div class="im">> My optimal goal is: to use minimal amount of code to perform a ping<br>
test,<br>
> but keep the framework and style of Xymon. (Now I'm reading Xymonping.c<br>
> file under /xymonnet folder)<br>
<br>
</div>I think those are somewhat conflicting goals; keeping a Xymon style<br>
"framework" will require more work than what is really necessary for a<br>
"small class project".<br>
<br>
My guess is that the primary focus of your project is to show that you<br>
understand some network programming, rather than prove that you understand<br>
the details of Xymon - although I would be personally flattered if Xymon<br>
became mandatory teaching :-)<br>
<br>
<br>
My advice to you would be:<br>
<br>
Is it a requirement to use ping as the network test, or could you use a<br>
TCP connection as the network test ? ping is a bit complicated, because the<br>
normal network programming API's don't support it directly - you have to<br>
more or less construct the contents of each packet yourself. The socket API<br>
in Unix (or Winsock on Windows) have much better support for a normal<br>
transport-layer protocol - TCP - so that would allow you to show that you<br>
understand network programming, rather then getting bogged down with the<br>
details of ICMP packet request/response formats.<br>
<br>
If you are allowed to use normal TCP connections for your network test,<br>
try writing some code using the Unix socket API and non-blocking sockets.<br>
I.e. you need to use the socket(), connect(), select(), read(), write() and<br>
close() API's - plus the various little details of getting all the data<br>
structures setup correctly. There must be lots of sample code for this -<br>
not least the "select_tut(2)" man-page in Linux - but for Xymon code look<br>
at lib/sendmsg.c the "sendtoxymond()" routine, or xymonnet/contest.c file<br>
"do_tcp_tests()". The first one is good to understand the basics, because<br>
it does one connection at a time; the xymonnet/contest.c code is a bit more<br>
complicated, because it juggles multiple connections at once. With TCP, you<br>
can use a connection to e.g. port 80 (web) or some other port - possibly<br>
something user-configurable on a per-host basis.<br>
<br>
If you must use ping, then xymonping.c borrows heavily from fping, so have<br>
a look at that code as well.<br>
<br>
<br>
Once you know how to check if you can connect/ping a host, then you can<br>
decide what the configuration file should be like, and how the test results<br>
can be reported. If you want something "xymon-like", then perhaps you can<br>
just generate a simple webpage listing the test result, so it gets updated<br>
whenever your test-program runs.<br>
<br>
<br>
Regards,<br>
Henrik<br>
<br>
PS: I know this does go a bit off-topic for the Xymon list, but we've all<br>
had to learn things at some point. So I'm just trying to guide the newbies<br>
in the right direction :-)<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Best,<div>James</div><br>
</div>