Hello,

Here is some code to add DNS autodetection to JFF.

The code will try to autodetect if the DNS server is authoritative for
the zone name used for its PTR. if not it will try to check the A record
for hostname. Should the host not have a A record (shame on you), the
DNS will then try to request www.google.com. as last resort.

The reason to use a so complex discovery systems is that a lot of
conscientious DNS admin will turn recursive resolution on their primary
DNS to make sure they are not used as caching DNS.

AFAIK, there is no bug with that code and I am using it successfully,
however it will require you to have pear Net_DNS installed. There is no
dependency check performed.

You can install it with : pear install Net_DNS if you already have pear 
to install pear, please read their website at http://pear.php.net/

Regards.

Thomas

---

mysql> select * from pollers where id > 10000;
+-------+--------+-------------+-------------+------------+
| id    | name   | description | command     | parameters |
+-------+--------+-------------+-------------+------------+
| 10001 | status | DNS Poller  | service_dns |            |
+-------+--------+-------------+-------------+------------+
1 row in set (0.00 sec)
 
mysql> select * from interface_types where id > 10000;

| id
| description
| autodiscovery_validate 
| autodiscovery_enabled
| autodiscovery_function
| autodiscovery_parameters 
| autodiscovery_default_poller
| have_graph 
| rrd_structure_rra 
| rrd_structure_res 
| rrd_structure_step
| graph_default 
| break_by_card 
| update_handler 
| allow_manual_add 
|sla_default 

| 10001
| DNS Interface 
| 0 
| 1 
| service_dns            
|                          
| 10001 
| 1 
| RRA:AVERAGE:0.5:1:<resolution> 
| 103680
| 300
| 1 
| 0 
| none 
| 0
| 1

1 row in set (0.00 sec)
 


mysql> select * from interface_types_fields where id > 10000;
| id    
| description 
| name        
| pos 
| itype 
| ftype 
| showable 
| overwritable 
| tracked 
| default_value

| 10002 
| Index       
| index       
| 10 
| 10001 
| 3 
| 0 
| 0 
| 0 
| 

| 10003 
| Description 
| description 
| 20 
| 10001 
| 7 
| 1 
| 0 
| 1 
| 
2 rows in set (0.00 sec)
 
mysql> select * from pollers_poller_groups where id > 10000;
+-------+--------------+-----+--------+---------+
| id    | poller_group | pos | poller | backend |
+-------+--------------+-----+--------+---------+
| 10005 |        10001 |  50 |  10001 |   10001 |
+-------+--------------+-----+--------+---------+
1 row in set (0.01 sec)
 
mysql> select * from pollers_groups where id > 10000;
+-------+-------------+----------------+
| id    | description | interface_type |
+-------+-------------+----------------+
| 10001 | DNS Group   |          10001 |
+-------+-------------+----------------+
1 row in set (0.00 sec)

mysql> select * from types where id > 10000;
| id
| description
| severity
| text
|generate_alarm
| alarm_up
| alarm_duration
| show_default

| 10001 
| DNS         
| 4
| DNS is <state> ( <description> record for <interface> )
| 1 
| 1
| 0 
| 1 
1 row in set (0.00 sec)

Attachment: service_dns.inc.php
Description: application/php

Attachment: service_dns.php
Description: application/php

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to