[Newbie] Smaller, lighter Xymon based program?
Hi guys,
I'm very new to this Xymon-land, spent some time to install and configure Xymon on my virtual machine runs CentOS 6.3
Here's my thought, since I have very limited skill in this monitoring field, my target is only to have a program which can test the 'ping' only.
Is that doable if I can use Xymon and disable some of the functions? Has anyone ever think about this before? Maybe some hint or guides, thanks!
Btw, I'm working on this as my school project, hopefully I didn't break/offend anyone's work and copyright, if so, please let me know.
Many thanks :D
-- Best, James
Yes, that's the default for any device listed in hosts.cfg (with name and IP address) that doesn't run a Xymon client. But why would you want to give up visibility of all other functionality that your devices provide?
On 27 November 2012 11:28, James <kfc.android at gmail.com> wrote:
Hi guys,
I'm very new to this Xymon-land, spent some time to install and configure Xymon on my virtual machine runs CentOS 6.3
Here's my thought, since I have very limited skill in this monitoring field, my target is only to have a program which can test the 'ping' only.
Is that doable if I can use Xymon and disable some of the functions? Has anyone ever think about this before? Maybe some hint or guides, thanks!
Btw, I'm working on this as my school project, hopefully I didn't break/offend anyone's work and copyright, if so, please let me know.
Many thanks :D
-- Best, James
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
I don't think you need to do anything special to make this happen, just only define the "conn" test which is on by default (so your hosts.cfg will really just have hostnames).
From: James [mailto:kfc.android at gmail.com] Sent: Monday, November 26, 2012 07:28 PM To: xymon at xymon.com <xymon at xymon.com> Subject: [Xymon] [Newbie] Smaller, lighter Xymon based program?
Hi guys,
I'm very new to this Xymon-land, spent some time to install and configure Xymon on my virtual machine runs CentOS 6.3
Here's my thought, since I have very limited skill in this monitoring field, my target is only to have a program which can test the 'ping' only.
Is that doable if I can use Xymon and disable some of the functions? Has anyone ever think about this before? Maybe some hint or guides, thanks!
Btw, I'm working on this as my school project, hopefully I didn't break/offend anyone's work and copyright, if so, please let me know.
Many thanks :D
-- Best, James
Thanks for the prompt reply guys, really appreciate that. The reason why I want to modify Xymon is because I'm working on a small class project which only need a simple networking-related function (in my case: ping) with minimal size of code.
I understand Xymon is powerful and runs fast in most of cases, but the best case is to make some minor changes based on Xymon simply because I can't just take Xymon and turn it in as my project.
My optimal goal is: to use minimal amount of code to perform a ping test, but keep the framework and style of Xymon. (Now I'm reading Xymonping.c file under /xymonnet folder)
Anyone has idea about how I can achieve this goal? Any opinion will be greatly appreciated! Thanks again!
James
Xymon seems like a LOT of overhead for a simple ping test.
What about something like bash?
while true; do until ping -c1 -W2 192.168.1.1 &>/dev/null; do sleep 3 done
echo "ping success"
Josh Luthman Office: 937-552-2340 Direct: 937-552-2343 1100 Wayne St Suite 1337 Troy, OH 45373
On Mon, Nov 26, 2012 at 9:44 PM, James <kfc.android at gmail.com> wrote:
Thanks for the prompt reply guys, really appreciate that. The reason why I want to modify Xymon is because I'm working on a small class project which only need a simple networking-related function (in my case: ping) with minimal size of code.
I understand Xymon is powerful and runs fast in most of cases, but the best case is to make some minor changes based on Xymon simply because I can't just take Xymon and turn it in as my project.
My optimal goal is: to use minimal amount of code to perform a ping test, but keep the framework and style of Xymon. (Now I'm reading Xymonping.c file under /xymonnet folder)
Anyone has idea about how I can achieve this goal? Any opinion will be greatly appreciated! Thanks again!
James
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
I guess the problem is James wants the web display as well, though I agree it seems like a huge amount of effort to strip out all the things you don't need just to get the things that you want.
@James, since you are looking at the code for Xymon you probably understand C. I would suggest, without doing the project for you, that you use the basic xymonping.c code for the networking stuff and write your own HTML provider. It can be as simple as something that generate new HTML pages every 5 minutes and uses Apache as the web server...
|\/|
Martin Ward Manager, Technical Services Service Operations
DDI:+44 (0) 20 7863 5218 / Fax: +44 (0)20 7863 9999 / www.colt.net<http://www.colt.net/> Colt Technology Services, Unit 12, Powergate Business Park, Volt Avenue, Park Royal, London, NW10 6PW, UK.
Help reduce your carbon footprint | Think before you print. Registered in England and Wales, registered number 02452736, VAT number GB 645 4205 50
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Josh Luthman Sent: 27 November 2012 02:55 To: James Cc: xymon at xymon.com Subject: Re: [Xymon] [Newbie] Smaller, lighter Xymon based program?
Xymon seems like a LOT of overhead for a simple ping test.
What about something like bash?
while true; do until ping -c1 -W2 192.168.1.1 &>/dev/null; do sleep 3 done
echo "ping success"
Josh Luthman Office: 937-552-2340 Direct: 937-552-2343 1100 Wayne St Suite 1337 Troy, OH 45373
On Mon, Nov 26, 2012 at 9:44 PM, James <kfc.android at gmail.com<mailto:kfc.android at gmail.com>> wrote: Thanks for the prompt reply guys, really appreciate that. The reason why I want to modify Xymon is because I'm working on a small class project which only need a simple networking-related function (in my case: ping) with minimal size of code.
I understand Xymon is powerful and runs fast in most of cases, but the best case is to make some minor changes based on Xymon simply because I can't just take Xymon and turn it in as my project.
My optimal goal is: to use minimal amount of code to perform a ping test, but keep the framework and style of Xymon. (Now I'm reading Xymonping.c file under /xymonnet folder)
Anyone has idea about how I can achieve this goal? Any opinion will be greatly appreciated! Thanks again!
James
Xymon mailing list Xymon at xymon.com<mailto:Xymon at xymon.com> http://lists.xymon.com/mailman/listinfo/xymon
[Colt Disclaimer]
This email is from an entity of the Colt group of companies.
Colt Group S.A., K2 Building, Forte 1, 2a rue Albert Borschette, L-1246 Luxembourg, R.C.S. B115679.
Corporate and contact information for our entities can be found at
http://colt.net/uk/en/Colt-Group-of-Companies/index.htm.
Internet communications are not secure and Colt does not accept
responsibility for the accurate transmission of this message. Content
of this email or its attachments is not legally or contractually binding
unless expressly previously agreed in writing by Colt
Hi James,
On Mon, 26 Nov 2012 18:44:48 -0800, James <kfc.android at gmail.com> wrote:
The reason why I want to modify Xymon is because I'm working on a small class project which only need a simple networking-related function (in my case: ping) with minimal size of code. [snip] My optimal goal is: to use minimal amount of code to perform a ping test, but keep the framework and style of Xymon. (Now I'm reading Xymonping.c file under /xymonnet folder)
I think those are somewhat conflicting goals; keeping a Xymon style "framework" will require more work than what is really necessary for a "small class project".
My guess is that the primary focus of your project is to show that you understand some network programming, rather than prove that you understand the details of Xymon - although I would be personally flattered if Xymon became mandatory teaching :-)
My advice to you would be:
Is it a requirement to use ping as the network test, or could you use a TCP connection as the network test ? ping is a bit complicated, because the normal network programming API's don't support it directly - you have to more or less construct the contents of each packet yourself. The socket API in Unix (or Winsock on Windows) have much better support for a normal transport-layer protocol - TCP - so that would allow you to show that you understand network programming, rather then getting bogged down with the details of ICMP packet request/response formats.
If you are allowed to use normal TCP connections for your network test, try writing some code using the Unix socket API and non-blocking sockets. I.e. you need to use the socket(), connect(), select(), read(), write() and close() API's - plus the various little details of getting all the data structures setup correctly. There must be lots of sample code for this - not least the "select_tut(2)" man-page in Linux - but for Xymon code look at lib/sendmsg.c the "sendtoxymond()" routine, or xymonnet/contest.c file "do_tcp_tests()". The first one is good to understand the basics, because it does one connection at a time; the xymonnet/contest.c code is a bit more complicated, because it juggles multiple connections at once. With TCP, you can use a connection to e.g. port 80 (web) or some other port - possibly something user-configurable on a per-host basis.
If you must use ping, then xymonping.c borrows heavily from fping, so have a look at that code as well.
Once you know how to check if you can connect/ping a host, then you can decide what the configuration file should be like, and how the test results can be reported. If you want something "xymon-like", then perhaps you can just generate a simple webpage listing the test result, so it gets updated whenever your test-program runs.
Regards, Henrik
PS: I know this does go a bit off-topic for the Xymon list, but we've all had to learn things at some point. So I'm just trying to guide the newbies in the right direction :-)
On Mon, December 3, 2012 07:18, henrik at hswn.dk wrote:
PS: I know this does go a bit off-topic for the Xymon list, but we've all had to learn things at some point. So I'm just trying to guide the newbies in the right direction :-)
It was a wonderful response. I'm proud to be associated with you, however loosely.
Hi Henrik,
Got midterms these days, so it's a little bit late to reply this post. By the way, it's my great, great honor to get your reply :P
*"My guess is that the primary focus of your project is to show that you* *understand some network programming, rather than prove that you understand the details of Xymon - although I would be personally flattered if Xymon became mandatory teaching :-)"* * * For the part regarding project goal: It is very true that the purpose of our class project is to demonstrate that we have some kind of network programming skill, but if we can demonstrate a very good understanding on Xymon will also be considered as good project. 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. 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)
*"Is it a requirement to use ping as the network test, or could you use a TCP connection as the network test ? ping is a bit complicated, because the normal network programming API's don't support it directly - you have to more or less construct the contents of each packet yourself. The socket API in Unix (or Winsock on Windows) have much better support for a normal transport-layer protocol - TCP - so that would allow you to show that you understand network programming, rather then getting bogged down with the details of ICMP packet request/response formats."*
Since you mentioned ping test is more complicated, while TCP is easier to perform, I will definitely ask my professor on next class meeting. Since this class project is just to show we have certain network programming and we are all newbies to this field, I guess the chance to do TCP connection test is very high.
By the way, it takes time for me to digest your code-writing suggestions, but I really appreciate that suggestion because it points out a direction 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.
Last but not least, as I'm working on this project, I will keep everyone whoever interested posted, who knows maybe someone will be asked to do the same/similar project like us.
Thanks again, Henrik, my classmate won't believe who I got reply from.
Best, James
2012/12/3 <henrik at hswn.dk>
Hi James,
On Mon, 26 Nov 2012 18:44:48 -0800, James <kfc.android at gmail.com> wrote:
The reason why I want to modify Xymon is because I'm working on a small class project which only need a simple networking-related function (in my case: ping) with minimal size of code. [snip] My optimal goal is: to use minimal amount of code to perform a ping test, but keep the framework and style of Xymon. (Now I'm reading Xymonping.c file under /xymonnet folder)
I think those are somewhat conflicting goals; keeping a Xymon style "framework" will require more work than what is really necessary for a "small class project".
My guess is that the primary focus of your project is to show that you understand some network programming, rather than prove that you understand the details of Xymon - although I would be personally flattered if Xymon became mandatory teaching :-)
My advice to you would be:
Is it a requirement to use ping as the network test, or could you use a TCP connection as the network test ? ping is a bit complicated, because the normal network programming API's don't support it directly - you have to more or less construct the contents of each packet yourself. The socket API in Unix (or Winsock on Windows) have much better support for a normal transport-layer protocol - TCP - so that would allow you to show that you understand network programming, rather then getting bogged down with the details of ICMP packet request/response formats.
If you are allowed to use normal TCP connections for your network test, try writing some code using the Unix socket API and non-blocking sockets. I.e. you need to use the socket(), connect(), select(), read(), write() and close() API's - plus the various little details of getting all the data structures setup correctly. There must be lots of sample code for this - not least the "select_tut(2)" man-page in Linux - but for Xymon code look at lib/sendmsg.c the "sendtoxymond()" routine, or xymonnet/contest.c file "do_tcp_tests()". The first one is good to understand the basics, because it does one connection at a time; the xymonnet/contest.c code is a bit more complicated, because it juggles multiple connections at once. With TCP, you can use a connection to e.g. port 80 (web) or some other port - possibly something user-configurable on a per-host basis.
If you must use ping, then xymonping.c borrows heavily from fping, so have a look at that code as well.
Once you know how to check if you can connect/ping a host, then you can decide what the configuration file should be like, and how the test results can be reported. If you want something "xymon-like", then perhaps you can just generate a simple webpage listing the test result, so it gets updated whenever your test-program runs.
Regards, Henrik
PS: I know this does go a bit off-topic for the Xymon list, but we've all had to learn things at some point. So I'm just trying to guide the newbies in the right direction :-)
-- Best, James
One of my favorite professors ever told us that if he caught us writing code that duplicated something available on the net, we would fail, because out in the real world you never want to waste your employer's time re-inventing the wheel.
Putting on my former-CS-lab-manager hat, I'd say: think about what you're trying to learn and what your professor wants you to show. Are you working on network programming, or web app programming, or using a framework, or is this part of a bigger project or what? Xymon has a lot of pieces because it was designed to monitor multiple sorts of sources and do multiple sorts of notification.
In my own life I've learned the hard way that it's almost always easier to write what you need and take * bits and pieces* of code that can help, rather than trying to strip something complex down to bits and pieces. Invariably, things break and you end up going down ratholes trying to fix problems in parts of the code that you don't understand and don't need. Xymon has a *lot* of pieces.
Here's an analogy: if you're given the assignment of building a rowboat, don't try to build one by taking a tugboat and removing all the extra pieces. You'll probably end up with something that is the wrong size and won't float.
Thanks, Martin! I think you got my point. My idea is just to keep Xymon's ping and web-page display function, like a "little Xymon" program which is based on Xymon but only have very limited functionality.
Maybe I can use the layout of how Xymon display the result and strip down the options I don't need? Or, if possible, could you please give me some hint about how to create my own HTML provider?
Betsy, Thanks for your advise, I learned that from one of my coding class, we were given the full source code of a working program, and our instructor asked us to modify it to meet his requirement. (He purposely did this just want to let us know to write our own code is smarter to copy/modify someone's code) But this time is different, we were approved to use any open source program and modify it to meet our need. Maybe I can do as Martin said: take the part which I am needed, and make it a smaller program. Thanks for the suggestion, I really appreciate time you've spent.
James
I would just compile the latest Xymon server with xymonping. Configure Apache2 as a webserver. Install Xymon and Edit xymonserver.cfg to your setup. Populate hosts.cfg with the hosts you want, you get a xymon page with all your ping hosts. (conn) That is a fairly basic and simple solution. Even if all that other code is there it is not really used.
4.3.10 has prepared packages, ready to install for a bunch of different distributions. (no compile req)
Roland
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of James Sent: Wednesday, 28 November 2012 8:23 AM To: betsy.schwartz at gmail.com; Martin.Ward at colt.net Cc: xymon at xymon.com Subject: Re: [Xymon] [Newbie] Smaller, lighter Xymon based program?
Thanks, Martin! I think you got my point. My idea is just to keep Xymon's ping and web-page display function, like a "little Xymon" program which is based on Xymon but only have very limited functionality.
Maybe I can use the layout of how Xymon display the result and strip down the options I don't need? Or, if possible, could you please give me some hint about how to create my own HTML provider?
Betsy, Thanks for your advise, I learned that from one of my coding class, we were given the full source code of a working program, and our instructor asked us to modify it to meet his requirement. (He purposely did this just want to let us know to write our own code is smarter to copy/modify someone's code) But this time is different, we were approved to use any open source program and modify it to meet our need. Maybe I can do as Martin said: take the part which I am needed, and make it a smaller program. Thanks for the suggestion, I really appreciate time you've spent.
James
Thanks for the reply, Roland, What you pointed seems like a very straight forward process, however, I'm still figuring out all those .cfg and .c files in Xymon (I call Xymon a package because it includes a lot of folders/files) and I guess it takes a while to get a good understanding. What I am going to do now is to continue my study on "Xymonping.c" and then "Xymonserver.cfg" One silly question, is Xymon (in my case Xymon-4.3.10) shipped with both server and client? If so, I can ignore those files which belong to client side, right? Thanks for the advisory, I really appreciate that :D
James
2012/11/27 Roland Soderstrom <Rolands at logicaltech.com.au>
I would just compile the latest Xymon server with xymonping.****
Configure Apache2 as a webserver.****
Install Xymon and Edit xymonserver.cfg to your setup.****
Populate hosts.cfg with the hosts you want, you get a xymon page with all your ping hosts. (conn)****
That is a fairly basic and simple solution.****
Even if all that other code is there it is not really used.****
4.3.10 has prepared packages, ready to install for a bunch of different distributions. (no compile req)****
**- **Roland****
*From:* xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] *On Behalf Of *James *Sent:* Wednesday, 28 November 2012 8:23 AM *To:* betsy.schwartz at gmail.com; Martin.Ward at colt.net
*Cc:* xymon at xymon.com *Subject:* Re: [Xymon] [Newbie] Smaller, lighter Xymon based program?****
Thanks, Martin! I think you got my point.****
My idea is just to keep Xymon's ping and web-page display function, like a "little Xymon" program****
which is based on Xymon but only have very limited functionality.****
Maybe I can use the layout of how Xymon display the result and strip down the options I don't need?****
Or, if possible, could you please give me some hint about how to create my own HTML provider?****
Betsy,****
Thanks for your advise, I learned that from one of my coding class, we were given the full source code ****
of a working program, and our instructor asked us to modify it to meet his requirement. (He purposely****
did this just want to let us know to write our own code is smarter to copy/modify someone's code)****
But this time is different, we were approved to use any open source program and modify it to meet****
our need. Maybe I can do as Martin said: take the part which I am needed, and make it a smaller program.****
Thanks for the suggestion, I really appreciate time you've spent.****
James****
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
-- Best, James
Yes, client is only software meant to run on the client and send back local stats to the server. Even on a regular install, it's not required for every host.
From: James [mailto:kfc.android at gmail.com] Sent: Tuesday, November 27, 2012 10:57 PM To: Roland Soderstrom <Rolands at logicaltech.com.au> Cc: xymon at xymon.com <xymon at xymon.com> Subject: Re: [Xymon] [Newbie] Smaller, lighter Xymon based program?
Thanks for the reply, Roland, What you pointed seems like a very straight forward process, however, I'm still figuring out all those .cfg and .c files in Xymon (I call Xymon a package because it includes a lot of folders/files) and I guess it takes a while to get a good understanding. What I am going to do now is to continue my study on "Xymonping.c" and then "Xymonserver.cfg" One silly question, is Xymon (in my case Xymon-4.3.10) shipped with both server and client? If so, I can ignore those files which belong to client side, right? Thanks for the advisory, I really appreciate that :D
James
2012/11/27 Roland Soderstrom <Rolands at logicaltech.com.au<mailto:Rolands at logicaltech.com.au>> I would just compile the latest Xymon server with xymonping. Configure Apache2 as a webserver. Install Xymon and Edit xymonserver.cfg to your setup. Populate hosts.cfg with the hosts you want, you get a xymon page with all your ping hosts. (conn) That is a fairly basic and simple solution. Even if all that other code is there it is not really used.
4.3.10 has prepared packages, ready to install for a bunch of different distributions. (no compile req)
Roland
From: xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com> [mailto:xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com>] On Behalf Of James Sent: Wednesday, 28 November 2012 8:23 AM To: betsy.schwartz at gmail.com<mailto:betsy.schwartz at gmail.com>; Martin.Ward at colt.net<mailto:Martin.Ward at colt.net>
Cc: xymon at xymon.com<mailto:xymon at xymon.com> Subject: Re: [Xymon] [Newbie] Smaller, lighter Xymon based program?
Thanks, Martin! I think you got my point. My idea is just to keep Xymon's ping and web-page display function, like a "little Xymon" program which is based on Xymon but only have very limited functionality.
Maybe I can use the layout of how Xymon display the result and strip down the options I don't need? Or, if possible, could you please give me some hint about how to create my own HTML provider?
Betsy, Thanks for your advise, I learned that from one of my coding class, we were given the full source code of a working program, and our instructor asked us to modify it to meet his requirement. (He purposely did this just want to let us know to write our own code is smarter to copy/modify someone's code) But this time is different, we were approved to use any open source program and modify it to meet our need. Maybe I can do as Martin said: take the part which I am needed, and make it a smaller program. Thanks for the suggestion, I really appreciate time you've spent.
James
Xymon mailing list Xymon at xymon.com<mailto:Xymon at xymon.com> http://lists.xymon.com/mailman/listinfo/xymon
-- Best, James
participants (9)
-
betsy.schwartz@gmail.com
-
henrik@hswn.dk
-
hobbit@epperson.homelinux.net
-
jlaidman@rebel-it.com.au
-
josh@imaginenetworksllc.com
-
kfc.android@gmail.com
-
Martin.Ward@colt.net
-
novosirj@umdnj.edu
-
Rolands@logicaltech.com.au