client-local.cfg:
file:/export/home/nmsbb/client/tmp/TEST
hobbit-clients.cfg:
FILE %.*SNMP_COMMUNITY.public.nxg21:TEST.* yellow mtime>100
type:100000 (file, symlink -> /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16.Z) mode:600 (-rw-------) linkcount:1 owner:108 (netx) group:10 (staff) size:1 clock:1147953285 (2006/05/18-11:54:45) atime:1147937673 (2006/05/18-07:34:33) ctime:1147903202 (2006/05/17-22:00:02) mtime:1147745875 (2006/05/16-02:17:55)
nmsbb@:/export/home/nmsbb> ls -al /export/home/nmsbb/client/tmp/TEST lrwxrwxrwx 1 nmsbb nms 101 May 18 11:59 /export/home/nmsbb/client/tmp/TEST -> /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16.Z
nmsbb@:/export/home/nmsbb> ls -al /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16.Z -rw------- 1 netx staff 1866 May 16 02:17 /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16.Z
nmsbb@:/export/home/nmsbb/client/tmp> cat logfetch.ndcnxg21.cfg file:/export/home/nmsbb/client/tmp/TEST log:/export/home/netx/Log/LOG.database:10240
nmsbb@:/export/home/nmsbb/client/tmp> cat logfetch.ndcnxg21.status /export/home/netx/Log/LOG.database:185760:185760:185760:185760:185760:185760:185760
This fails to fire an alarm whether the mtime>100 or mtime<100. I am trying to get it to fire if a file has not updated within the last 100 seconds. I have been faithfully compiling client and server installs daily from the snapshots, but no luck yet.
This also fails to work:
client-local.cfg:
file:/home/nmsmgr/GNUstep/.GNUstepDefaults
hobbit-clients.cfg:
FILE /home/nmsmgr/GNUstep/.GNUstepDefaults yellow size<1
type:100000 (file) mode:600 (-rw-------) linkcount:1 owner:3200 (nmsmgr) group:1026 (nmsadmin) size:0 clock:1147958071 (2006/05/18-13:14:31) atime:1147958065 (2006/05/18-13:14:25) ctime:1147958065 (2006/05/18-13:14:25) mtime:1146073519 (2006/04/26-17:45:19)
nmsbb at pdcalm105:/home/nmsbb> ls -al /home/nmsmgr/GNUstep/.GNUstepDefaults -rw------- 1 nmsmgr nmsadmin 125 Apr 26 17:45 /home/nmsmgr/GNUstep/.GNUstepDefaults
'size' is not 0 as reported but 125 bytes, if it was 0 then it should fire an alarm, which it doesn't:
Since I am not sure how to debug this I am going to resort to the desperate action of putting debug statements in the source code, and hoping I am looking at the correct source file which I think is client_config.c.
~David
David Gore wrote:
client-local.cfg:
file:/export/home/nmsbb/client/tmp/TESThobbit-clients.cfg:
FILE %.*SNMP_COMMUNITY.public.nxg21:TEST.* yellow mtime>100type:100000 (file, symlink -> /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16.Z)
mode:600 (-rw-------) linkcount:1 owner:108 (netx) group:10 (staff) size:1 clock:1147953285 (2006/05/18-11:54:45) atime:1147937673 (2006/05/18-07:34:33) ctime:1147903202 (2006/05/17-22:00:02) mtime:1147745875 (2006/05/16-02:17:55)
Well, after thinking about this and watching the code, I thought, oh clearly my entry is wrong:
hobbit-clients.cfg: FILE %.*SNMP_COMMUNITY.public.nxg21:TEST.* yellow mtime>100
At first I thought, oh I forgot to encase the regex in double quotes, but then I could see this NOT being matched as I traced the code and thought clearly it should be:
hobbit-clients.cfg: FILE /export/home/nmsbb/client/tmp/TEST
But of course that is the link and not the actual file. The file is:
/export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16.Z
This output is around line 1931 (off because of debugging lines). I no longer have the energy to trace this further, but since it appears none of our mtime checks work, I can only guess because these tests fail because rwalk->rule.fcheck.minmtimedif = 0. I am not sure any of the max or min mtime tests work, but I give up, for all I know it could be my fault. I have certainly stared out it long enough to get confused.
2006-05-18 18:52:46 Checking mtime MIN for file: /export/home/nmsbb/client/tmp/TEST 2006-05-18 18:52:46 FAILED mtime MIN for file: /export/home/nmsbb/client/tmp/TEST 2006-05-18 18:52:46 mtimedif [232491] < rwalk->rule.fcheck.minmtimedif [0] 2006-05-18 18:52:46 FAILED mtime MAX for file: /export/home/nmsbb/client/tmp/TEST
Do the mtime tests work for the target files of links? Not that we can get it to work for a simple file.
Server is Fedora Core 5 running the latest snapshot.
nmsbb@:/export/home/nmsbb> ls -al /export/home/nmsbb/client/tmp/TEST lrwxrwxrwx 1 nmsbb nms 101 May 18 11:59 /export/home/nmsbb/client/tmp/TEST -> /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16.Z
nmsbb@:/export/home/nmsbb> ls -al /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16.Z
-rw------- 1 netx staff 1866 May 16 02:17 /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16.Z
nmsbb@:/export/home/nmsbb/client/tmp> cat logfetch.ndcnxg21.cfg file:/export/home/nmsbb/client/tmp/TEST log:/export/home/netx/Log/LOG.database:10240
nmsbb@:/export/home/nmsbb/client/tmp> cat logfetch.ndcnxg21.status /export/home/netx/Log/LOG.database:185760:185760:185760:185760:185760:185760:185760
This fails to fire an alarm whether the mtime>100 or mtime<100. I am trying to get it to fire if a file has not updated within the last 100 seconds. I have been faithfully compiling client and server installs daily from the snapshots, but no luck yet.
This also fails to work:
client-local.cfg:
file:/home/nmsmgr/GNUstep/.GNUstepDefaultshobbit-clients.cfg:
FILE /home/nmsmgr/GNUstep/.GNUstepDefaults yellow size<1type:100000 (file) mode:600 (-rw-------) linkcount:1 owner:3200 (nmsmgr) group:1026 (nmsadmin) size:0 clock:1147958071 (2006/05/18-13:14:31) atime:1147958065 (2006/05/18-13:14:25) ctime:1147958065 (2006/05/18-13:14:25) mtime:1146073519 (2006/04/26-17:45:19)
nmsbb at pdcalm105:/home/nmsbb> ls -al /home/nmsmgr/GNUstep/.GNUstepDefaults -rw------- 1 nmsmgr nmsadmin 125 Apr 26 17:45 /home/nmsmgr/GNUstep/.GNUstepDefaults
'size' is not 0 as reported but 125 bytes, if it was 0 then it should fire an alarm, which it doesn't:
Since I am not sure how to debug this I am going to resort to the desperate action of putting debug statements in the source code, and hoping I am looking at the correct source file which I think is client_config.c.
~David
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
On Thu, May 18, 2006 at 01:47:29PM +0000, David Gore wrote:
client-local.cfg:
file:/export/home/nmsbb/client/tmp/TESThobbit-clients.cfg:
FILE %.*SNMP_COMMUNITY.public.nxg21:TEST.* yellow mtime>100
I fail to see how these two can match. The regex pattern ".*SNMP_COMMUNITY.public.nxg21:TEST.*" does not match the filename "/export/home/nmsbb/client/tmp/TEST"
Filenames are matched with the names you provide, not some (random) filename at the end of a symlink chain.
client-local.cfg:
file:/home/nmsmgr/GNUstep/.GNUstepDefaultshobbit-clients.cfg:
FILE /home/nmsmgr/GNUstep/.GNUstepDefaults yellow size<1type:100000 (file) mode:600 (-rw-------) linkcount:1 owner:3200 (nmsmgr) group:1026 (nmsadmin) size:0 clock:1147958071 (2006/05/18-13:14:31) atime:1147958065 (2006/05/18-13:14:25) ctime:1147958065 (2006/05/18-13:14:25) mtime:1146073519 (2006/04/26-17:45:19)
nmsbb at pdcalm105:/home/nmsbb> ls -al /home/nmsmgr/GNUstep/.GNUstepDefaults -rw------- 1 nmsmgr nmsadmin 125 Apr 26 17:45 /home/nmsmgr/GNUstep/.GNUstepDefaults
'size' is not 0 as reported but 125 bytes, if it was 0 then it should fire an alarm, which it doesn't:
Could you send me (directly) a copy of the relevant portion of your client's ~client/tmp/msg*.txt file, and your entire hobbit-clients.cfg file?
Regards, Henrik
Henrik Stoerner wrote:
On Thu, May 18, 2006 at 01:47:29PM +0000, David Gore wrote:
client-local.cfg:
file:/export/home/nmsbb/client/tmp/TESThobbit-clients.cfg:
FILE %.*SNMP_COMMUNITY.public.nxg21:TEST.* yellow mtime>100I fail to see how these two can match. The regex pattern ".*SNMP_COMMUNITY.public.nxg21:TEST.*" does not match the filename "/export/home/nmsbb/client/tmp/TEST"
Filenames are matched with the names you provide, not some (random) filename at the end of a symlink chain.
Correct and I understand that. I may be missing the obvious solution, but I was hoping someone would have made a suggestion after I sent a few emails.
Here is a file I want to get the 'mtime' for:
netx at ndcnxg21% ls -al /export/home/netx/Archive/nxg21/nxg21:SIG_SNMP/mci-nornxdb05.SNMP_COMMUNITY.public.nxg21:SIG_SNMP.2006May20 -rw-rw-rw- 1 netx other 2189103 May 20 22:49 /export/home/netx/Archive/nxg21/nxg21:SIG_SNMP/mci-nornxdb05.SNMP_COMMUNITY.public.nxg21:SIG_SNMP.2006May20
The first thing I noticed was the hobbitclient will display something like
file not found: export/home/netx/Archive/nxg21/nxg21:
It cuts the rest off regardless (at or the next character past the
colon). Doesn't really matter since I have to watch a dynamic filename
with date +%Y%b%d.
So then I realize in client-local.cfg on the server you have to have a command or file entry that will resolve to one and only one full path filename? You can, however, use a regular expression in hobbit-clients.cfg to create a line to match more than 1 file entry in client-local.cfg per host?
So how can I create something that will match this file name? I also need to match other dynamic logs, that end in a Julian date. Just remember the file name gets truncated at the colon and I was trying to work around that in combination with the dynamic filename.
Ideas?
client-local.cfg:
file:/home/nmsmgr/GNUstep/.GNUstepDefaultshobbit-clients.cfg:
FILE /home/nmsmgr/GNUstep/.GNUstepDefaults yellow size<1type:100000 (file) mode:600 (-rw-------) linkcount:1 owner:3200 (nmsmgr) group:1026 (nmsadmin) size:0 clock:1147958071 (2006/05/18-13:14:31) atime:1147958065 (2006/05/18-13:14:25) ctime:1147958065 (2006/05/18-13:14:25) mtime:1146073519 (2006/04/26-17:45:19)
nmsbb at pdcalm105:/home/nmsbb> ls -al /home/nmsmgr/GNUstep/.GNUstepDefaults -rw------- 1 nmsmgr nmsadmin 125 Apr 26 17:45 /home/nmsmgr/GNUstep/.GNUstepDefaults
'size' is not 0 as reported but 125 bytes, if it was 0 then it should fire an alarm, which it doesn't:
Could you send me (directly) a copy of the relevant portion of your client's ~client/tmp/msg*.txt file, and your entire hobbit-clients.cfg file?
Regards, Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
On Sat, May 20, 2006 at 11:01:06PM +0000, David Gore wrote:
Here is a file I want to get the 'mtime' for:
-rw-rw-rw- 1 netx other 2189103 May 20 22:49 /export/home/netx/Archive/nxg21/nxg21:SIG_SNMP/mci-nornxdb05.SNMP_COMMUNITY.public.nxg21:SIG_SNMP.2006May20
I think the colons in the filename are the problem. A ':' is also the delimiter in file "file:FILENAME[:hash]" entry in client-local.cfg, so when parsing the "file:..." line it cuts off the filename at the first colon.
It should work if you use the 'run-command-to-generate-filenames'
thing, i.e. in client-local.cfg you have
file:/usr/local/bin/snmpfilename
and then the /usr/local/bin/snmpfilename script on your client host
generates these filenames.
So then I realize in client-local.cfg on the server you have to have a command or file entry that will resolve to one and only one full path filename? You can, however, use a regular expression in hobbit-clients.cfg to create a line to match more than 1 file entry in client-local.cfg per host?
Correct.
Regards, Henrik
Henrik Stoerner wrote:
On Sat, May 20, 2006 at 11:01:06PM +0000, David Gore wrote:
Here is a file I want to get the 'mtime' for:
-rw-rw-rw- 1 netx other 2189103 May 20 22:49 /export/home/netx/Archive/nxg21/nxg21:SIG_SNMP/mci-nornxdb05.SNMP_COMMUNITY.public.nxg21:SIG_SNMP.2006May20
I think the colons in the filename are the problem. A ':' is also the delimiter in file "file:FILENAME[:hash]" entry in client-local.cfg, so when parsing the "file:..." line it cuts off the filename at the first colon.
It should work if you use the 'run-command-to-generate-filenames' thing, i.e. in client-local.cfg you have file:
/usr/local/bin/snmpfilenameand then the /usr/local/bin/snmpfilename script on your client host generates these filenames.
Well, it works now, but I reported it not working on May 13 at 15:39 GMT using the same command technique.
It is still has some issues, however. Here is what the output looks like on the web page:
yellow /export/home/netx/Archive/nxg21/nxg21:SIG_SNMP/mci-nornxdb05.SNMP_COMMUNITY.public.nxg21:SIG_SNMP.2006May21 File was modified 154 seconds ago - should be <0
yellow /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16 File was modified 476411 seconds ago - should be <0
'should be <0' ? Perhaps that should be what the test is in hobbit-clients.cfg entry:
FILE "%.*SIG_SNMP.*" yellow mtime<300
FILE "%.*TEST.*" yellow mtime<100
'should be <300' and 'should be <100'?
Both Rich Smrcina and I think that reads backwards, but it's not that big of a deal. If I have it correctly, it reads as, 'if file mtime is NOT less than 300 seconds then alarm'? Assuming that, the *TEST* file is firing a yellow alarm correctly, the test for the *SNMP* file is also reported as yellow, that would not be correct. If I change both tests to '>' they remain green.
For completeness here is the client-local.cfg:
file:ls -drt /export/home/netx/Archive/nxg21/nxg21*SIG_SNMP/*|tail -1
file:ls -drt /export/home/netx/Archive/nxg21/nxg21*TEST/*|tail -1
Thank you for your hard work on Hobbit!
So then I realize in client-local.cfg on the server you have to have a command or file entry that will resolve to one and only one full path filename? You can, however, use a regular expression in hobbit-clients.cfg to create a line to match more than 1 file entry in client-local.cfg per host?
Correct.
Regards, Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
David Gore wrote:
Henrik Stoerner wrote:
On Sat, May 20, 2006 at 11:01:06PM +0000, David Gore wrote:
Here is a file I want to get the 'mtime' for:
-rw-rw-rw- 1 netx other 2189103 May 20 22:49 /export/home/netx/Archive/nxg21/nxg21:SIG_SNMP/mci-nornxdb05.SNMP_COMMUNITY.public.nxg21:SIG_SNMP.2006May20
I think the colons in the filename are the problem. A ':' is also the delimiter in file "file:FILENAME[:hash]" entry in client-local.cfg, so when parsing the "file:..." line it cuts off the filename at the first colon.
It should work if you use the 'run-command-to-generate-filenames' thing, i.e. in client-local.cfg you have file:
/usr/local/bin/snmpfilenameand then the /usr/local/bin/snmpfilename script on your client host generates these filenames.Well, it works now, but I reported it not working on May 13 at 15:39 GMT using the same command technique.
It is still has some issues, however. Here is what the output looks like on the web page:
yellow /export/home/netx/Archive/nxg21/nxg21:SIG_SNMP/mci-nornxdb05.SNMP_COMMUNITY.public.nxg21:SIG_SNMP.2006May21
File was modified 154 seconds ago - should be <0
yellow /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16
File was modified 476411 seconds ago - should be <0
'should be <0' ? Perhaps that should be what the test is in hobbit-clients.cfg entry:
FILE "%.*SIG_SNMP.*" yellow mtime<300 FILE "%.*TEST.*" yellow mtime<100'should be <300' and 'should be <100'?
Both Rich Smrcina and I think that reads backwards, but it's not that big of a deal. If I have it correctly, it reads as, 'if file mtime is NOT less than 300 seconds then alarm'? Assuming that, the *TEST* file is firing a yellow alarm correctly, the test for the *SNMP* file is also reported as yellow, that would not be correct. If I change both tests to '>' they remain green.
For completeness here is the client-local.cfg:
file:
ls -drt /export/home/netx/Archive/nxg21/nxg21*SIG_SNMP/*|tail -1file:ls -drt /export/home/netx/Archive/nxg21/nxg21*TEST/*|tail -1Thank you for your hard work on Hobbit!
Since, I haven't heard anything, is it something I have wrong?
So then I realize in client-local.cfg on the server you have to have a command or file entry that will resolve to one and only one full path filename? You can, however, use a regular expression in hobbit-clients.cfg to create a line to match more than 1 file entry in client-local.cfg per host?
Correct.
Regards, Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
David Gore wrote:
David Gore wrote:
Henrik Stoerner wrote:
On Sat, May 20, 2006 at 11:01:06PM +0000, David Gore wrote:
Here is a file I want to get the 'mtime' for:
-rw-rw-rw- 1 netx other 2189103 May 20 22:49 /export/home/netx/Archive/nxg21/nxg21:SIG_SNMP/mci-nornxdb05.SNMP_COMMUNITY.public.nxg21:SIG_SNMP.2006May20
I think the colons in the filename are the problem. A ':' is also the delimiter in file "file:FILENAME[:hash]" entry in client-local.cfg, so when parsing the "file:..." line it cuts off the filename at the first colon.
It should work if you use the 'run-command-to-generate-filenames' thing, i.e. in client-local.cfg you have file:
/usr/local/bin/snmpfilenameand then the /usr/local/bin/snmpfilename script on your client host generates these filenames.Well, it works now, but I reported it not working on May 13 at 15:39 GMT using the same command technique.
It is still has some issues, however. Here is what the output looks like on the web page:
yellow /export/home/netx/Archive/nxg21/nxg21:SIG_SNMP/mci-nornxdb05.SNMP_COMMUNITY.public.nxg21:SIG_SNMP.2006May21
File was modified 154 seconds ago - should be <0
yellow /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16
File was modified 476411 seconds ago - should be <0
'should be <0' ? Perhaps that should be what the test is in hobbit-clients.cfg entry:
FILE "%.*SIG_SNMP.*" yellow mtime<300 FILE "%.*TEST.*" yellow mtime<100'should be <300' and 'should be <100'?
Both Rich Smrcina and I think that reads backwards, but it's not that big of a deal. If I have it correctly, it reads as, 'if file mtime is NOT less than 300 seconds then alarm'? Assuming that, the *TEST* file is firing a yellow alarm correctly, the test for the *SNMP* file is also reported as yellow, that would not be correct. If I change both tests to '>' they remain green.
For completeness here is the client-local.cfg:
file:
ls -drt /export/home/netx/Archive/nxg21/nxg21*SIG_SNMP/*|tail -1file:ls -drt /export/home/netx/Archive/nxg21/nxg21*TEST/*|tail -1Thank you for your hard work on Hobbit!
Since, I haven't heard anything, is it something I have wrong?
Today's specifics:
The web page:
yellow /export/home/netx/Archive/nxg21/nxg21:SIG_SNMP/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:SIG_SNMP.2006May23 File was modified 157 seconds ago - should be <0
yellow /export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16.Z File was modified 32905 seconds ago - should be <0
client data:
[file:/export/home/netx/Archive/nxg21/nxg21:TEST/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:TEST.2006May16.Z] type:100000 (file) mode:600 (-rw-------) linkcount:1 owner:108 (netx) group:10 (staff) size:1866 clock:1148389840 (2006/05/23-13:10:40) atime:1148369697 (2006/05/23-07:34:57) ctime:1148357239 (2006/05/23-04:07:19) mtime:1148357239 (2006/05/23-04:07:19)
[file:/export/home/netx/Archive/nxg21/nxg21:SIG_SNMP/mci-nornxdb06.SNMP_COMMUNITY.public.nxg21:SIG_SNMP.2006May23] type:100000 (file) mode:666 (-rw-rw-rw-) linkcount:1 owner:108 (netx) group:1 (other) size:45134 clock:1148389840 (2006/05/23-13:10:40) atime:1148389707 (2006/05/23-13:08:27) ctime:1148389686 (2006/05/23-13:08:06) mtime:1148389686 (2006/05/23-13:08:06)
[clientversion]
hobbit-clients.cfg:
FILE "%.*SIG_SNMP.*" yellow mtime<300
FILE "%.*TEST.*" yellow mtime<900
client-local.cfg:
file:ls -drt /export/home/netx/Archive/nxg21/nxg21*SIG_SNMP/*|tail -1
file:ls -drt /export/home/netx/Archive/nxg21/nxg21*TEST/*|tail -1
So then I realize in client-local.cfg on the server you have to have a command or file entry that will resolve to one and only one full path filename? You can, however, use a regular expression in hobbit-clients.cfg to create a line to match more than 1 file entry in client-local.cfg per host?
Correct.
Regards, Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
participants (2)
-
David.Gore@verizonbusiness.com
-
henrik@hswn.dk