From: Buchan M. <bg...@gm...> - 2017-04-12 05:01:05
|
> OK, this one has taken me a bit to track down. I updated my xymon config > and devmon died. > Did the normally polling process die? Do you have any relevant log messages? Or did it exhibit the same behaviour as below? > > Below is the devmon/xymon info from the xymon hosts file: > > DEVMON:model(cisco;2960),except(all;ifName;ao:Gi1/0/[1- > 4]|Gi1/0/[7,8,9,10,11]|Gi1/0/[23,24,25,26,27,28,29,30,31,32, > 33,34]|Gi1/0/[45,46,47,48]) > You can't use commas inside the regex, as it makes it difficult to parse the different types of options (which are separated by commas). You probably want something like this: DEVMON:model(cisco;2960),except(all;ifName;ao:Gi1/0/[1-4]|Gi1/0/([7-9]|10|11|2[3-9]|3[0-4]|4[5-8])) This kind of problem is that my colleagues have had as well, and maybe at some point it needs to be easier to configure devmon. But that would probably require a database of some kind (where at present using a database is optional), and the Xymon community seems to be averse to requiring a database. > > After I make a mod in that, I restart devmon. My init script executes > > devmon --readbbhosts > > to update the database. What I find in the DB, with the line above is: > > | switch | all | ifName | alarm | Gi1/0/[1-4]|Gi1/0/[7 | > > so the DB update is being truncated. Just for fun, I manually updated the > DB with information as in the hosts and devmon is completely happy. > Running devmon with the data above, > and devmon exist with an error for the regex (correctly). > > when I use this regex: > > DEVMON:model(cisco;2960),except(all;ifName;ao:Gi1/0/[1- > 4]|Gi1/0/[7-11]|Gi1/0/[23-34]|Gi1/0/[45-48] > This regex is invalid, as the values inside square brackets in a *regex* need to represent a consecutive range of single characters, not a range of values. > > the database loads correctly: > > | switch | all | ifName | alarm | Gi1/0/[1-4]|Gi1/0/[7-11]|Gi1/0/[23-34]|Gi1/0/[45-48] > | > > and devmon still dies parsing the regex: > > Invalid [] range "7-1" in regex; marked by <-- HERE in > m/^(Gi1/0/[1-4]|Gi1/0/[7-1 <-- HERE 1]|Gi1/0/[23-34]|Gi1/0/[45-48])$/ at > /usr/local/devmon-0.3.1-beta1/modules/dm_tests.pm > line 1853 > > bug or do I just not understand? > > Well, the best solution here is that same code should actually be used to validate the regex when loading the config as at run-time, so that anything that is accepted into configuration will not cause devmon to die. Regards, Buchan |