/usr/share/netdisco/html/doc/netdisco-api-backend.html is in netdisco-frontend 1.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 | <%text>
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#functions">FUNCTIONS</a></li>
<ul>
<li><a href="#network_discovery">Network Discovery</a></li>
<li><a href="#utility_functions">Utility Functions</a></li>
<li><a href="#snmp_functions">SNMP Functions</a></li>
<li><a href="#netbios_functions">NetBIOS Functions</a></li>
<li><a href="#maintenance_functions">Maintenance Functions</a></li>
<li><a href="#graphing_functions">Graphing Functions</a></li>
<li><a href="#admin_daemon">Admin Daemon</a></li>
</ul>
<li><a href="#copyright_and_licence">COPYRIGHT AND LICENCE</a></li>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>netdisco - Internal API</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>This is the inside guts of the Netdisco executable. You should be looking in
README for how to use Netdisco.</p>
<p>
</p>
<hr />
<h1><a name="functions">FUNCTIONS</a></h1>
<p>
</p>
<h2><a name="network_discovery">Network Discovery</a></h2>
<dl>
<dt><strong><a name="item_discover"><code>discover(host)</code></a></strong>
<dd>
<p>Discovers one device, stores its info, interfaces, and neighbors, and returns.</p>
</dd>
</li>
<dt><strong><a name="item_refresh_all"><code>refresh_all()</code></a></strong>
<dd>
<p>Calls <a href="#item_discover"><code>discover()</code></a> for each file already in device table.</p>
</dd>
</li>
<dt><strong><a name="item_run"><code>run()</code></a></strong>
<dd>
<p>Event loop that calls <a href="#item_discover"><code>discover()</code></a> as long as the @Discover_Queue has something in it.</p>
</dd>
</li>
<dt><strong><a name="item_schlop"><code>schlop(file,topo_only_flag)</code></a></strong>
<dd>
<p>Used to start a discovery based on topography file. Will then proceed to do an initial <code>mac_suck()</code> and <code>arp_nip()</code> unless the topo_only_flag is set.</p>
</dd>
</li>
<dt><strong><a name="item_queue_process">queue_process(device, action, [status])</a></strong>
<dd>
<p>Queue a request for this controller to perform an action.</p>
</dd>
</li>
<dt><strong><a name="item_topo_add_link"><code>topo_add_link([{},{}])</code></a></strong>
<dd>
<p>Pass reference to array of hash references holding link: lines from
manual topology info. Adds information to device_port table.</p>
</dd>
</li>
<dt><strong><a name="item_topo_load_file"><code>topo_load_file(filename)</code></a></strong>
<dd>
<p>Loads and parses manual topography file.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="utility_functions">Utility Functions</a></h2>
<dl>
<dt><strong><a name="item_add_user"><code>add_user()</code></a></strong>
<dd>
<p>Takes 4 optional arguments from @ARGV = (user,pw,port,admin)</p>
</dd>
<dd>
<p>If all 4 are not there, then interactive mode is entered and prompts are given.</p>
</dd>
</li>
<dt><strong><a name="item_batch_mode"><code>batch_mode(name,time_too?)</code></a></strong>
<dd>
<p>Redirects STDOUT to a log file with timestamp.</p>
</dd>
<dd>
<p>Can be called recursively. call <a href="#item_batch_mode_end"><code>batch_mode_end()</code></a> to return to previous Output.</p>
</dd>
</li>
<dt><strong><a name="item_batch_mode_end"><code>batch_mode_end(no_compress_flag)</code></a></strong>
<dd>
<p>Returns control of stdout to previous value, optionally compresses
the finished output file.</p>
</dd>
<dd>
<p>Function returns file name of closed output file.</p>
</dd>
<dd>
<p>Pass something as first parameter to force no compression.</p>
</dd>
</li>
<dt><strong><a name="item_end_int_handler">end_int_handler</a></strong>
<dt><strong><a name="item_end"><code>end()</code></a></strong>
<dd>
<p>Cleanup routine that is called upon interrupt (ctrl-c) or end of routines.</p>
</dd>
<dd>
<p>Prints various statistics to stdout or <code>batch_redirect()</code> and calls Netdisco::log().</p>
</dd>
</li>
<dt><strong><a name="item_load_old_devices"><code>load_old_devices()</code></a></strong>
<dd>
<p>Populates %Old_Devices with which devices are in the database.</p>
</dd>
</li>
<dt><strong><a name="item_load_old_nodes"><code>load_old_nodes(days)</code></a></strong>
<dd>
<p>Populates %Old_Nodes with which nodes are in the database.</p>
</dd>
<dd>
<p>Nodes will have to have been seen in the last DAYS days.</p>
</dd>
</li>
<dt><strong><a name="item_parse_oui"><code>parse_oui()</code></a></strong>
<dd>
<p>Parses file oui.txt in current directory. Uses contents to stuff
table ``oui''.</p>
</dd>
</li>
<dt><strong><a name="item_timeout"><code>timeout()</code></a></strong>
<dd>
<p>Signal handler for SIGALARM</p>
</dd>
</li>
<dt><strong><a name="item_ok_to"><code>ok_to(dev,name,what)</code></a></strong>
<dd>
<p>Given a device or IP address, a display name (hostname or IP address),
and an action (arpnip, macsuck, discover), check the configuration
file for _no and _only configurations. Return 1 if it's OK, or 0
if it's not OK.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="snmp_functions">SNMP Functions</a></h2>
<dl>
<dt><strong><a name="item_arpnip"><code>arpnip()</code></a></strong>
<dd>
<p>Connects to device and reads its ARP cache. Then adds entries to <code>node_ip</code> table.</p>
</dd>
<dd>
<p>Cheers to Jim Warner for the original arpnip.</p>
</dd>
</li>
<dt><strong><a name="item_arpwalk"><code>arpwalk()</code></a></strong>
<dd>
<p>Visits every Layer 3 device and trys to get its ARP Cache.</p>
</dd>
<dd>
<p>Calls <a href="#item_arpnip"><code>arpnip()</code></a> for each device.</p>
</dd>
</li>
<dt><strong><a name="item_create_device"><code>create_device(%args)</code></a></strong>
<dd>
<p>All %args are passed straight through to SNMP::Info except 'Class' which when set
turns off <code>AutoSpecify</code>.</p>
</dd>
<dd>
<pre>
my $dev = create_device(
'DestHost' => host,
'Community' => public,
'Version' => 2,
'Retries' => 2,
'Class' => 'SNMP::Info::Layer2',
'VersionForce' => 1,</pre>
</dd>
<dd>
<p>Connect to a device via SNMP::Info with a given host and community string.</p>
</dd>
<dd>
<p>If optional <code>Version</code> and <code>Class</code> are given, no device type discovery is done.</p>
</dd>
<dd>
<p>If a more specific device type is not found <code>-1</code> is returned.
The target device is probably not a network device.</p>
</dd>
<dd>
<p>If <code>VersionForce</code> is true, no fallback to snmpv1 will happen.</p>
</dd>
</li>
<dt><strong><a name="item_device_root"><code>device_root()</code></a></strong>
<dd>
<p>Looks to see if the device has a master IP instead of the one given.
Checks for <code>root_ip()</code> method, then tries to lookup the reverse entry for sysName.0</p>
</dd>
</li>
<dt><strong><a name="item_find_neighbors"><code>find_neighbors()</code></a></strong>
<dd>
<p>Finds all the CDP information on the device and stores the results in device_node.</p>
</dd>
<dd>
<p>Adds to the @Discover_Queue</p>
</dd>
</li>
<dt><strong><a name="item_get_device"><code>get_device(host)</code></a></strong>
<dd>
<p>Calls <a href="#item_create_device"><code>create_device()</code></a> with a community string</p>
</dd>
<dd>
<p>If cached values are stored in the database for the SNMP version and community strings,
they are used.</p>
</dd>
<dd>
<p>If no cached values are available, or if they fail, then the values from the config file are
tried.</p>
</dd>
</li>
<dt><strong><a name="item_check_snmp_version"><code>check_snmp_version(device,[version])</code></a></strong>
<dd>
<p>Check for a forced SNMP version by the configuration file arguments
snmpforce_v1, snmpforce_v2, snmpforce_v3
=cut</p>
</dd>
<dd>
<p>sub check_snmp_version {
<code>my($device,$version)</code> = @_;
my $versionForce;
my $dev_ip;
if (ref($device)) {
$dev_ip = $device->{ip};
} else {
$dev_ip = $device;
}</p>
</dd>
<dd>
<pre>
if (!defined($version)) {
$version = $CONFIG{snmpver};
}
$versionForce = 0;</pre>
</dd>
<dd>
<pre>
# Check for forced SNMP Verison
if (in_device($device,$CONFIG{snmpforce_v1}) ) {
print "! [$dev_ip] Forcing SNMPv1 by config file.\n";
$version = 1;
$versionForce = 1;
}
if (in_device($device,$CONFIG{snmpforce_v2}) ) {
print "! [$dev_ip] Forcing SNMPv2c by config file.\n";
$version = 2;
$versionForce = 1;
}
if (in_device($device,$CONFIG{snmpforce_v3}) ) {
print "! [$dev_ip] Forcing SNMPv3 by config file.\n";
$version = 3;
$versionForce = 1;
}
return ($version, $versionForce);
}</pre>
</dd>
</li>
<dt><strong><a name="item_get_snmp_args"><code>get_snmp_args(device,version,comm/user,rw)</code></a></strong>
<dd>
<p>Returns the args used to connect to device with version</p>
</dd>
</li>
<dt><strong><a name="item_get_device_rw"><code>get_device_rw(device[,version])</code></a></strong>
<dd>
<p>Returns a SNMP::Info object for a given device, using the Read-Write Community
Strings in the config file.</p>
</dd>
<dd>
<p>Returns undef or -1 on error.</p>
</dd>
</li>
<dt><strong><a name="item_get_subnets"><code>get_subnets(device)</code></a></strong>
<dd>
<p>Grab netmask and ip from device interfaces. Determine device subnets
mathematically based upon the interface information.</p>
</dd>
</li>
<dt><strong><a name="item_store_modules"><code>store_modules()</code></a></strong>
<dd>
<p>Gets all the physical module information using Table Methods in SNMP::Info.</p>
</dd>
<dd>
<p>Deletes the old module entries in device_module and puts in new ones.</p>
</dd>
</li>
<dt><strong><a name="item_mac_getportmacs"><code>mac_getportmacs()</code></a></strong>
<dd>
<p>Fills the global %PortMAC with MAC addresses of ports already discovered.
This is to make sure we don't mac-suck existing ports, such as VLANs.</p>
</dd>
</li>
<dt><strong><a name="item_macsuck"><code>macsuck()</code></a></strong>
<dd>
<p>Walks forwarding table for a specific device.</p>
</dd>
<dd>
<p>Gets mac addresses that are listed in physical ports that do not have a
neighbor listed. If the device has VLANs, it will walk each VLAN and get the
MAC addresses from there.</p>
</dd>
</li>
<dt><strong><a name="item_macsuck_vlans"><code>macsuck_vlans(...)</code></a></strong>
<dd>
<p>For certain Cisco switches you have to connect to each VLAN and get the
forwarding table out of it. Notably the Catalyst 5k, 6k, and 3500 series</p>
</dd>
<dd>
<p>This sub checks to see if the device supports this and then interrogates each VLAN.</p>
</dd>
<dd>
<p>Returns number of nodes discovered in forwarding tables.</p>
</dd>
</li>
<dt><strong><a name="item_wireless_client_info">wireless_client_info</a></strong>
<dd>
<p>Walks Cisco dot11 client associations, if present, and stores per-client
association information.</p>
</dd>
</li>
<dt><strong><a name="item_mac_savecache"><code>mac_savecache({},{})</code></a></strong>
<dd>
<p>Does two things :</p>
</dd>
<dd>
<p>1. Checks for detected uplinks, warns of such and removes nodes on these uplinks from additions list</p>
</dd>
<dd>
<p>2. Stores the found forwarding table entries to the database.</p>
</dd>
</li>
<dt><strong><a name="item_macwalk"><code>macwalk()</code></a></strong>
<dd>
<p>Grabs all the devices out of the database.
Runs <a href="#item_macsuck"><code>macsuck()</code></a> on each device that has layer2 capabilites.</p>
</dd>
</li>
<dt><strong><a name="item_send_monitor_email"><code>send_monitor_email()</code></a></strong>
<dd>
<p>If there is an email address configured in netdisco.conf under
node_monitor_email, look for any rows in the node_monitor table
that are being monitored and if the mac address has arrived or
moved, send the appropriate email. This function only works
immediately after macsuck; if another macsuck happens in between
this will not detect the arrival. Therefore, this function
is only ever called from the end of <em>macwalk</em>.</p>
</dd>
</li>
<dt><strong><a name="item_set_status"><code>set_status()</code></a></strong>
<dd>
<p>Sets $0 to a status string. Use sprintf-style arguments.
=cut</p>
</dd>
<dd>
<p>sub <a href="#item_set_status"><code>set_status($@)</code></a> {
<code>my($fmt)</code> = shift;
$0 = ``netdisco: '' . sprintf($fmt, @_);
}</p>
</dd>
</li>
<dt><strong><a name="item_parallel_init"><code>parallel_init()</code></a></strong>
<dd>
<p>Initializes parallelization with the maximum number of simultaneously running processes
set in configuration file. Creates a dummy SNMP::Info object to load MIBs only once for each child.
Disconnects the database handle so that it's not held open across a fork.</p>
</dd>
</li>
<dt><strong><a name="item_dispatcher">dispatcher(action, subroutine)</a></strong>
<dd>
<p>Multi-process dispatcher that handles the ``standard'' case of
multiple macsuck/arpnip/nbtstat. It uses Parallel::ForkManager
in a slightly unusual way, in that it forks off long-lived
worker children that service the queue themselves, similar to
Apache.</p>
</dd>
</li>
<dt><strong><a name="item_port_control"><code>port_control(switch,port,direction)</code></a></strong>
<dt><strong><a name="item_port_switch"><code>port_switch({})</code></a></strong>
<dd>
<p>Used to shut ports on and off and to change VLANs.</p>
</dd>
</li>
<dt><strong><a name="item_store_device"><code>store_device()</code></a></strong>
<dd>
<p>Calls all the global methods and sends the results off to the database</p>
</dd>
</li>
<dt><strong><a name="item_store_interfaces"><code>store_interfaces()</code></a></strong>
<dd>
<p>Gets all the interface information using Table Methods in SNMP::Info.</p>
</dd>
<dd>
<p>Deletes the old interface entries in device_port and puts in new ones.</p>
</dd>
</li>
<dt><strong><a name="item_store_vlans"><code>store_vlans()</code></a></strong>
<dd>
<p>Gets all the VLAN information using Table Methods in SNMP::Info.</p>
</dd>
<dd>
<p>Deletes the old VLAN entries in device_port_vlan and puts in new ones.</p>
</dd>
</li>
<dt><strong><a name="item_store_power"><code>store_power()</code></a></strong>
<dd>
<p>Gets all the Power-over-Ethernet information using Table Methods in SNMP::Info.</p>
</dd>
<dd>
<p>Deletes the old PoE entries in device_power and device_port_power and puts in new ones.</p>
</dd>
</li>
<dt><strong><a name="item_walk_fwtable"><code>walk_fwtable()</code></a></strong>
<dd>
<p>Walks the Forwarding table from the <code>BRIDGE-MIB</code>
for the given device, and then adds MAC addresses to the <code>node</code> table.
Returns the number of entries fetched.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="netbios_functions">NetBIOS Functions</a></h2>
<dl>
<dt><strong><a name="item_nbtstat"><code>nbtstat(host)</code></a></strong>
<dd>
<p>Connects to node and gets NetBIOS information. Then adds entries to node_nbt table.</p>
</dd>
<dd>
<p>Returns whether a node is answering netbios calls or not.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="maintenance_functions">Maintenance Functions</a></h2>
<dl>
<dt><strong><a name="item_alias_clean"><code>alias_clean()</code></a></strong>
<dd>
<p>Routine to clean out devices that are now listed as aliases of another device. This is
usually necessary after a device has been merged into another one.</p>
</dd>
</li>
<dt><strong><a name="item_arp_dump"><code>arp_dump(dir)</code></a></strong>
<dd>
<p>Dumps node_ip table to files arp_current and arp_archive.</p>
</dd>
</li>
<dt><strong><a name="item_change_device_ip">change_device_ip(from_ip, to_ip)</a></strong>
<dd>
<p>Used to move move over all the information from one device
to a new IP address. First tries to discover new device, then
proceeds to move over old information.</p>
</dd>
</li>
<dt><strong><a name="item_db_clean"><code>db_clean()</code></a></strong>
<dd>
<p>Removes all the entries in <code>node</code> that are switch ports.</p>
</dd>
<dd>
<p>Checks for nodes on non existant ports and prints a warning</p>
</dd>
<dd>
<p>Removes nodes that are on uplink ports.</p>
</dd>
</li>
<dt><strong><a name="item_dev_dump"><code>dev_dump()</code></a></strong>
<dd>
<p>Dumps out the device,device_ip, and topology info from device_port to file 'devices'.</p>
</dd>
</li>
<dt><strong><a name="item_expire_data"><code>expire_data(type,days,archive_only)</code></a></strong>
<dd>
<p><code>type</code> can be : node,device,process</p>
</dd>
<dd>
<p><code>days</code> is a positive integer number of days in which an entry
has not been updated.</p>
</dd>
<dd>
<p><code>archive_only</code> for node only.</p>
</dd>
<dd>
<p>Removes devices and nodes that haven't been updated in <code>days</code> days or
processes created <code>days</code> days ago. Process table clean up is for crashed or
improperly terminated jobs still in the table. Called from <a href="#item_nightly"><code>nightly()</code></a> and
controlled through the <code>expire_*</code> directives in the config file.</p>
</dd>
<dd>
<p>Cheers to Brian Wilson for his patch for the start of this feature.</p>
</dd>
</li>
<dt><strong><a name="item_expire_device"><code>expire_device(device,expire_nodes?)</code></a></strong>
<dd>
<p>Removes device from the database</p>
</dd>
<dd>
<p>Set second argument to true to remove all the connected nodes and their
IP mappings as well.</p>
</dd>
</li>
<dt><strong><a name="item_expire_nodes"><code>expire_nodes(device,archive_only,port)</code></a></strong>
<dd>
<p>Removes entries from node and node_ip for a given device.</p>
</dd>
<dd>
<p>Set port to limit the expiration to a specific port.</p>
</dd>
<dd>
<p>Set archive_only to 1 to archive the nodes on the device.</p>
</dd>
</li>
<dt><strong><a name="item_expire_nodes_subnet"><code>expire_nodes_subnet(subnet)</code></a></strong>
<dd>
<p>Subnet is in CIDR format, or any other format that Postgres likes.</p>
</dd>
<dd>
<pre>
192.168.0.0/24</pre>
</dd>
<dd>
<p>Runs expire_ips afterwards to cleanup.</p>
</dd>
</li>
<dt><strong><a name="item_expire_ips"><code>expire_ips()</code></a></strong>
<dd>
<p>Expires IPs not in use in node.</p>
</dd>
<dd>
<pre>
delete from node_ip where
mac not in
(select mac from node)</pre>
</dd>
</li>
<dt><strong><a name="item_mac_dump"><code>mac_dump()</code></a></strong>
<dd>
<p>Dumps the node table out to mac_current.txt and mac_archive.txt.
Adds a day stamp, no time-stamp.</p>
</dd>
</li>
<dt><strong><a name="item_netbios_dump"><code>netbios_dump()</code></a></strong>
<dd>
<p>Dumps the node_nbt table out to netbios_current.txt and netbios_archive.txt.
Adds a day stamp, no time-stamp.</p>
</dd>
</li>
<dt><strong><a name="item_nightly"><code>nightly(no_batch)</code></a></strong>
<dd>
<p>Nightly maintance routine that creates backups of the device,node, and node_ip tables.</p>
</dd>
<dd>
<p>Calls expire_data(), nmis_dump(),
mac_dump(), arp_dump(), dev_dump(), netbios_dump(),
<a href="#item_db_clean"><code>db_clean()</code></a> and VACUUM ANALYZE</p>
</dd>
</li>
<dt><strong><a name="item_nmis_dump"><code>nmis_dump()</code></a></strong>
<dd>
<p>Dumps the device table out to NMIS (http://www.sins.com.au/nmis/) style config file.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="graphing_functions">Graphing Functions</a></h2>
<dl>
<dt><strong><a name="item_graph"><code>graph(no_batch)</code></a></strong>
<dd>
<p>Creates netmap of network. Calls Netdisco::make_graph() and <a href="#item_graph_each"><code>graph_each()</code></a></p>
</dd>
</li>
<dt><strong><a name="item_graph_each">graph_each(Graph_obj, name)</a></strong>
<dd>
<p>Generates subgraph. Called from graph(). Calls graph_node().</p>
</dd>
<dd>
<p>Does actual GraphViz calls.</p>
</dd>
</li>
<dt><strong><a name="item_graph_addnode"><code>graph_addnode(graphviz_obj,node_ip)</code></a></strong>
<dd>
<p>Checks for mapping settings in config file and adds node to the GraphViz object.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="admin_daemon">Admin Daemon</a></h2>
<dl>
<dt><strong><a name="item_admin_daemon_ctl"><code>admin_daemon_ctl(cmd)</code></a></strong>
<dd>
<p>start,stop,restart,status</p>
</dd>
</li>
<dt><strong><a name="item_admin_daemon_status"><code>admin_daemon_status(pid)</code></a></strong>
<dd>
<p>Returns 0 if daemon is not running or returns pid number if running.</p>
</dd>
<dd>
<p>pid argument is optional, used in stop function</p>
</dd>
</li>
<dt><strong><a name="item_admin_daemon"><code>admin_daemon()</code></a></strong>
<dd>
<p>Resident copy of netdisco to handle requests from the admin panel.</p>
</dd>
</li>
<dt><strong><a name="item_admin_daemon_pid"><code>admin_daemon_pid(pid_to_write)</code></a></strong>
<dd>
<p>If not supplied arguments, Reads pid of daemon pid from <em>netdisco_daemon.pid</em></p>
</dd>
<dd>
<p>If supplied arguments, writes the pid out to that file.</p>
</dd>
</li>
<dt><strong><a name="item_admin_daemon_job"><code>admin_daemon_job(job_obj)</code></a></strong>
<dd>
<p>Runs each job. Redirects output to data/admin/job-num-date.log
job_obj is the sql hash object for each job.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="copyright_and_licence">COPYRIGHT AND LICENCE</a></h1>
<p>Changes in code from 0.92 on:
Copyright (c) 2003-2009 Max Baker and the Netdisco Developer Team - All Rights Reserved
</p>
<p>Original Code:
Copyright (c) 2002,2003 Regents of the University of California
All rights reserved.
</p>
<p>Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
</p>
<pre>
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the University of California, Santa Cruz nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
</pre>
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</p>
</%text>
|