Hello,
I'm having hard time figuring out the problem that I'm trying to solve.
The goal that I want to achieve is to monitor master and slave DNS servers to see if DNS zones on them are in sync. That can be easily done by monitoring zone SOA record and using net.dns.record item key as every time zone is updated it's serial number changes and it is easy to notice mismatch. I get items with string values like this from each DNS server:
"example.com SOA ns.example.com hostmaster.example.com 2016060600 300 120 2419200 7200"
So far so good.
Unfortunately trigger function documentation page says that "All functions return numeric values only. Comparison to strings is not supported" so I'm out of luck comparing values of these items directly.
What I would like to achieve is to extract numeric serial number value ("2016060600" in the example above) from the SOA record item string. Is it possible at all or should I give up and use external scripts to achieve my goal?
Thanks!
I'm having hard time figuring out the problem that I'm trying to solve.
The goal that I want to achieve is to monitor master and slave DNS servers to see if DNS zones on them are in sync. That can be easily done by monitoring zone SOA record and using net.dns.record item key as every time zone is updated it's serial number changes and it is easy to notice mismatch. I get items with string values like this from each DNS server:
"example.com SOA ns.example.com hostmaster.example.com 2016060600 300 120 2419200 7200"
So far so good.
Unfortunately trigger function documentation page says that "All functions return numeric values only. Comparison to strings is not supported" so I'm out of luck comparing values of these items directly.
What I would like to achieve is to extract numeric serial number value ("2016060600" in the example above) from the SOA record item string. Is it possible at all or should I give up and use external scripts to achieve my goal?
Thanks!
Comment