nagios-db-devel Mailing List for Nagios-DB (Page 6)
Status: Beta
Brought to you by:
bench23
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(62) |
Feb
(9) |
Mar
(27) |
Apr
(9) |
May
(17) |
Jun
|
Jul
(7) |
Aug
(11) |
Sep
(5) |
Oct
|
Nov
(7) |
Dec
|
2006 |
Jan
|
Feb
(2) |
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ben <be...@si...> - 2005-01-20 19:00:26
|
Okay, well, there's a new postgres inserter.c checked into cvs. I now check the query result to see if it succeeded, and if not, log it. I'm not at all clear why PQclear() would be crashing, but perhaps the added logging will show something. I also started compiling with -Wall, which caught some printf sloppiness, but that shouldn't have done anything bad. On Thu, 20 Jan 2005, Tim Verhoeven wrote: > On Thu, 20 Jan 2005, Ben wrote: > > > Doh! Good catch. I wonder why I was never bit by this..... > > > > Well, regardless, the fix is now in CVS and I bet the reason you're crashing > > is because I've been too lazy and have not added error checking to the neb > > module. That's gonna change as soon as I get into work (assuming no fires... > > haha). But after you fixed this stored proc are you still crashing? > > Yep, I'm still crashing here :-) I've got no more errors from pgsql. But > still the crash at PQclear. So it must be some cleanup issue, something > left behind, this is probably also why the segfault is at > malloc_consolidate (whatever that does). > > Tim > > -- > Tim Verhoeven - dj...@ro... - 0479 / 88 11 83 > > /* This is total bullshit: */ > linux-2.6.6/drivers/video/sis/init301.c > > |
From: Ben <be...@si...> - 2005-01-20 17:38:06
|
BTW, it looks like the reason this never bit me was because I fixed it and simply failed it check it in. Well, at least that's one mystery solved. On Thu, 20 Jan 2005, Ben wrote: > > On Jan 20, 2005, at 8:26 AM, Tim Verhoeven wrote: > > Enabling some extensive logging helped. I've found a couple of issues > > in the stored procedures. One in host.sql is already fixed in CVS. > > This is the other : > > > > diff -u -r1.3 restart.sql > > --- restart.sql 16 Jan 2005 20:21:43 -0000 1.3 > > +++ restart.sql 20 Jan 2005 16:23:32 -0000 > > @@ -28,7 +28,7 @@ > > thisHostID int; > > BEGIN > > -- get the host id. If this is a new host, insert the host > > and get the id > > - select into thisHostID id FROM host WHERE name = thisHostName; > > + select into thisHostID id FROM host WHERE name = hostName; > > > > if thisHostID is not null > > then > > > > Doh! Good catch. I wonder why I was never bit by this..... > > Well, regardless, the fix is now in CVS and I bet the reason you're > crashing is because I've been too lazy and have not added error > checking to the neb module. That's gonna change as soon as I get into > work (assuming no fires... haha). But after you fixed this stored proc > are you still crashing? > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > |
From: Ben <be...@si...> - 2005-01-20 17:23:05
|
I believe malloc_consolidate consolidates the free memory segments malloc can hand out. But that's neither here nor there.... I'll add some PQexec error checking into CVS and we'll see what that does for you. On Thu, 20 Jan 2005, Tim Verhoeven wrote: > On Thu, 20 Jan 2005, Ben wrote: > > > Doh! Good catch. I wonder why I was never bit by this..... > > > > Well, regardless, the fix is now in CVS and I bet the reason you're crashing > > is because I've been too lazy and have not added error checking to the neb > > module. That's gonna change as soon as I get into work (assuming no fires... > > haha). But after you fixed this stored proc are you still crashing? > > Yep, I'm still crashing here :-) I've got no more errors from pgsql. But > still the crash at PQclear. So it must be some cleanup issue, something > left behind, this is probably also why the segfault is at > malloc_consolidate (whatever that does). > > Tim > > -- > Tim Verhoeven - dj...@ro... - 0479 / 88 11 83 > > /* This is total bullshit: */ > linux-2.6.6/drivers/video/sis/init301.c > > |
From: Tim V. <dj...@ro...> - 2005-01-20 16:46:11
|
On Thu, 20 Jan 2005, Ben wrote: > Doh! Good catch. I wonder why I was never bit by this..... > > Well, regardless, the fix is now in CVS and I bet the reason you're crashing > is because I've been too lazy and have not added error checking to the neb > module. That's gonna change as soon as I get into work (assuming no fires... > haha). But after you fixed this stored proc are you still crashing? Yep, I'm still crashing here :-) I've got no more errors from pgsql. But still the crash at PQclear. So it must be some cleanup issue, something left behind, this is probably also why the segfault is at malloc_consolidate (whatever that does). Tim -- Tim Verhoeven - dj...@ro... - 0479 / 88 11 83 /* This is total bullshit: */ linux-2.6.6/drivers/video/sis/init301.c |
From: Ben <be...@si...> - 2005-01-20 16:37:08
|
On Jan 20, 2005, at 8:26 AM, Tim Verhoeven wrote: > Enabling some extensive logging helped. I've found a couple of issues > in the stored procedures. One in host.sql is already fixed in CVS. > This is the other : > > diff -u -r1.3 restart.sql > --- restart.sql 16 Jan 2005 20:21:43 -0000 1.3 > +++ restart.sql 20 Jan 2005 16:23:32 -0000 > @@ -28,7 +28,7 @@ > thisHostID int; > BEGIN > -- get the host id. If this is a new host, insert the host > and get the id > - select into thisHostID id FROM host WHERE name = thisHostName; > + select into thisHostID id FROM host WHERE name = hostName; > > if thisHostID is not null > then > Doh! Good catch. I wonder why I was never bit by this..... Well, regardless, the fix is now in CVS and I bet the reason you're crashing is because I've been too lazy and have not added error checking to the neb module. That's gonna change as soon as I get into work (assuming no fires... haha). But after you fixed this stored proc are you still crashing? |
From: Tim V. <dj...@ro...> - 2005-01-20 16:26:45
|
On Wed, 19 Jan 2005, Ben wrote: ...snip... >> I'm using : >> >> gcc -g -O2 -o inserter.o inserter.c -shared -I /usr/include/nagios >> -I/usr/include/pgsql -lpq > > That should be fine. Just to be sure what's actually getting used, would you > run an ldd on inserter.o and see what the linker will add at runtime? This is the output from ldd, looks fine to me : libpq.so.3 => /usr/lib/libpq.so.3 (0x009b8000) libc.so.6 => /lib/tls/libc.so.6 (0x00111000) libssl.so.4 => /lib/libssl.so.4 (0x0027b000) libcrypto.so.4 => /lib/libcrypto.so.4 (0x003cf000) libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x0032a000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x0024a000) libresolv.so.2 => /lib/libresolv.so.2 (0x00e9d000) libnsl.so.1 => /lib/libnsl.so.1 (0x002b0000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00314000) libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x007e1000) libcom_err.so.2 => /lib/libcom_err.so.2 (0x005d9000) libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00f5c000) libdl.so.2 => /lib/libdl.so.2 (0x0068a000) libz.so.1 => /usr/lib/libz.so.1 (0x004c1000) >> I've then started from a empty database. When I then start nagios I get >> this error : ...snip... > That really shouldn't fail. Try turning on debug logging on your postgres > server and see what it says about things. Enabling some extensive logging helped. I've found a couple of issues in the stored procedures. One in host.sql is already fixed in CVS. This is the other : diff -u -r1.3 restart.sql --- restart.sql 16 Jan 2005 20:21:43 -0000 1.3 +++ restart.sql 20 Jan 2005 16:23:32 -0000 @@ -28,7 +28,7 @@ thisHostID int; BEGIN -- get the host id. If this is a new host, insert the host and get the id - select into thisHostID id FROM host WHERE name = thisHostName; + select into thisHostID id FROM host WHERE name = hostName; if thisHostID is not null then >> Finaly I get a segfault at the PQclear function for the processStatus call >> for the host data. ...snip... > It's possible that maybe the result which PQclear is trying to clear is null. > I cannot recall at the moment if PQclear(0) will result in badness. The error is always at the same place the PQclear in processStatus. I've did a run with gdb and the segfault occurs in : Program received signal SIGSEGV, Segmentation fault. 0x0039d50d in malloc_consolidate () from /lib/tls/libc.so.6 That seems a strange place for a segfault to happen, so I'm a bit lost what to make of it. Kind regards, Tim -- Tim Verhoeven - dj...@ro... - 0479 / 88 11 83 /* This is total bullshit: */ linux-2.6.6/drivers/video/sis/init301.c |
From: Matthew K. <mk...@ma...> - 2005-01-19 17:56:53
|
On Tue, 2005-01-18 at 21:48, Ben wrote: > On Tue, 18 Jan 2005, Matthew Kent wrote: > > > Well nagios allows for an undefined host check_command and considers > > them permanently up > > (http://nagios.sourceforge.net/docs/2_0/xodtemplate.html#host) > > Hey, check that out. > > I'll change the stored proc to do the right thing. > > > Also a few changes that I made for the mysql queries didn't make it back > > into postgres quite yet. Need to test them some more. > > OK. Out of curiosity, what's in the pipeline? > Believe it was the displaying of pending items by serviceDetails. If I have time I'll go over it this evening and get back to you. Not enough hours in the day lately! -- Matthew Kent <mk...@ma...> http://magoazul.com |
From: Ben <be...@si...> - 2005-01-19 16:38:31
|
On Jan 19, 2005, at 6:11 AM, Tim Verhoeven wrote: > On Sun, 16 Jan 2005, Matthew Kent wrote: > >> Verified that the postgres module compiles and works as expected on >> debian unstable. >> >> As mentioned, must be the libraries. > > Hi guys, > > I've been testing some more and I'm not really making any progress. So > a bit more about my platform and what I'm seeing. > > Currently I'm testing on a FC1 system. This has postgres version > 7.3.4. I've installed the regular rpms. So everything is/should be > installed correctly. I've ofcourse needed to change the compile rule. > This is what I'm using : > > gcc -g -O2 -o inserter.o inserter.c -shared -I /usr/include/nagios > -I/usr/include/pgsql -lpq That should be fine. Just to be sure what's actually getting used, would you run an ldd on inserter.o and see what the linker will add at runtime? > I've then started from a empty database. When I then start nagios I > get this error : > > WARNING: Error occurred while executing PL/pgSQL function > append_to_hostgroup line 9 at SQL statement If I'm reading it right, that means that this line is failing: select into thisHostID id FROM host WHERE name = thisHostName; That really shouldn't fail. Try turning on debug logging on your postgres server and see what it says about things. > Finaly I get a segfault at the PQclear function for the processStatus > call for the host data. > > I someone knows a good way to debug that would really help. > > I'll will try again on a RHEL3 system in de coming days since the > actual production server will be a RHEL3. Does it always crash at the same spot? I always hate it when people give this answer, but perhaps you are looking at the handiwork of a bad stick of ram? Anyway, you can try this for debugging: 1. load nagios in a debugger 2. put a breakpoint in nagios after it loads the neb modules (sorry, don't know where that is, but it shouldn't be hard to find) 3. run nagios 4. when you hit the breakpoint, put another breakpoint at the place in inserter.o where it consistently crashes. 5. continue again, and investigate what's going on at the crash point. It's possible that maybe the result which PQclear is trying to clear is null. I cannot recall at the moment if PQclear(0) will result in badness. |
From: Tim V. <dj...@ro...> - 2005-01-19 14:11:27
|
On Sun, 16 Jan 2005, Matthew Kent wrote: > Verified that the postgres module compiles and works as expected on > debian unstable. > > As mentioned, must be the libraries. Hi guys, I've been testing some more and I'm not really making any progress. So a bit more about my platform and what I'm seeing. Currently I'm testing on a FC1 system. This has postgres version 7.3.4. I've installed the regular rpms. So everything is/should be installed correctly. I've ofcourse needed to change the compile rule. This is what I'm using : gcc -g -O2 -o inserter.o inserter.c -shared -I /usr/include/nagios -I/usr/include/pgsql -lpq I've then started from a empty database. When I then start nagios I get this error : WARNING: Error occurred while executing PL/pgSQL function append_to_hostgroup line 9 at SQL statement Finaly I get a segfault at the PQclear function for the processStatus call for the host data. I someone knows a good way to debug that would really help. I'll will try again on a RHEL3 system in de coming days since the actual production server will be a RHEL3. Kind regards, Tim -- Tim Verhoeven - dj...@ro... - 0479 / 88 11 83 /* This is total bullshit: */ linux-2.6.6/drivers/video/sis/init301.c |
From: Ben <be...@si...> - 2005-01-18 21:48:32
|
On Tue, 18 Jan 2005, Matthew Kent wrote: > Well nagios allows for an undefined host check_command and considers > them permanently up > (http://nagios.sourceforge.net/docs/2_0/xodtemplate.html#host) Hey, check that out. I'll change the stored proc to do the right thing. > Also a few changes that I made for the mysql queries didn't make it back > into postgres quite yet. Need to test them some more. OK. Out of curiosity, what's in the pipeline? > > 3. What are the inconsistancies between psql, mysql, and the cigs? Those > > are likely bugs and should probably have a high priority of getting > > squashed. > > > > Well the most noticeable item for postgres is in the tac overview, > pending passive checks are totalled properly but not displayed by > serviceDetails.php when you click the link. If I recall, this is because service checks aren't made while a host is still pending, and the (postgres) neb module waits until a service check is made before writing it down. In other words, if a service is configured for a pending host, it will never be populated as "pending". This should probably be changed to be more correct, even though it will slow down startup time. > The issue I see with how it currently works is that if you clear out the > db and wipe the nagios retention.dat, when you go to start nagios up > from this 'fresh' state the module doesn't insert all the host/services > on startup. So instead of seeing '800 pending checks' after refreshing > the mat view you see 5 hosts up/20 service ok/0 pending. I suppose that is more correct, and doing this will also address the issue about serviceDetails.php not showing pending services. > Lastly, I have a nice and simple caching template implementation that > I'll send up today or tomorrow so I can work on some mockups of the gui > over the weekend for comment. I look forward to it. I think I have a good grasp on your database abstraction layer - despite my post-lunch food coma - to my new php eyes, it looks pretty clean. Late last week I had added the ability to sort serviceDetails.php columns.... I'll merge it in and check in the new files later today. |
From: Matthew K. <mk...@ma...> - 2005-01-18 20:59:10
|
On Tue, 2005-01-18 at 19:31, Ben wrote: > Nice work, I'm looking it over and have some first-glance questions. > > 1. You've modified the host stored proc to say that if a host doesn't have > a host_check defined, then it's always up. First, I'm not sure this is > correct - if we can't check the host, how do we know it's up? At best, > it'd be pending. Second, I don't think the changes you've done to the > stored proc make the host "up".... actually, I think they keep it in a > pending state. :) > Well nagios allows for an undefined host check_command and considers them permanently up (http://nagios.sourceforge.net/docs/2_0/xodtemplate.html#host) I may have missed the corresponding queries for the tac display to include it as up though. That change was made quickly so I could start the postgres module without it dumping on a query error since the field was marked not null. Also a few changes that I made for the mysql queries didn't make it back into postgres quite yet. Need to test them some more. > 2. What's wrong with bounded time limits? For me, this is a critical > feature, so they must be supported. > Sorry I must have been mistaken in my testing, postgres's reports work fine! I'll test the mysql equivalent again and fix it up. > 3. What are the inconsistancies between psql, mysql, and the cigs? Those > are likely bugs and should probably have a high priority of getting > squashed. > Well the most noticeable item for postgres is in the tac overview, pending passive checks are totalled properly but not displayed by serviceDetails.php when you click the link. > I'll ask more questions as they come to me. :) > Perfect thanks. Couple more things Do you have some time or mind if I make changes to your module to register hosts and services on startup like the mysql one does? The issue I see with how it currently works is that if you clear out the db and wipe the nagios retention.dat, when you go to start nagios up from this 'fresh' state the module doesn't insert all the host/services on startup. So instead of seeing '800 pending checks' after refreshing the mat view you see 5 hosts up/20 service ok/0 pending. Lastly, I have a nice and simple caching template implementation that I'll send up today or tomorrow so I can work on some mockups of the gui over the weekend for comment. -- Matthew Kent <mk...@ma...> http://magoazul.com |
From: Ben <be...@si...> - 2005-01-18 19:31:14
|
Nice work, I'm looking it over and have some first-glance questions. 1. You've modified the host stored proc to say that if a host doesn't have a host_check defined, then it's always up. First, I'm not sure this is correct - if we can't check the host, how do we know it's up? At best, it'd be pending. Second, I don't think the changes you've done to the stored proc make the host "up".... actually, I think they keep it in a pending state. :) 2. What's wrong with bounded time limits? For me, this is a critical feature, so they must be supported. 3. What are the inconsistancies between psql, mysql, and the cigs? Those are likely bugs and should probably have a high priority of getting squashed. I'll ask more questions as they come to me. :) On Sun, 16 Jan 2005, Matthew Kent wrote: > Well as there hasn't been any other activity since I mentioned doing > this, I've just gone and checked it all in. If I've messed something up > I have copies to revert the changes. > > So basically this breaks database calls and logic into 2 separate files > - one of which is loaded at runtime based on the values in config.php. > Instead of referencing the db directly the gui just calls a generic > function and handles displaying the results. It's explained in a bit > more detail in ui/docs/DESIGN. > > One fun thing about the way the neb module is implemented is that nagios > can load both the mysql and postgres modules up at the same time and you > can switch the gui between the two on the fly just by editing a line in > config.php :) > > I've also started a todo in ui/docs/TODO with a few issues I've come > across. The most immediate one being fixing some of the queries/stored > procs that create the availability reports for both databases. Currently > a few of the start and end time criteria combinations don't work > (bounded start, bounded end time is the most obvious) on both databases. > > In testing everything is working. There are a few inconsistencies > between the displays of nagios default cgis, postgres and mysql that I > plan on ironing out. > > Oh and I had to make a single change to the postgres schema and restart > stored proc to change the 'option' column to just 'opt' as mysql has it > as a reserved word and postgres didn't like the quoting I had to use. > > And please feel free to point out any mistakes in what I've done, I'm > not a professional php programmer, just a system admin :) > -- > Matthew Kent <mk...@ma...> > http://magoazul.com > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > |
From: Matthew K. <mk...@ma...> - 2005-01-17 02:25:37
|
Well as there hasn't been any other activity since I mentioned doing this, I've just gone and checked it all in. If I've messed something up I have copies to revert the changes. So basically this breaks database calls and logic into 2 separate files - one of which is loaded at runtime based on the values in config.php. Instead of referencing the db directly the gui just calls a generic function and handles displaying the results. It's explained in a bit more detail in ui/docs/DESIGN. One fun thing about the way the neb module is implemented is that nagios can load both the mysql and postgres modules up at the same time and you can switch the gui between the two on the fly just by editing a line in config.php :) I've also started a todo in ui/docs/TODO with a few issues I've come across. The most immediate one being fixing some of the queries/stored procs that create the availability reports for both databases. Currently a few of the start and end time criteria combinations don't work (bounded start, bounded end time is the most obvious) on both databases. In testing everything is working. There are a few inconsistencies between the displays of nagios default cgis, postgres and mysql that I plan on ironing out. Oh and I had to make a single change to the postgres schema and restart stored proc to change the 'option' column to just 'opt' as mysql has it as a reserved word and postgres didn't like the quoting I had to use. And please feel free to point out any mistakes in what I've done, I'm not a professional php programmer, just a system admin :) -- Matthew Kent <mk...@ma...> http://magoazul.com |
From: Matthew K. <mk...@ma...> - 2005-01-17 02:07:48
|
On Fri, 2005-01-14 at 03:21, Matthew Kent wrote: > > So, what do you think ? Is it worth the effort ? Else I look for other > > people to help my find out why the segfault and maybe help with > > abstracting the DB code in the UI. > > I'll be setting up the postgres module this weekend and will let you > know how it goes. > Verified that the postgres module compiles and works as expected on debian unstable. As mentioned, must be the libraries. -- Matthew Kent <mk...@ma...> http://magoazul.com |
From: Matthew K. <mk...@ma...> - 2005-01-14 18:16:18
|
On Fri, 2005-01-14 at 17:56, Ben wrote: > I'm pretty green when it comes to PHP.... this *will* keep the ability to > do persistant connections, right? > It should work as PEAR's db class supports it, but I'll be sure to check in testing. > On Fri, 14 Jan 2005, Matthew Kent wrote: > > > > So, what do you think ? Is it worth the effort ? Else I look for other > > > people to help my find out why the segfault and maybe help with > > > abstracting the DB code in the UI. > > > > I'll be setting up the postgres module this weekend and will let you > > know how it goes. > > > > As for abstracting the db code in the ui, I hope to be finished with > > that over the weekend. I've done up a simple set of classes with a > > dependence on PEAR's db to handle the differences between postgres and > > mysql. It should also make adding another database pretty easy. > > -- > > Matthew Kent <mk...@ma...> > > http://magoazul.com > > > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by: Beat the post-holiday blues > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > > _______________________________________________ > > Nagios-db-devel mailing list > > Nag...@li... > > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > > > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |
From: Ben <be...@si...> - 2005-01-14 17:56:33
|
I'm pretty green when it comes to PHP.... this *will* keep the ability to do persistant connections, right? On Fri, 14 Jan 2005, Matthew Kent wrote: > > So, what do you think ? Is it worth the effort ? Else I look for other > > people to help my find out why the segfault and maybe help with > > abstracting the DB code in the UI. > > I'll be setting up the postgres module this weekend and will let you > know how it goes. > > As for abstracting the db code in the ui, I hope to be finished with > that over the weekend. I've done up a simple set of classes with a > dependence on PEAR's db to handle the differences between postgres and > mysql. It should also make adding another database pretty easy. > -- > Matthew Kent <mk...@ma...> > http://magoazul.com > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > |
From: Ben <be...@si...> - 2005-01-14 17:00:46
|
Well, first of, thanks, and second off, that sucks. Can you tell me a little bit about your environment? Perhaps that might help explain things. I'd like to keep things as simple as possible, so I'm hesitant to make the database insertion happen by calling another layer. Yes, it would give more flexibility to how data gets inserted, but really, that process should almost never change once working, and it would also give another point of failure, another potential bottleneck, and certainly more latency in insertions. The fact that querify() doesn't work and that PQclear crashes your system leads me to think that you may be having problems with your postgres libs, because querify() does call PQescapeString() before it writes the final '. What libs are you linking against? On Jan 14, 2005, at 5:30 AM, Tim Verhoeven wrote: > Hi guys, > > First a word of thanks for so quickly creating these database plugins > for Nagios 2. I'm also converting our monitoring infrastructure from a > old netsaint to nagios 2. And for certain things like reports we need > the databse integration. > > So I've been trying to get your module to work. But I can't get it to > run. I always get a segfault. I'm currently trying it to work with > postgres 7.3.4. I first found out that the querify function was not > working. All strings were missing the final '. So I just removed the > piece of code that sets them and added them myself to the printf > statements. That fixed the first segfault. > > Then I'm still getting a segfault at the PQclear at the end of the > processtatus function. And I'm unable to find out why. The status of > the query is ok, no error. > > Getting a bit frustated about not being able to test and help out with > this I've had another idea. Why not change the code/ add a 3 > module/... to call external PHP code that does the actual DB work. It > is pretty simple to make commands out of PHP code (see pear for > example). > > This would allow at the beginning to test and develop much faster > since no recompiles are needed. Just chaning the PHP code is enough. > And with PHP you can also very easy do DB abstraction and that kind of > stuff. > Then later, when the code is stable enough, you can port the PHP code > to C to gain performance. > > So, what do you think ? Is it worth the effort ? Else I look for other > people to help my find out why the segfault and maybe help with > abstracting the DB code in the UI. > > Kind regards, > Tim > > -- > Tim Verhoeven - dj...@ro... - 0479 / 88 11 83 > > /* This is total bullshit: */ > linux-2.6.6/drivers/video/sis/init301.c > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |
From: Matthew K. <mk...@ma...> - 2005-01-14 15:21:46
|
> So, what do you think ? Is it worth the effort ? Else I look for other > people to help my find out why the segfault and maybe help with > abstracting the DB code in the UI. I'll be setting up the postgres module this weekend and will let you know how it goes. As for abstracting the db code in the ui, I hope to be finished with that over the weekend. I've done up a simple set of classes with a dependence on PEAR's db to handle the differences between postgres and mysql. It should also make adding another database pretty easy. -- Matthew Kent <mk...@ma...> http://magoazul.com |
From: Tim V. <dj...@ro...> - 2005-01-14 13:30:53
|
Hi guys, First a word of thanks for so quickly creating these database plugins for Nagios 2. I'm also converting our monitoring infrastructure from a old netsaint to nagios 2. And for certain things like reports we need the databse integration. So I've been trying to get your module to work. But I can't get it to run. I always get a segfault. I'm currently trying it to work with postgres 7.3.4. I first found out that the querify function was not working. All strings were missing the final '. So I just removed the piece of code that sets them and added them myself to the printf statements. That fixed the first segfault. Then I'm still getting a segfault at the PQclear at the end of the processtatus function. And I'm unable to find out why. The status of the query is ok, no error. Getting a bit frustated about not being able to test and help out with this I've had another idea. Why not change the code/ add a 3 module/... to call external PHP code that does the actual DB work. It is pretty simple to make commands out of PHP code (see pear for example). This would allow at the beginning to test and develop much faster since no recompiles are needed. Just chaning the PHP code is enough. And with PHP you can also very easy do DB abstraction and that kind of stuff. Then later, when the code is stable enough, you can port the PHP code to C to gain performance. So, what do you think ? Is it worth the effort ? Else I look for other people to help my find out why the segfault and maybe help with abstracting the DB code in the UI. Kind regards, Tim -- Tim Verhoeven - dj...@ro... - 0479 / 88 11 83 /* This is total bullshit: */ linux-2.6.6/drivers/video/sis/init301.c |
From: Matthew K. <mk...@ma...> - 2005-01-06 17:41:13
|
On Thu, 2005-01-06 at 14:56, Ben wrote: > Cool. I'll see if maybe I can't find a better hack than inserting a > timed event. Quite frankly, even doing the work twice doesn't bother me > so much, though maybe I'm just saying that because my database fits in > ram and it only takes 30 seconds or so to start up. :) > Well I'm not inserting a timed event so much as registering for a callback from the first one to be added. > Maybe I'm blind, but when I pulled new files from CVS I didn't see > anything for the UI. I also don't see any views in the schema that > would support the current UI. Did you forget to check something in? > No you didn't. I haven't begun work on the UI since it's going to require some pretty lengthy changes to abstract between the two databases properly. I'll start in on it tonight. Of course it wouldn't be so bad if MySQL 4.1 wasn't lacking so many features compared to postgres, but I can't do much about that. Since the changes are pretty long I'll wait until I'm finished and go over the changes with you before I bother checking anything in. - Matt > On Jan 5, 2005, at 6:02 PM, Matthew Kent wrote: > > > I've sent up my initial attempt at a mysql version of the postgres > > module. It's reasonably complete, meaning it does all the things the > > postgres module does (although in a far less pretty way) with an > > identical table structure. > > > > Also regarding the issue with retention data, it turns out I was wrong, > > NEBCALLBACK_PROCESS_DATA is called before the data is loaded from the > > rentention file into memory resulting in that 'loading the data twice > > problem' I mentioned. > > > > The solution I found was to register NEBCALLBACK_TIMED_EVENT_DATA for a > > one off call to 'loadconfig' (formerly processStart). Timed events > > aren't scheduled until after the retention file is loaded. It's kinda > > hackish but works. Once loadconfig is hit I loop through the host and > > service lists sending the data to processStatus. > > > > Excuse me if I didn't explain this well, hopefully my code will. > > -- > > Matthew Kent <mk...@ma...> > > http://magoazul.com > > > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by: Beat the post-holiday blues > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > > _______________________________________________ > > Nagios-db-devel mailing list > > Nag...@li... > > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |
From: Ben <be...@si...> - 2005-01-06 14:56:18
|
Cool. I'll see if maybe I can't find a better hack than inserting a timed event. Quite frankly, even doing the work twice doesn't bother me so much, though maybe I'm just saying that because my database fits in ram and it only takes 30 seconds or so to start up. :) Maybe I'm blind, but when I pulled new files from CVS I didn't see anything for the UI. I also don't see any views in the schema that would support the current UI. Did you forget to check something in? On Jan 5, 2005, at 6:02 PM, Matthew Kent wrote: > I've sent up my initial attempt at a mysql version of the postgres > module. It's reasonably complete, meaning it does all the things the > postgres module does (although in a far less pretty way) with an > identical table structure. > > Also regarding the issue with retention data, it turns out I was wrong, > NEBCALLBACK_PROCESS_DATA is called before the data is loaded from the > rentention file into memory resulting in that 'loading the data twice > problem' I mentioned. > > The solution I found was to register NEBCALLBACK_TIMED_EVENT_DATA for a > one off call to 'loadconfig' (formerly processStart). Timed events > aren't scheduled until after the retention file is loaded. It's kinda > hackish but works. Once loadconfig is hit I loop through the host and > service lists sending the data to processStatus. > > Excuse me if I didn't explain this well, hopefully my code will. > -- > Matthew Kent <mk...@ma...> > http://magoazul.com > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |
From: Matthew K. <mk...@ma...> - 2005-01-06 04:01:55
|
I've sent up my initial attempt at a mysql version of the postgres module. It's reasonably complete, meaning it does all the things the postgres module does (although in a far less pretty way) with an identical table structure. Also regarding the issue with retention data, it turns out I was wrong, NEBCALLBACK_PROCESS_DATA is called before the data is loaded from the rentention file into memory resulting in that 'loading the data twice problem' I mentioned. The solution I found was to register NEBCALLBACK_TIMED_EVENT_DATA for a one off call to 'loadconfig' (formerly processStart). Timed events aren't scheduled until after the retention file is loaded. It's kinda hackish but works. Once loadconfig is hit I loop through the host and service lists sending the data to processStatus. Excuse me if I didn't explain this well, hopefully my code will. -- Matthew Kent <mk...@ma...> http://magoazul.com |
From: Ben <be...@si...> - 2005-01-06 00:25:05
|
Well, I think I can wait a few hours. :) On Wed, 5 Jan 2005, Matthew Kent wrote: > On Wed, 2005-01-05 at 23:00, Ben wrote: > > Okay, I thought I'd make a new release, but before I did I'm curious if > > anybody has anything else close to release-level. Anybody? Going once, > > going twice.... > > > > > > Nothing yet, after some tidying up I should be able to add my version > this evening. > -- > Matthew Kent <mk...@ma...> > http://magoazul.com > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > |
From: Matthew K. <mk...@ma...> - 2005-01-05 23:36:31
|
On Wed, 2005-01-05 at 23:00, Ben wrote: > Okay, I thought I'd make a new release, but before I did I'm curious if > anybody has anything else close to release-level. Anybody? Going once, > going twice.... > > Nothing yet, after some tidying up I should be able to add my version this evening. -- Matthew Kent <mk...@ma...> http://magoazul.com |
From: Ben <be...@si...> - 2005-01-05 23:00:33
|
Okay, I thought I'd make a new release, but before I did I'm curious if anybody has anything else close to release-level. Anybody? Going once, going twice.... |