torrus-3.00/0000755000175000017500000000000013131663307007776 500000000000000torrus-3.00/COPYING0000644000175000017500000004311011545711243010750 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. torrus-3.00/ChangeLog0000644000175000017500000026510613131655331011500 000000000000002017-07-13 Stanislav Sinyagin * NEWS: Torrus Release 3.00 * Replaced BerkeleyDB with Git; incremental XML compiler 2016-08-12 Stanislav Sinyagin * perllib/Torrus/ReportOutput/XLSX.pm: usage report renderer in Excel file format 2016-03-24 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS_SAA.pm: added jitter statistics 2016-02-18 Stanislav Sinyagin * Health status icons for device reachability 2016-02-17 Stanislav Sinyagin * NEWS: Torrus Release 2.09 2015-09-29 Stanislav Sinyagin * perllib/Torrus/Renderer/RPC.pm (rpc_timeseries): TIMESERIES RPC call now returns title, labels, and vertical_label 2015-06-04 Stanislav Sinyagin * init.d/torrus.in: utilize the new launcher in init script * bin/launcher.in: new utility for starting-stopping daemons 2015-04-14 Stanislav Sinyagin * bin/action_snmptrap.in: TORRUS_NPCOMMENT is deliverd in .10 in SNMP traps 2015-04-10 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2670_DOCS_IF.pm: new discovery parameter: RFC2670_DOCS_IF::disable-downstreams 2015-03-30 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP_Params.pm: "aes128cfb" is invalid value for snmp-privprotocol, should be "aes" 2015-01-29 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm: DNS errors treated as host unreachable; reachability statistics more accurate 2015-01-27 Stanislav Sinyagin * perllib/Torrus/Renderer/RPC.pm (rpc_timeseries): added DATAONLY parameter for TIMESERIES RPC call * perllib/Torrus/Renderer/RPC.pm: AGGREGATE_DS RPC call now works for leaves without MAX RRA 2015-01-14 Stanislav Sinyagin * perllib/Torrus/Renderer/RRDtool.pm (rrd_make_hrules): using skipscale for horizontal rules (requires rrdtool-1.4.8 or newer) 2014-12-18 Stanislav Sinyagin * perllib/Torrus/DevDiscover/F5BigIp.pm: added system performance statistics and 64-bit interface counters 2014-12-17 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: new discovery parameter: RFC2863_IF_MIB::disable-all 2014-12-15 Stanislav Sinyagin * perllib/Torrus/Renderer/RRDtool.pm: now hrules are drawn with semi-transparent LINE1 * xmlconfig/defaults.xml: two new horizontal rules: warn-level, crit-level 2014-12-10 Stanislav Sinyagin * xmlconfig/defaults.xml: moved monitor-period and monitor-timeoffset from snmp-defs.xml * bin/monitor.in: new CLI option: --runalways * configs/torrus-config.pl: new configuration parameters: $Torrus::Collector::runAlways = 0; $Torrus::Monitor::runAlways = 0; 2014-11-17 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoGeneric.pm: added support for CISCO-SYSTEM-EXT-MIB (mainly needed for Cisco Nexus) 2014-11-14 Stanislav Sinyagin * perllib/Torrus/DevDiscover/Albis_ULAF.pm (discover): new discovery parameter: Albis_ULAF::mp-name-filter * perllib/Torrus/DevDiscover/CiscoIOS.pm: support for Cisco Nexus; persistent ifIndex for Nexus 2014-10-20 Stanislav Sinyagin * perllib/Torrus/DevDiscover/Fortinet.pm: new discovery module for Fortinet products 2014-10-02 Stanislav Sinyagin * NEWS: Torrus release 2.08 2014-09-30 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm: Bugfix in discovery sequence. This bug was invisible up to perl v5.18.0. Now Perl randomizes hash keys on every loop. 2014-08-22 Stanislav Sinyagin * perllib/Torrus/Renderer/RPC.pm: new RPC method: TIMESERIES 2014-07-11 Stanislav Sinyagin * perllib/Torrus/DevDiscover/UcdSnmp.pm: Loopback interfaces filtered out 2014-05-30 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC4293_IP_MIB.pm: New params: RFC4293_IP_MIB::tokenset-members, RFC4293_IP_MIB::ipv4-external-serviceid, RFC4293_IP_MIB::ipv6-external-serviceid, New selector action: TokensetMember 2014-05-16 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: Improved interface indexing for unknown devices. New parameters: RFC2863_IF_MIB::name-hint RFC2863_IF_MIB::comment-hint 2014-05-13 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm: new discovery parameter: CiscoIOS::ifindex-persist 2014-04-28 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC4293_IP_MIB.pm: new discovery module for IPv4/IPv6 traffic stats 2014-02-28 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoGeneric.pm (discover): 64-bit gauges for Cisco memory pools 2014-02-17 Stanislav Sinyagin * perllib/Torrus/ConfigTree/Writer.pm (initRoot): new parameter: tree-name automatically inserted to the top of the tree 2013-04-29 Stanislav Sinyagin * NEWS: Release 2.07 2013-02-15 Stanislav Sinyagin * NEWS: Release 2.06 * perllib/Torrus/Collector/SNMP.pm (isMapReady): new function: isMapReady(), removed function: activeMappingSessions() 2012-10-28 Stanislav Sinyagin * bin/action_snmpv1trap.in, bin/action_snmptrap.in: $ENV{'TORRUS_SEVERITY'} is now treated properly 2012-10-14 Stanislav Sinyagin * perllib/Torrus/DevDiscover/F5BigIp.pm: New implementation for F5 BigIP support 2012-10-07 Stanislav Sinyagin * NEWS: Release 2.05 * Removed support for F5 BigIP version 4.x because it's end of life and outdated. Support for Version 11 is in development. 2012-09-11 Stanislav Sinyagin * perllib/Torrus/DevDiscover/APC_PowerNet.pm: added support for Modular Environmental Manager (MEM) 2012-08-16 Stanislav Sinyagin * NEWS: Release 2.04 2012-08-16 Stanislav Sinyagin * perllib/Torrus/DevDiscover/EmpireSystemedge.pm: CA eHealth SystemEDGE support is significantly refactored by Roman Hochuli 2012-07-17 Stanislav Sinyagin * configs/torrus-config.pl: default value for $Torrus::Collector::SNMP::unreachableTimeout is set to 0 instead of 6 hours (never give up on unreachable hosts) 2012-07-08 Stanislav Sinyagin * perllib/Torrus/DevDiscover/ComtechEFData.pm: new discovery module for Comtech EF Data satellite modems 2012-07-04 Stanislav Sinyagin * xmlconfig/defaults.xml: new graph view: embedded-small * perllib/Torrus/Renderer/RRDtool.pm (rrd_make_graph_opts): new view parameter 'graph-colors' and URL variable Gcolors 2012-07-03 Stanislav Sinyagin * perllib/Torrus/Renderer/RRDtool.pm: new RRD graph parameter: border 2012-04-22 Stanislav Sinyagin * NEWS: Release 2.03 (bugfix release) 2012-03-20 Stanislav Sinyagin * NEWS: Release 2.02 2012-03-13 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: new parameter RFC2863_IF_MIB::sort-by-name 2012-03-07 Stanislav Sinyagin * Monitor*.pm, Collector*.pm: undef $hash{$key} is deprecated, replaced with delete 2012-02-16 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm: rrd-create-rra is added to the list of copied parameters. 2011-12-27 Stanislav Sinyagin * perllib/Torrus/ConfigTree.pm (getRelative): now leaves can be referred to as [[nodeid]] in RPN. * perllib/Torrus/DevDiscover/RFC2670_DOCS_IF.pm (discover): new discovery parameter: RFC2670_DOCS_IF::suppress-all-cable-stats 2011-12-06 Stanislav Sinyagin * sup/styling/torrus-schema.pl: BpsIn now uses a slightly darker green, so that maxline can have a better contrast. * perllib/Torrus/Renderer/RRDtool.pm: MAX lines can now be displayed in graphs. New URL variables: Gmaxline, Gmaxlinestep. New multigraphs parameters: maxline-style-XX, maxline-color-XX. * perllib/Torrus/DevDiscover/APC_PowerNet.pm: new discovery module 2011-11-24 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm, perllib/Torrus/DevDiscover.pm: new SNMP parameter: "snmp-maxrepetitions". The default value is 10. Previously Net::SNMP was setting it to 25. 2011-11-18 Stanislav Sinyagin * perllib/Torrus/DevDiscover/NetBotz.pm: added selector actions: Monitor, TokensetMember 2011-11-15 Stanislav Sinyagin * perllib/Torrus/Log.pm (enableSyslog): new config variable: $Torrus::Log::syslogSockOpt 2011-11-14 Stanislav Sinyagin * perllib/Torrus/DevDiscover/DevDetails.pm: The following methods are deprecated and will be phased out: storeSnmpVars(), hasOID(), snmpVar(), getSnmpIndices(). $dd->walkSnmpTable() should be used instead. 2011-11-12 Stanislav Sinyagin * configs/torrus-config.pl: New config variables for Syslog: $Torrus::Log::syslogFacility = 'local0'; $Torrus::Collector::useSyslog = 1; $Torrus::Monitor::useSyslog = 1; * bin/monitor.in: disabled log rotation on SIGHUP. Syslog logging enabled by default. * bin/collector.in: disabled log rotation on SIGHUP. Syslog logging enabled by default. * perllib/Torrus/Log.pm: Syslog logging for daemons. 2011-10-14 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: ifSpeed monitoring is triggered by $interface->{'ifSpeedMonitoring'}. The bandwidth usage templates are updated accordingly. 2011-10-12 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC4319_HDSL2_SHDSL_LINE_MIB.pm: new discovery module for HDSL2-SHDSL-LINE-MIB * xmlconfig/generic/rfc2863.if-mib.xml: added templates for ifSpeed and ifHighSpeed 2011-10-03 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoFirewall.pm: interface filter that removes TunnelN interfaces. 2011-09-04 Stanislav Sinyagin * NEWS: Torrus release 2.01 2011-06-26 Stanislav Sinyagin * xmlconfig/snmp-defs.xml: RRA for SNMP reachability is separately defined. New discovery parameter: snmp-reachability-rra. 2011-06-07 Stanislav Sinyagin * perllib/Torrus/Collector.pm (beforeRun): Collector initialization exclusive lock is enabled by $Torrus::Collector::exclusiveStartupLock in torrus-siteconfig.pl * perllib/Torrus/Renderer/RPC.pm: new RPC method: SEARCH_NODEID 2011-06-03 Stanislav Sinyagin * perllib/Torrus/Renderer/RPC.pm: New RPC method: AGGREGATE_DS 2011-06-02 Stanislav Sinyagin * perllib/Torrus/Scheduler.pm, perllib/Torrus/Collector.pm: repeat immediately 3 collector cycles at start 2011-06-01 Stanislav Sinyagin * perllib/Torrus/Collector/RRDStorage.pm (updateRRD): suppress inserting NaN when no data is available for the whole RRD file * xmlconfig/snmp-defs.xml: default rrd-create-heartbeat changed from 500 to 720 2011-05-30 Stanislav Sinyagin * perllib/Torrus/Renderer/RRDtool.pm: "imgformat" is now a configurable view parameter * xmlconfig/defaults.xml: new view: "embedded" for external GUI systems 2011-05-26 Stanislav Sinyagin * perllib/Torrus/Collector.pm (beforeRun): Collector initialization is done with an exclusive lock on collector_lock.db. This avoids the concurrent config slurping at collector startup and minimizes the I/O delays. 2011-05-24 Stanislav Sinyagin * perllib/Torrus/Renderer/HTML.pm (makeURL): All navigation is now done with persistent URLs. Tokens are removed from GUI wnenever possible. 2011-05-23 Stanislav Sinyagin * perllib/Torrus/DevDiscover/Patton.pm: new discovery module for Patton devices * perllib/Torrus/DevDiscover/NexComm.pm: new discovery module for NexComm xDSL gateways * perllib/Torrus/DevDiscover/Actelis.pm: new discovery module for Actelis xDSL gateways * perllib/Torrus/DevDiscover/Thomson_xDSL.pm: new discovery module for Technicolor/Thomson xDSL gateways 2011-05-20 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm: removed uptime from the legend, as it was always confusing * templates/iframe-rrd.html: new RRD leaf view: "iframe-rrd" for portal integration * perllib/Torrus/DevDiscover/CCOM.pm: new discovery module for C-COM CAPSPAN devices 2011-05-15 Stanislav Sinyagin * Makefile.am (dist-hook): DIST_REVISION now displays Git branch information * bin/torrus.fcgi.in: Let FCGI handler re-spawn every 5000 requests or 48 hours for better DB stability 2011-05-10 Stanislav Sinyagin * BDB cursor destructors are explicitly controlled for better stability 2011-05-01 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm: SNMP reachability stats are disabled when "only-devtypes" is in use, and can be forced by "enable-reachability-stats" 2011-04-11 Stanislav Sinyagin * xmlconfig/snmp-defs.xml: new host-level template: snmp-reachability * perllib/Torrus/Collector/SNMP.pm: new collector type: 'snmp-reachable' 2011-04-09 Stanislav Sinyagin * perllib/Torrus/SNMP_Failures.pm (mib_error): bugfix - now all MIB errors are registered, not just one * perllib/Torrus/Collector/SNMP.pm: API change: replaced getHostname() with getHostHash() 2011-03-22 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2790_HOST_RESOURCES.pm: added CPU Load graphs. Still some problems with persistent indexing and naming. * perllib/Torrus/DevDiscover/MicrosoftWindows.pm: added to interface filter: PPP, Tunnel, WAN Miniport, and QoS Packet Scheduler virtual interfaces interface-level nodeid is now dependent on MAC address 2011-01-27 Stanislav Sinyagin * perllib/Torrus/Renderer/HTML.pm (makeURL): Now nodeid is used in HTML whenever available 2010-12-24 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (discover): new discovery parameter: RFC2863_IF_MIB::ifnick-from-ifname provides backwards compatibility with devices which have non-unique ifName values * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (discover): ifDescr and ifName are checked for uniqueness before being used for default interface indexing 2010-12-21 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm: added Port QoS stats (ME3400) 2010-12-19 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2662_ADSL_LINE.pm: re-organized the templates for Cisco 837 compatibility 2010-12-04 Stanislav Sinyagin * sup/webplain/torrus.css: slightly darker top and bottom shortcuts * perllib/Torrus/DevDiscover.pm (discover): New discovery parameter: X-tokenset-rrgraph-view * templates/default-tset.html: New view parameter: rrgraph-view 2010-11-24 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm: New discovery parameter: CiscoIOS::enable-dialer-interfaces 2010-11-25 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: bugfix: RFC2863_IF_MIB::nodeid-hint=ifIndex did not really work 2010-11-23 Stanislav Sinyagin * perllib/Torrus/CGI.pm (do_process): added extra DB cleaninup 2010-11-18 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm: Added CISCO-WAN-3G-MIB support 2010-11-17 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoWLC.pm: new discovery parameter: CiscoWLC::only-ssid 2010-11-05 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): New selector action: AddTemplates 2010-10-24 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoWLC.pm: new discovery module * NEWS: Release 1.0.9 2010-10-12 Stanislav Sinyagin * perllib/Torrus/CGI.pm: New URL parameter: 'v' is a synonym for 'view' 2010-10-06 Stanislav Sinyagin * templates/html-incblocks.txt: 'cssoverlay' now must point to an absolute URL 2010-09-23 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm (checkdevtype): New discovery parameter: CiscoIOS::enable-unrouted-vlan-interfaces 2010-09-20 Stanislav Sinyagin * perllib/Torrus/DevDiscover/Jacarta.pm: New discovery module for Jacarta iMeter (thanks to Roman Hochuli) 2010-09-17 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm (initCollectorGlobals): Refresh the SNMP maps after a configuration re-compile 2010-08-31 Stanislav Sinyagin * performance optimizations: XML compiler runs 15-20% faster 2010-08-16 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: Selector actions split: discards moved from NoErrorCounters to NoDiscardCounters; and from InErrorsMonitor/OutErrorsMonitor to InDiscardsMonitor/OutDiscardsMonitor * perllib/Torrus/Collector.pm: collector_tokens database now depends on DS configuration instance 2010-08-13 Stanislav Sinyagin * perllib/Torrus/CGI.pm: Added host-based authentication 2010-08-09 Stanislav Sinyagin * Updated discovery modules for Net::SNMP 6.0.0 compatibility 2010-08-03 Stanislav Sinyagin * init.d/torrus.in: bugfix in RHEL compatibility. Do "chkconfig --del torrus", install the new version into /etc/init.d, then "chkconfig --add torrus", then "service torrus restart" 2010-07-21 Stanislav Sinyagin * bin/snmpfailures.in: new utility for SNMP failures reporting * perllib/Torrus/Collector/SNMP.pm: SNMP failures stored in a database 2010-06-12 Stanislav Sinyagin * bin/genlist.in: Added a list of all SNMP hosts 2010-05-14 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CasaCMTS.pm: new discovery module 2010-05-09 Stanislav Sinyagin * bin/nodeid.in: new command-line utility * configure.ac: new Perl module dependency: JSON 2010-04-11 Stanislav Sinyagin * configs/torrus-config.pl: replaced $Torrus::ApacheHandler::authorizeUsers with $Torrus::CGI::authorizeUsers. 2010-04-08 Jon Nistor * perllib/Torrus/DevDiscover/Arbor_E.pm: New parameter: Arbor_E::disable-e100-policymgmt, disable-e100-submgmt Added policy management and subscriber information 2010-04-07 Jon Nistor * perllib/Torrus/DevDiscover/Arbor_E.pm: New parameter: Arbor_E::disable-e100-mem Added memory usage per CPU for the e100 series devices 2010-04-04 Stanislav Sinyagin * perllib/Torrus/ConfigTree.pm, perllib/Torrus/ConfigTree/Writer.pm, perllib/Torrus/CGI.pm: New parameter: nodeid. It defines a new way of referring to subtrees and leaves. Also IF-MIB and Foundry discovery is updated. 2010-03-30 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm: Default snmp-max-msg-size is set back to 1470 * perllib/Torrus/DevDiscover/Foundry.pm: new discovery module 2010-03-23 Stanislav Sinyagin * xmlconfig/generic/rfc2790.host-resources.xml: [Bernhard Schmidt] Simplify the Uptime graph to display only Days * xmlconfig/vendor/ucd.ucd-snmp.xml: [Bernhard Schmidt] make Block I/O datasources a COUNTER correct display units for Memory * perllib/Torrus/DevDiscover/UcdSnmp.pm: [Bernhard Schmidt] added ssCpuRawSoftIRQ 2010-03-07 Stanislav Sinyagin * bin/torrus.fcgi.in: FastCGI support * templates/default-login.html: Added "remember me" * perllib/Torrus/ApacheHandler.pm: Changed to Torrus::CGI * perllib/Torrus/Apache2Handler.pm: Changed to Torrus::CGI. Now incompatible with "SetHandler modperl" * perllib/Torrus/CGI.pm: New HTTP handler instead of two different Apache handlers. 2010-03-05 Stanislav Sinyagin * bin/flushmonitors.in: new utility * bin/compilexml.in: Dynamic tokenset members are preserved between compilations * perllib/Torrus/ConfigTree.pm (tsetAddMember): Tokenset members have now an indicated origin (monitor/static) * perllib/Torrus/Monitor.pm: Alarms are now persistent between config re-compilations 2010-02-21 Stanislav Sinyagin * perllib/Torrus/Renderer/HTML.pm: New parameter: node-display-name. Now interface names are not underscored 2010-02-18 Stanislav Sinyagin * perllib/Torrus/Renderer/RRDtool.pm (rrd_make_multigraph): new multigraph parameters: line-stack-X, line-alpha-X 2010-02-10 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm (discover): Default snmp-max-msg-size is set to 65535 for SNMP v1 and v2 2010-02-07 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): new selector action: NotifyPolicy 2010-02-02 Stanislav Sinyagin * perllib/Torrus/DevDiscover/ALU_Timetra.pm: new discovery parameter: ALU_Timetra::full-ifdescr 2010-01-27 Stanislav Sinyagin * perllib/Torrus/DevDiscover/ALU_Timetra.pm: new discovery module 2010-01-24 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm (discover): snmp-max-msg-size is used now in discivery, not only in collector 2009-10-28 Jon Nistor * perllib/Torrus/DevDiscover/Arista.pm (discover): New discovery module: Arista Networks 2009-05-31 Stanislav Sinyagin * perllib/Torrus/Renderer/RRDtool.pm: new view parameters: disable-legend, disable-title, disable-vertical-label 2009-05-26 Jon Nistor * perllib/Torrus/DevDiscover/Arbor_E.pm (discover): New discovery parameter: Arbor_E::disable-e30-hdd-logs, Arbor_E::enable-e30-mempool 2009-05-11 Stanislav Sinyagin * perllib/Torrus/DevDiscover/NetBotz.pm (discover): Discovery parameters: NetBotz::temp-max, NetBotz::humi-max, NetBotz::dew-max 2009-05-10 Stanislav Sinyagin * perllib/Torrus/DevDiscover/NetBotz.pm: new discovery module for NetBotz modular sensors 2009-05-07 Jon Nistor * perllib/Torrus/DevDiscover/FTOS.pm New discovery module for Force10 Networks devices 2009-04-05 Stanislav Sinyagin * NEWS: Release 1.0.8 2008-11-29 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm (discover): New discovery parameter: CiscoIOS::short-device-comment 2008-11-06 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm (runCollector): Number of SNMP sessions per snmp_dispatcher is limited to 100 because of some strange bugs (found on SPARC/Solaris platform) 2008-10-28 Jon Nistor * perllib/Torrus/DevDiscover/Liebert.pm: New discovery module for Liebert HVAC systems 2008-10-26 Stanislav Sinyagin * bin/srvderive.in: new utility that combines several services and combines them as MAX or SUM (sponsored by nexellent ag, www.nexellent.ch) 2008-09-25 Stanislav Sinyagin * Added safe signal handlers to all components. Also Apache handlers close the BDB environment at the end of each execution. BDB should now be much more stable. 2008-09-16 Jon Nistor * perllib/Torrus/DevDiscover/Arbor_E.pm: New discovery module for Arbor E series devices 2008-09-15 Stanislav Sinyagin * perllib/Torrus/Collector.pm: Now the collector cache is filled by the compiler. This optimizes the collector startup. Need to re-compile after upgrade. 2008-09-13 Stanislav Sinyagin * bin/configsnapshot.in: Bugfix in root subtree parameters * bin/configsnapshot.in: added parameter filtering option 2008-09-10 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm: Filtered out EOBC and FIFO virtual interfaces * xmlconfig/vendor/cisco.ios.mac-accounting.xml: Bugfix in the RRD filename 2008-08-07 Stanislav Sinyagin * perllib/Torrus/Renderer/RRDtool.pm (rrd_make_opts): View parameters can be overridden with URL variables "Gstart", "Gend" and so on. 2008-08-05 Stanislav Sinyagin * NEWS: Release 1.0.7 2008-08-04 Jon Nistor * perllib/Torrus/DevDiscover/CiscoIOS.pm (discover): new discovery parameter: CiscoIOS::disable-vpdn-stats 2008-07-23 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2670_DOCS_IF.pm (discover): new discovery parameter: RFC2670_DOCS_IF::upstreams-only 2008-06-20 Stanislav Sinyagin * Tree names can be specified in the External Storage (Billing reports) 2008-06-07 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm: New parameter: snmp-ignore-mib-errors * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): New parameter generated by IF-MIB: interface-comment 2008-06-01 Stanislav Sinyagin * IPv6 support in devdiscover and in SNMP collector 2008-05-22 Stanislav Sinyagin * bin/bdbinfo.in: BerkeleyDB version info utility 2008-03-29 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): RFC2863_IF_MIB::external-serviceid now accepts host/interface notation 2008-03-28 Stanislav Sinyagin * perllib/Torrus/SQL/Reports.pm (finalize): added SQL commit 2008-03-16 Stanislav Sinyagin * bin/collector.in: Threads are now always initialized, not only in daemon mode * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: New selectors: InBytesParameters, OutBytesParameters * perllib/Torrus/DevDiscover.pm (buildConfig): New discovery parameter: include-files 2008-01-12 Stanislav Sinyagin * perllib/Torrus/DevDiscover/JunOS.pm: Added interface filter to exclude service interfaces * perllib/Torrus/DevDiscover.pm, perllib/Torrus/Collector/SNMP.pm: snmp-max-msg-size, new parameter for SNMP session 2007-12-09 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoSCE.pm: New discovery parameters: CiscoSCE::disable-*** (Jon Nistor) 2007-11-30 Stanislav Sinyagin * xmlconfig/defaults.xml: Default collector-timeoffset-step increased from 30 to 60 seconds. 30 seconds is too short for too many installations. 2007-11-08 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): New selector action: RemoveInterface 2007-09-30 Stanislav Sinyagin * perllib/Torrus/DevDiscover/JunOS.pm: Dramatic update by Jon Nistor 2007-08-23 Stanislav Sinyagin * perllib/Torrus/DevDiscover/Symmetricom.pm: New discovery module for Symmetricom NTP clock (Jon Nistor) 2007-08-10 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm: Removed BGP Advertized prefixes Added the prefix limits to Accepted prefixes 2007-08-03 Stanislav Sinyagin * NEWS: Torrus release 1.0.6 2007-07-27 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm: removed "reptoken" and optimized the snmp arguments 2007-06-16 Stanislav Sinyagin * bin/collector.in: Now multiple collector instances can run in a single tree. Need to recompile all trees and re-start the daemons. A new copy of init.d/torrus should be copied in startup scripts directory. Also execute for every tree: torrus si --tree=TREE --clear 2007-06-15 Stanislav Sinyagin * configure.ac: Perl 5.8.8 is required for threads 2007-06-14 Stanislav Sinyagin * bin/genreport.in: New option: --all2tree * perllib/Torrus/DevDiscover/Alteon.pm: New discovery module 2007-06-04 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm: Cisco CAR statistics 2007-05-05 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm: fixed the bug for unreachable timeout the target that receives noSuchObject is deleted from polling 2007-05-04 Stanislav Sinyagin * perllib/Torrus/Collector/CDef.pm: Imported the CDEF collector from Chrstian Schnidrig and adapted to multithreading. * perllib/Torrus/DevDiscover.pm: Adapted for global configuration. * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: New discovery parameter: RFC2863_IF_MIB::traffic-summaries Currently summaries work only within single output file. 2007-04-12 Stanislav Sinyagin * perllib/Torrus/Renderer/HTML.pm: Search engine GUI 2007-04-11 Stanislav Sinyagin * bin/buildsearchdb.in: The search DB builder (GUI is not ready yet) * perllib/Torrus/DevDiscover.pm: New discovery param: show-recursive * templates/default-dir.html: Limit recursive view to subtrees having show-recursive=yes 2007-04-10 Stanislav Sinyagin * perllib/Torrus/ConfigTree.pm: Moved the param properties to the XML config. All trees need recompilation after this change. 2007-04-05 Stanislav Sinyagin * perllib/Torrus/ConfigTree/XMLCompiler.pm (compile_subtrees): Removed support for 2007-03-23 Stanislav Sinyagin * perllib/Torrus/Renderer/RRDtool.pm (rrd_make_graphline): line-style line-color from the node params override thse in the view params 2007-03-18 Stanislav Sinyagin * perllib/Torrus/DevDiscover/JunOS.pm: Added per-CoS traffic statistics 2007-03-16 Stanislav Sinyagin * perllib/Torrus/Apache2Handler.pm, perllib/Torrus/ApacheHandler.pm: User login event in the apache error log * perllib/Torrus/DevDiscover/CiscoIOS_MacAccounting.pm: MAC accounting on subinterfaces 2007-02-14 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm (discover): Replaced CiscoIOS::disable-membuf-stats with CiscoIOS::enable-membuf-stats. Now cisco buffer stats are disabled by default 2007-02-13 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm: SNMP maps automatic refreshing * bin/devdiscover.in: Devdiscover now accepts multiple input files 2007-02-09 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm: New discovery param: template-registry-overlays 2007-02-02 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoSCE.pm: Added service counters and queue utilization 2007-01-25 Stanislav Sinyagin * NEWS: Release 1.0.5 2007-01-23 Stanislav Sinyagin * configure.ac: Synchronized with Autoconf 2.60. Now 2.60 is the minimum required version. Changed docdir to pkgdocdir 2007-01-10 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm (checkdevtype): IOS XR support 2007-01-05 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS.pm (checkdevtype): New discovery parameter: CiscoIOS::enable-vlan-interfaces (discover): added Cisco BGP statistics 2006-12-22 Stanislav Sinyagin * perllib/Torrus/DevDiscover/JunOS.pm: New discovery module for Juniper 2006-12-21 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS_MacAccounting.pm (discover): New discovery parameter: CiscoIOS_MacAccounting::tokenset-members 2006-12-05 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (discover): New discovery parameter: RFC2863_IF_MIB::exclude-down-interfaces * bin/configinfo.in: Added the tree compilation timestamp 2006-12-03 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm: SNMP mapping lookups are now asynchronous. PDUs are rescheduled with delays Not compatible with old cbQos plugin, needs tp-cisco-cbqos-1.4d 2006-11-26 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm: new SNMP parameters: snmp-localaddr and snmp-localport 2006-11-23 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS_MacAccounting.pm: New discovery parameter: CiscoIOS_MacAccounting::external-serviceid 2006-10-14 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: new discovery parameters: RFC2863_IF_MIB::bandwidth-usage RFC2863_IF_MIB::bandwidth-limits 2006-10-08 Stanislav Sinyagin * perllib/Torrus/ConfigTree.pm (new): exclusivity lock: only one compiler can run for a tree 2006-09-29 Stanislav Sinyagin * xmlconfig/generic/rfc2863.if-mib.xml: added an overvew shortcut for interface errors * perllib/Torrus/RPN.pm: IF accepts UNKN values 2006-09-28 Stanislav Sinyagin * configure.ac: theads module version must be 1.41 or higher, and threads::shared 1.03 or higher. 2006-09-27 Stanislav Sinyagin * bin/rrddir2xml.in: New option: --filter * xmlconfig/generic/rfc2670.docsis-if.xml: Added Frequency to upstream statictics monitoring. Old upstream stats will be lost!! The old templates file is in xmlconfig/old/rfc2670.docsis-if.old.1.0.4.xml 2006-09-26 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoSCE.pm: New discovery module * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: Improvements for persistent interface indexes * perllib/Torrus/DevDiscover/MotorolaBSR.pm: New discovery module for Motorola CMTS (Riverdelta) 2006-09-10 Stanislav Sinyagin * perllib/Torrus/Collector/RRDStorage.pm (storeData): RRDQueue statistics are now set in the beginning of the cycle 2006-08-10 Stanislav Sinyagin * perllib/Torrus/ConfigBuilder.pm (new): encoding changed from UTF8 to UTF-8 2006-07-31 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoFirewall.pm (discover): Interface names taken from ifName 2006-07-24 Stanislav Sinyagin * setup_tools/check_perlthreading.pl: Quick test of multithreading support 2006-07-21 Stanislav Sinyagin * perllib/Torrus/Collector/RRDStorage.pm (updateRRD): Added threading support: a background thread for RRD updates 2006-07-20 Stanislav Sinyagin * bin/devdiscover.in: Added multithreading support * configure.ac: Multithreading checkup * NEWS: Torrus release 1.0.4 2006-05-17 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): RFC2863_IF_MIB::tokenset-members now accepts host names and can be defined at the global level. 2006-05-11 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): new discovery parameter: RFC2863_IF_MIB::noout 2006-03-09 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): New discovery parameter: RFC2863_IF_MIB::subtree-comment * perllib/Torrus/Renderer/Frontpage.pm (renderUserLogin): New config option: $Torrus::Renderer::lostPasswordURL 2006-03-01 Stanislav Sinyagin * perllib/Torrus/Renderer/HTML.pm: New config variable: $Torrus::Renderer::companyLogo to display a logo instead of text 2006-02-22 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm: 'comment' parameter is copied from DDX to the host level. 2006-02-21 Stanislav Sinyagin * perllib/Torrus/Monitor.pm: New monitor parameters: display-rpn-expr display-format (run_event_exec): New environment variable: TORRUS_DISPLAY_VALUE 2006-02-15 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm (discover): New discovery parameter: suppress-legend 2006-02-13 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: Complex matching expressions for subtree name selector * perllib/Torrus/DevDiscover/CiscoGeneric.pm (discover): Cisco power supply monitoring 2006-02-10 Stanislav Sinyagin * bin/action_notify.in: New monitor action * perllib/Torrus/Monitor.pm: New monitor parameter: "severity" * perllib/Torrus/DevDiscover/CiscoIOS.pm: Cisco Docsis bundle interfaces excluded from discovery 2006-01-06 Stanislav Sinyagin * perllib/Torrus/RPN.pm: New RPM functions: INF, NEGINF 2005-12-12 Stanislav Sinyagin * perllib/Torrus/RPN.pm: DUP and EXC accept undefined arguments now 2005-12-07 Stanislav Sinyagin * perllib/Torrus/RPN.pm: New RPN function: NUM 2005-11-28 Stanislav Sinyagin * bin/ttproclist.in: Two new functions: lc, uc 2005-11-22 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm: Added SNMPv3 support 2005-10-19 Stanislav Sinyagin * bin/genreport.in: Report generator utility 2005-10-17 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoVDSL.pm: New discovery module for Cisco Catalyst LRE 2005-10-14 Stanislav Sinyagin * templates/default-dir.html, templates/expanded-dir.html: Alex Ustyancev's patches for aliased leaf nodes * perllib/Torrus/SQL.pm: New module dependency: DBIx::Sequence 2005-10-06 Stanislav Sinyagin * perllib/Torrus/SQL.pm: new module dependencies: DBIx::Abstract, DBI. 2005-10-05 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoGeneric.pm: added support for dual-CPU cisco routers (7301) 2005-09-28 Stanislav Sinyagin * perllib/Torrus/DevDiscover/AlliedTelesyn_PBC18.pm: new discovery module 2005-09-02 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm: New discovery parameter: define-tokensets 2005-08-12 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (discover): Replaced $Torrus::DevDiscover::listAdminDownInterfaces with parameter RFC2863_IF_MIB::list-admindown-interfaces and $Torrus::DevDiscover::listNotPresentInterfaces with RFC2863_IF_MIB::list-notpresent-interfaces 2005-08-10 Stanislav Sinyagin * doc/extstorage.pod.in: Started documenting the External storage * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: New discovery parameter: RFC2863_IF_MIB::external-serviceid * xmlconfig/generic/rfc2863.if-mib.xml: Byte counters adapted for External storage * perllib/Torrus/Collector.pm: Multiple storage types per token * perllib/Torrus/ConfigTree/Validator.pm (validateInstanceParams): Enabled validation of list values * perllib/Torrus/Collector/ExtDBI.pm: Pluggable backend module for External storage * perllib/Torrus/Collector/ExternalStorage.pm: New collector storage type 2005-08-02 Stanislav Sinyagin * NEWS: Release 1.0.3 2005-07-29 Stanislav Sinyagin * configure.ac: Patch Level 1: PERLINC configuration variable 2005-07-27 Stanislav Sinyagin * NEWS: Release 1.0.2 2005-07-22 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm (applySelectors): Selectors format slightly changed: the type is passed into the methods 2005-07-15 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm (buildConfig): New discovery parameter: disable-snmpcollector * bin/devdiscover.in: Preventing the bundle file update when --limit is specified. * perllib/Torrus/Collector/SNMP.pm (callback): mapping reset after host unreachable * configs/torrus-config.pl: $Torrus::Collector::SNMP::unreachableTimeout set to 6 hours * perllib/Torrus/Renderer/HTML.pm: entered Date/time verification New CPAN module required: perl -MCPAN -e 'install Date::Parse' 2005-07-14 Stanislav Sinyagin * templates/html-incblocks.txt: Added date setting dialog. TODO: date format validation. 2005-07-11 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: New discovery parameter: RFC2863_IF_MIB::only-interfaces * configure.ac: Now checking if user torrus exists * perllib/Torrus/DevDiscover/AxxessIT.pm: support for WANX/LANX modules 2005-07-06 Stanislav Sinyagin * bin/rrddir2xml.in: New utility for generating XML from a directory with RRD files 2005-06-24 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm: [1.0.1pl2] - fixed bug with deleting unreachable targets 2005-06-21 Stanislav Sinyagin * configure.ac: 1.0.1 Patchlevel 1 * bin/action_snmpv1trap.in, bin/action_snmptrap.in: added torrusMonitorDesc * sup/mibs/TORRUS-MIB.txt: new OID: torrusMonitorDesc * NEWS: release 1.0.1 * perllib/Torrus/SiteConfig.pm (verify): $Torrus::Renderer::stylingProfileOverlay is now an absolute file name * xmlconfig/vendor/cisco.ios.docsis.xml: Added Registered modems graph. WARNING: RRD structure changed * bin/devdiscover.in: New option: --fallback * perllib/Torrus/Collector/SNMP.pm (initTargetAttributes): Target is deleted when SNMP map expansion fails 2005-06-16 Stanislav Sinyagin * perllib/Torrus/Monitor.pm: sleep --delay minutes also after recompiling * configs/torrus-config.pl: $Torrus::Collector::SNMP::unreachableTimeout increased to 1900 $Torrus::Collector::SNMP::unreachableRetryDelay increased to 600 * perllib/Torrus/Collector/SNMP.pm: Better handling of SNMP errors. Delete all tokens for a host if it is unreachable. 2005-06-09 Stanislav Sinyagin * NEWS: Torrus release 1.0.0 * bin/monitor.in: New option: --delay * init.d/torrus.in: The init script reads its options from initscript.conf and initscript.siteconf 2005-06-08 Stanislav Sinyagin * bin/devdiscover.in: new CLI option: --forcebundle * perllib/Torrus/DevDiscover.pm: monitor-period and monitor-timeoffset are now copied from DDX * bin/action_snmpv1trap.in, bin/action_snmptrap.in, sup/mibs/TORRUS-MIB.txt: Added new SNMP variable: severity 2005-06-02 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoIOS_MacAccounting.pm: New discovery module for Cisco MAC accounting 2005-05-30 Stanislav Sinyagin * perllib/Torrus/DevDiscover/BetterNetworks.pm: new discovery module * bin/collector.in: new command line option: --runalways 2005-05-27 Stanislav Sinyagin * perllib/Torrus/DevDiscover/MicrosoftWindows.pm: per-interface RRD files named by MAC addresses, not interface name 2005-05-25 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoGeneric.pm: enchanced memory pools stats (line cards and VIP memory) 2005-05-23 Stanislav Sinyagin * templates/html-incblocks.txt: has-overview-subleaves replaced with has-overview-shortcuts, with multiple overviews per subtree 2005-05-20 Stanislav Sinyagin * templates/tset-list.html: Tokensets list now displays their sizes 2005-05-18 Stanislav Sinyagin * bin/ttproclist.in: New utility for generating DDX files 2005-05-17 Stanislav Sinyagin * perllib/Torrus/DataAccess.pm: improved performance by caching 2005-05-13 Stanislav Sinyagin * xmlconfig/examples/docsis-monitors.xml: DOCSIS monitoring examples * perllib/Torrus/DevDiscover/RFC2670_DOCS_IF.pm: Added DOCSIS-specific selector actions 2005-05-12 Stanislav Sinyagin * perllib/Torrus/Collector/RRDStorage.pm (updateRRD): $Torrus::Collector::RRDStorage::moveConflictRRD -- moving RRD files with conflicting structure 2005-05-11 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2670_DOCS_IF.pm: Downstream utilization added, and the subtrees rearranged. 2005-05-10 Stanislav Sinyagin * templates/default-rrd.html: Monitor names and comments displayed on the leaf HTML 2005-05-04 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoGeneric.pm: replaced CiscoGeneric::sensor-monitor and CiscoGeneric::sensor-monitor-regexp with CiscoSensor selector * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: RFC2863_IF_MIB::errors-monitor is no longer supported. Replaced with appropriate selector action * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: Implemented IF-MIB selector actions - InBytesMonitor, OutBytesMonitor, ErrorsMonitor, HoltWinters, NoPacketCounters, NoErrorCounters, Parameters 2005-05-02 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm (applySelectors): The infrastructure for object selectors 2005-04-29 Stanislav Sinyagin * perllib/Torrus/DevDiscover/CiscoGeneric.pm: New discovery parameters: CiscoGeneric::sensor-monitor, CiscoGeneric::sensor-monitor-regexp 2005-04-28 Stanislav Sinyagin * perllib/Torrus/Collector/SNMP.pm (runCollector): SO_RCVBUF is set explicitly 2005-04-09 Stanislav Sinyagin * perllib/Torrus/Renderer/RRDtool.pm (rrd_make_hrules): hrule-legend-X is now a leaf parameter, not view * templates/default-recursivedir.html: Recursive directory view 2005-04-08 Stanislav Sinyagin * bin/schedulerinfo.in: Timeline reports separate for monitors and collectors 2005-03-30 Stanislav Sinyagin * perllib/Torrus/DevDiscover/Paradyne.pm: New discovery parameter: "Paradyne::slot-name" 2005-03-22 Stanislav Sinyagin * configure.ac: New variables: plugwrapperdir, defrrddir 2005-03-09 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm (discover): Screening coli and semicoli in legend text 2005-03-08 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (discover): New device capability: 'interfaceIndexingManaged'. New DDX parameters: 'RFC2863_IF_MIB::ifindex-map-hint' and 'RFC2863_IF_MIB::subtree-name-hint'. * xmlconfig/generic/rfc2863.if-mib.xml: Moved "ifindex-table" definition from snmp-defs to IF-MIB host template * perllib/Torrus/DevDiscover.pm (discover): In the legend, replace ':' with '=' and ';' with ',' 2005-03-05 Stanislav Sinyagin * perllib/Torrus/DevDiscover.pm (oidBaseMatch): better OID comparison 2005-02-28 Stanislav Sinyagin * perllib/Torrus/Renderer.pm (newCacheFileName): MD5 to generate unique file names 2005-02-18 Stanislav Sinyagin * configure.ac (also in all plugins): AM_INIT_AUTOMAKE(1.9) instead of 1.6. The old version conflicted with plugins. 2005-01-30 Stanislav Sinyagin * doc/Makefile.am: Variable substitution in doc files * doc/manpages/Makefile.am: Man sections configurable * perllib/Torrus/DevDiscover/CiscoIOS_Docsis.pm: New discovery module for Cisco-specific DOCSIS statistics 2005-01-21 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (discover): Moved the IF-MIB discovery from checkdevtype() to discover() 2005-01-06 Stanislav Sinyagin * perllib/Torrus/DevDiscover/AxxessIT.pm: new discovery module 2005-01-04 Stanislav Sinyagin * perllib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (checkdevtype): Interface excluded when ifOperStatus=6 [notPresent] 2004-12-27 Stanislav Sinyagin * bin/devdiscover.in (absXmlFilename): output file is placed in siteXmlDir if the path is not absolute. $XMLCONFIG is still supported for the sake of compatibility. 2004-12-03 Stanislav Sinyagin * configure.ac: replaced --disable-modcheck with --enable-pkgonly 2004-11-22 Stanislav Sinyagin * NEWS: Release 0.1.8 * Started Torrus development 2004-11-02 Stanislav Sinyagin * lib/Torrus/ConfigTree/Validator.pm: New parameters: 'monitor-period', 'monitor-timeoffset' * lib/Torrus/Monitor.pm: Now monitor runs under standard Scheduler 2004-10-25 Stanislav Sinyagin * lib/Torrus/Collector.pm: Moved collector specific code from bin/collector.in. 2004-10-24 Stanislav Sinyagin * bin/acledit.in: New privilege added: DisplayAdmInfo * lib/Torrus/Renderer/AdmInfo.pm, templates/adminfo.html: First step to display administratove information. 2004-10-13 Stanislav Sinyagin * bin/collector.in, bin/monitor.in: Process name reflecting the commandline and status 2004-10-04 Stanislav Sinyagin * lib/Torrus/Renderer/RRDtool.pm (rrd_make_multigraph): New multigraph parameter: disable-gprint-X 2004-09-30 Stanislav Sinyagin * xmlconfig/generic/collector-periods.xml: Changed rrd-create-rra 2004-09-29 Stanislav Sinyagin * lib/Torrus/DevDiscover/NetScreen.pm: Changed the interface mapping from ifDescr to MAC address 2004-09-22 Stanislav Sinyagin * examples/rrdup_notify.sh: collector failure notification script 2004-09-20 Stanislav Sinyagin * lib/Torrus/Apache2Handler.pm: mod_perl 1.99_15 compatibility. Replaced Apache::ParseFormData with libapreq2. * templates/html-incblocks.txt: Added "Up" navigation tab 2004-09-02 Stanislav Sinyagin * lib/Torrus/Renderer/RRDtool.pm: New parameter: graph-disable-gprint 2004-08-27 Stanislav Sinyagin * templates/default-rrd.html: Added link to web/plain/explain-rrdgraph.html * templates/html-incblocks.txt: Moved Top and Help menu to the top of the page 2004-08-20 Stanislav Sinyagin * lib/Torrus/DevDiscover/CiscoIOS.pm (discover): New discovery parameter: CiscoIOS::disable-ipsec-stats 2004-08-16 Stanislav Sinyagin * templates/default-helptext.html: First draft of help window * bin/devdiscover.in: --snmpdebug option is no more hidden 2004-08-13 Stanislav Sinyagin * xmlconfig/vendor/cisco.ios.xml: reorganized leaves * xmlconfig/generic/rfc2863.if-mib.xml: Replaced the leaf names with user friendly ones. The old template is in old/rfc2863.if-mib.old-0.1.7.xml 2004-08-04 Stanislav Sinyagin * NEWS: Release 0.1.7 * lib/Torrus/DevDiscover/RFC2863_IF_MIB.pm: New discovery parameter: RFC2863_IF_MIB::copy-params * lib/Torrus/DevDiscover.pm: new discovery parameter: host-copy-params 2004-07-29 Stanislav Sinyagin * lib/Torrus/DevDiscover/ATMEL.pm: New discocery module from Scott Brooks 2004-07-28 Stanislav Sinyagin * lib/Torrus/Renderer/RRDtool.pm (rrd_make_holtwinters): New global variable: $Torrus::Renderer::hwGraphLegend * Disabled Holt-Winters in system performance and interface errors 2004-07-27 Stanislav Sinyagin * Torrus Demo server opened: http://torrusdemo.tbw.ch 2004-07-26 Stanislav Sinyagin * lib/Torrus/Collector.pm (setValue): DOLLAR and MOD in transform-value 2004-07-20 Stanislav Sinyagin * bin/acledit.in: Added --force option * bin/monitor.in, bin/collector.in: umask changed to 0017 2004-07-19 Stanislav Sinyagin * doc/scalability.pod: Document finished * doc/vendorsupport.pod: Vendor and MIBs support document 2004-07-13 Stanislav Sinyagin * xmlconfig/site-global.xml: New place for global parameters. In existing installations, you need to change the line in torrus-siteconfig.pl: @Torrus::Global::xmlAlwaysIncludeFirst = ( 'defaults.xml', 'site-global.xml' ); 2004-07-12 Stanislav Sinyagin * lib/Torrus/DevDiscover/NetApp.pm: new discovery module (Shawn) 2004-07-09 Stanislav Sinyagin * lib/Torrus/DevDiscover/CiscoIOS.pm: Added CISCO-IPSEC-FLOW-MONITOR-MIB 2004-07-07 Stanislav Sinyagin * lib/Torrus/Monitor.pm (run_event_exec): New environment variable: Torrus_VALUE * xmlconfig/defaults.xml: New view parameter: description 2004-07-06 Stanislav Sinyagin * templates/default-login.html, lib/Torrus/Renderer/Frontpage.pm (renderUserLogin), lib/Torrus/Apache2Handler.pm (handler), lib/Torrus/ApacheHandler.pm (handler): URL parameters (token, path, and view) are remembered during login 2004-06-30 Stanislav Sinyagin * lib/Torrus/ACL.pm (hasPrivilege): Wildcard ACL object (*) implemented 2004-06-28 Stanislav Sinyagin * Log levels updated. Now info is always printed, and verbose means verbose. 2004-06-25 Stanislav Sinyagin * xmlconfig/defaults.xml: New view name: last24h-small 2004-06-23 Stanislav Sinyagin * lib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): New discovery parameter: RFC2863_IF_MIB::errors-monitor 2004-06-22 Stanislav Sinyagin * lib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): New discovery parameter: RFC2863_IF_MIB::exclude-interfaces New discovery parameter: RFC2863_IF_MIB::tokenset-members 2004-06-21 Stanislav Sinyagin * lib/Torrus/DevDiscover/CiscoCatOS.pm (discover): New discovery parameter: CiscoCatOS::suppress-noname-ports 2004-06-16 Stanislav Sinyagin * configure.ac: For backward compatibility with autoconf 2.57, AS_HELP_STRING is replaced with obsoleted AC_HELP_STRING. Don't forget to change it back when 2.59 or later becomes mainstream. 2004-06-15 Stanislav Sinyagin * lib/Torrus/Renderer/RRDtool.pm (rrd_make_gprint): GPRINT implemented * bin/prepviews.in, bin/rrd_getdim.in: removed because no longer needed * doc/manpages/Makefile.am: commandref.pod to be replaced by manpages (contrib from Jurij Smakov) 2004-05-26 Stanislav Sinyagin * lib/Torrus/Collector.pm (setValue): transform-value parameter is now expandable * doc/devdoc/wd.distributed.pod: New working draft document 2004-05-24 Stanislav Sinyagin * webmux2.pl: Added support for mod_perl 1.99_12 (before it was 1.99_13 only) 2004-05-19 Stanislav Sinyagin * lib/Torrus/DevDiscover.pm: New parameter: custom-host-templates 2004-05-16 Stanislav Sinyagin * lib/Torrus/Collector/SNMP.pm: New parameter: 'snmp-check-sysuptime' * bin/Makefile.am: rrd_hwreapply is moved to a separate package (RRDman) 2004-05-12 Stanislav Sinyagin * Makefile.am, bin/Makefile.am: removed mkroutercfg * templates/html-incblocks.txt: Removed image width hinting 2004-05-05 Stanislav Sinyagin * lib/Torrus/SiteConfig.pm (verify): Minus sign allowed in tree names 2004-05-03 Stanislav Sinyagin * NEWS: Release 0.1.6 * ../plugins/cbqos: first release of Cisco QoS monitoring plugin * bin/rrd_getdim.in: RRDtool 1.1.x compatibility improved 2004-04-22 Stanislav Sinyagin * examples/onmsInterfaces.sh: Gustavo Torres' contribution for OpenNMS integration 2004-04-19 Stanislav Sinyagin * lib/Torrus/ConfigTree/XMLCompiler.pm: New XML statements: setvar, iftrue, iffalse 2004-04-15 Stanislav Sinyagin * lib/Torrus/RPN.pm (translate): New RPN function: MOD * xmlconfig/generic/rfc2790.host-resources.xml: More sophysticated Uptime graph (Shawn) 2004-04-14 Stanislav Sinyagin * templates/html-incblocks.txt: New items in HTML page top: siteInfo and treeInfo. * lib/Torrus/Apache2Handler.pm: First alpha release of mod_perl 2.0 handler. * doc/webintf.pod: It is recommended to Alias /torrus/plain instead of just /torrus. 2004-04-07 Stanislav Sinyagin * bin/schedulerinfo.in: New option: --clear * lib/Torrus/SchedulerInfo.pm, lib/Torrus/Scheduler.pm: reorganized statistics collection * bin/schedulerinfo.in: Only nonzero statistics are shown in runtime report * lib/Torrus/Scheduler.pm: reorganized statistics: late start increments only when that happens. Runtime longer than period is also recorded (sferry). * bin/collector.in: more verbosity in non-verbose mode (sferry) * init.torrus.in: gracefully waits for daemons to shut down (sferry) 2004-04-06 Stanislav Sinyagin * lib/Torrus/DevDiscover/RFC1697_RDBMS.pm, lib/Torrus/DevDiscover/OracleDatabase.pm: New discovery modules (sferry) * NEWS: Bugfix release 0.1.5bf2 2004-03-31 Stanislav Sinyagin * lib/Torrus/DB.pm (cursor): Bugfix for write access cursors 2004-03-26 Stanislav Sinyagin * lib/Torrus/Renderer/RRDtool.pm (rrd_make_cdef): New @-functions in RPN references: AVERAGE MIN MAX LAST (rrd_make_multigraph): New multigraph parameter: ignore-views-X * lib/Torrus/DevDiscover/CiscoGeneric.pm (buildConfig): New discovery parameter: CiscoGeneric::file-per-sensor 2004-03-25 Stanislav Sinyagin * bin/compilexml.in: New commandline option: --noval * NEWS: Bugfix release 0.1.5bf1 2004-03-24 Stanislav Sinyagin * lib/Torrus/RPN.pm: now Math::BigFloat is always used for numbers Perl 5.8.0 or higher is required: BigFloat implementation in 5.6.1 is untested and hardly compatible * lib/Torrus/Collector.pm (run): $Torrus::Collector::needsConfigTree: a new registry for those collectors needing access to configuration. 2004-03-22 Stanislav Sinyagin * Implemented Cisco class-based QoS monitoring plugin 2004-03-20 Stanislav Sinyagin * lib/Torrus/ConfigTree.pm: More parameters to be expanded: lower-limit normal-level upper-limit 2004-03-19 Stanislav Sinyagin * bin/devdiscover.in: New option: --limit=regexp 2004-03-17 Stanislav Sinyagin * NEWS: Release 0.1.5 * lib/Torrus/DB.pm (new): Unique DB environment log file per PID. 2004-03-16 Stanislav Sinyagin * bin/devdiscover.in: new parameter: output-bundle 2004-03-12 Stanislav Sinyagin * templates/overview-subleaves.html: New parameters: overview-direct-link, overview-direct-link-view 2004-03-09 Stanislav Sinyagin * lib/Torrus/DevDiscover/UcdSnmp.pm, lib/Torrus/DevDiscover/RFC2790_HOST_RESOURCES.pm, xmlconfig/vendor/ucd.ucd-snmp.xml, xmlconfig/generic/rfc2790.host-resources.xml: Rearranged the host performance templates. Fixed bug in Interrupts RRD. You need to rm /var/snmpcollector/*ucd-context_interrupts.rrd 2004-03-04 Stanislav Sinyagin * lib/Torrus/Renderer/RRDtool.pm (render_rrgraph): New configuration option: $Torrus::Renderer::ignoreDecorations 2004-03-01 Stanislav Sinyagin * xmlconfig/generic/rfc2670.docsis-if.xml: Modified DOCSIS template to include codewords statistics (data-file changed). * bin/monitor.in, bin/collector.in: Log rotation on SIGHUP 2004-02-26 Stanislav Sinyagin * xmlconfig/generic/monitors.xml: New standard monitors and actions * xmlconfig/vendor/smokeping.xml: (Shawn) Smokeping RRD files access templates * lib/Torrus/DevDiscover/NetScreen.pm: (Shawn) new discovery module * lib/Torrus/DevDiscover/CompaqCIM.pm: (Shawn) new discovery module * lib/Torrus/DevDiscover/MicrosoftWindows.pm: (Shawn) added support for IIS HTTP and FTP stats 2004-02-24 Stanislav Sinyagin * lib/Torrus/ConfigTree/Writer.pm (postProcessNodes): Dispersed collector offset 2004-02-23 Stanislav Sinyagin * lib/Torrus/ConfigTree.pm (new), lib/Torrus/ConfigTree/Writer.pm (finalize): Dual configuration database implemented * lib/Torrus/ConfigTree.pm (setReady): ConfigurationReady flag moved to other_config.db. 2004-02-18 Stanislav Sinyagin * lib/Torrus/Renderer/RRDtool.pm: view parameter "title" removed. New node parameter: "graph-title" 2004-02-16 Stanislav Sinyagin * lib/Torrus/Renderer/RRDtool.pm (rrd_make_decorations): Implemented back- and foreground decorations (Christian's Change 7, modified) 2004-02-14 Stanislav Sinyagin * lib/Torrus/ConfigTree.pm (getNodeParam): Optimized nodepcache structure * lib/Torrus/ConfigTree/Writer.pm (newToken): Next free token is no longer stored in database 2004-02-13 Stanislav Sinyagin * lib/Torrus/DevDiscover.pm (buildConfig): New parameter: host-aliases * lib/Torrus/Collector.pm (setValue): New parameter: transform-value 2004-02-12 Stanislav Sinyagin * xmlconfig/snmp-defs.xml, xmlconfig/*/*.xml: data-file refers now to system-id, instead of snmp-host. * lib/Torrus/DevDiscover.pm (buildConfig): symbolic-name is no longer mandatory. New parameter: system-id. 2004-02-11 Stanislav Sinyagin * lib/Torrus/DB.pm (new): DB internal errors are stored in var/log/dbenv_errlog 2004-02-05 Stanislav Sinyagin * lib/Torrus/ConfigTree.pm (expandNodeParam): $Torrus::ConfigTree::nodeParamHook: hook for custom parameter processing 2004-02-03 Stanislav Sinyagin * lib/Torrus/Renderer/RRDtool.pm: Restructured the whole grapher. 2004-02-02 Stanislav Sinyagin * lib/Torrus/Renderer.pm: Split one big module into 4 smaller ones: Torrus::Renderer, Torrus::Renderer::HTML, Torrus::Renderer::RRDtool, Torrus::Renderer::Frontpage * lib/Torrus/DevDiscover.pm (discover): New discovery parameter: only-devtypes 2004-01-30 Stanislav Sinyagin * lib/Torrus/DevDiscover.pm (discover): New discovery parameter: disable-devtypes * lib/Torrus/DevDiscover.pm (discover): Better treatment for agents without "system" OIDs. 2004-01-21 Stanislav Sinyagin * lib/Torrus/DevDiscover.pm (discover): Now snmp-oids-per-pdu may be defined from discovery parameters. * bin/schedulerinfo.in: Scheduler runtime statistics report 2004-01-20 Stanislav Sinyagin * lib/Torrus/Scheduler.pm: runtime statistics stored in a database 2004-01-15 Stanislav Sinyagin * lib/Torrus/DevDiscover.pm (discover): 'collector-period' and 'collector-timeoffset' can be specified in devdiscover input * Makefile.am: Now DIST_REVISION file in the distribution package tells the distribution revision date * lib/Torrus/Collector.pm: listTargets() is replaced with listCollectorTargets() with collector type as argument 2004-01-14 Stanislav Sinyagin * lib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): Split iftable-errors template into input and output (some Cisco ATM aal5 interfaces dont have both in and out error counters) * doc/devdoc/wd.gprint-and-cf-plot.pod: New design draft from Christian Schnidrig * lib/Torrus/RPN.pm: Slight reorganisation and better fault control * doc/userguide.pod: New in Tips: Several Torrus instances on one server 2004-01-13 Stanislav Sinyagin * lib/Torrus/ConfigTree.pm (token), lib/Torrus/ConfigTree/Writer.pm (setAlias), lib/Torrus/DB.pm (getBestMatch): Recursive alias expansion. New database: aliases.db. configsnapshot is no more compatible with previous releases' database. 2004-01-12 Stanislav Sinyagin * lib/Torrus/ConfigTree.pm (getAliases): Improved logics for aliases. Needs database recompilation. 2004-01-09 Stanislav Sinyagin * bin/schedulerinfo.in: New utility for scheduler analysis 2004-01-08 Stanislav Sinyagin * xmlconfig/old/rfc1213.xml: Moved from xmlconfig/generic/rfc1213.xml * templates/html-incblocks.txt: cssoverlay property * bin/configsnapshot.in: Ready for tests * lib/Torrus/DevDiscover/RFC2737_ENTITY_MIB.pm (discover): Chassis desription is put into host-level comment 2004-01-07 Stanislav Sinyagin * bin/configsnapshot.in: first step towards a snapshot utility * xmlconfig/vendor/cisco.generic.xml: New template: cisco-temperature-sensor-fahrenheit * xmlconfig/generic/collector-periods.xml: Changed XFF the same way as in snmp-defs.xml. Added Holt-Winters parameters to 1-minute interval. * xmlconfig/snmp-defs.xml: Changed XFF in default RRAs: 1 missing sample is allowed in half-hour average, and 1 missing hour is allowed in daily average. * lib/Torrus/Collector/SNMP.pm (initTargetAttributes): New parameter: snmp-object-type 2004-01-06 Stanislav Sinyagin * xmlconfig/generic/rfc2662.adsl-line.xml: Reduced number of RRD files * xmlconfig/vendor/cisco.generic.xml: Moved buffer statistics into a single RRD file * xmlconfig/generic/rfc2863.if-mib.xml: Reorganized RRD data structure. Significantly reduced number of files. 2004-01-05 Stanislav Sinyagin * bin/genlist.in: New utility for data listing 2003-12-31 Stanislav Sinyagin * lib/Torrus/DevDiscover/RFC2737_ENTITY_MIB.pm: New discovery module * lib/Torrus/DevDiscover/CiscoGeneric.pm: CPU enties mapped against ENTITY-MIB names 2003-12-30 Stanislav Sinyagin * bin/devdiscover.in: $XMLCONFIG substitution 2003-12-29 Stanislav Sinyagin * xmlconfig/generic/rfc2863.if-mib.xml: Moved ifindex-map to host level 2003-12-28 Stanislav Sinyagin * lib/Torrus/DevDiscover/CiscoGeneric.pm, xmlconfig/vendor/cisco.generic.xml: Reorganized CPU and Memory pool statistics. * lib/Torrus/DevDiscover/CiscoFirewall.pm: New discovery module * lib/Torrus/DevDiscover/F5BigIp.pm: New discovery module for F5 BigIp Load Balancer 2003-12-24 Stanislav Sinyagin * xmlconfig/old/snmp-defs.old-0.1.2.xml: Moved from generic/ to old/ * xmlconfig/old/rfc2863.if-mib.old-0.1.4.xml: Saved the file from previous version. 2003-12-22 Stanislav Sinyagin * lib/Torrus/DevDiscover/Xylan.pm: New discovery module for Alcatel (Xylan) OmniSwitch * lib/Torrus/DevDiscover/AscendMax.pm: New discovery module for Ascend (Lucent) MAX 2003-12-21 Stanislav Sinyagin * lib/Torrus/DevDiscover/CiscoIOS.pm (checkdevtype): Use CISCO-IMAGE-MIB::ciscoImageTable for more strict IOS-based product detection 2003-12-18 Stanislav Sinyagin * lib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): Vendor templates for interface counters taken from @{$interface->{'vendor_templates'}} * lib/Torrus/DB.pm (new): Berkeley db-4.2 compatibility 2003-12-17 Stanislav Sinyagin * xmlconfig/vendor/empire.systemedge.xml: Data structure and templates changed for better flexibility and system support * bin/devdiscover.in, bin/genddx.in: Output file is now controlled from DDX parameter 'output-file'. 2003-12-15 Stanislav Sinyagin * lib/Torrus/DevDiscover/MicrosoftWindows.pm: Moved MicrosoftWindowsServer.pm to MicrosoftWindows 2003-12-14 Stanislav Sinyagin * lib/Torrus/DevDiscover/MicrosoftWindowsServer.pm: New discovery module for Windows2000/XP SNMP agent 2003-12-13 Stanislav Sinyagin * xmlconfig/generic/rfc2863.if-mib.xml: Replaced $IFIDX with %ifindex-map% Split template iftable-discards into iftable-discards-in and iftable-discards-out. For some devices, /var/snmpcollector/*_discards.rrd need to be deleted, and devdiscover re-launched 2003-12-11 Stanislav Sinyagin * templates/default-tset.html, xmlconfig/generic/rfc2863.if-mib.xml: New parameter: descriptive-nickname 2003-12-10 Stanislav Sinyagin * NEWS: Release 0.1.4 * devdiscover-config.pl: Commented out "RFC2662_ADSL_LINE" and "Paradyne" (need more testing) 2003-12-08 Stanislav Sinyagin * templates/*, web/plain/*.css: more flexible CSS layout 2003-12-04 Stanislav Sinyagin * lib/Torrus/Renderer.pm (do_render_rrdgraph): New parameter: graph-rigid-boundaries 2003-12-01 Stanislav Sinyagin * lib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (discover): New discovery option: RFC2863_IF_MIB::suppress-hc-counters 2003-11-28 Stanislav Sinyagin * bin/devdiscover.in: now it accepts XML input only * bin/genddx.in: New utility for next-generation devdiscover * lib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): interface counters moved to a separate subtree 2003-11-25 Stanislav Sinyagin * lib/Torrus/Renderer.pm (do_render_rrdgraph): New parameter: graph-logarithmic 2003-11-23 Stanislav Sinyagin * lib/Torrus/DevDiscover/EmpireSystemedge.pm: new discovery module 2003-11-22 Stanislav Sinyagin * lib/Torrus/DevDiscover.pm (clearCap): capability clearing needed for Empire Sysedge 2003-11-18 Stanislav Sinyagin * xmlconfig/generic/rfc2863.if-mib.xml: templates interface-counters and hc-interface-counters removed New templates: read-iftable-octets, read-ifxtable-hcoctets 2003-11-11 Stanislav Sinyagin * web/plain/torrus.css: Increased maximum node name length to 25 symbols * lib/Torrus/DevDiscover/CiscoGeneric.pm: moved memory, cpu, and temperature statistics to a common module, shared by IOS and CatOS * lib/Torrus/DevDiscover/CiscoCatOS.pm (discover): interface comments are now derived from CISCO-STACK-MIB::portName 2003-11-10 Stanislav Sinyagin * xmlsup/extract-skeleton.xsl: XSLT template for tree structure extraction * bin/configinfo.in: New utility * bin/devdiscover.in: New options: --retries and --timeout * lib/Torrus/DevDiscover/CiscoCatOS.pm: Interface filters for CatOS 2003-11-09 Stanislav Sinyagin * lib/Torrus/ConfigBuilder.pm (addStatistics): congfiguration statistics * lib/Torrus/DevDiscover/CiscoIOS.pm: Interface filters for IOS devices * lib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (discover): Implemented generic interface filtering 2003-11-07 Stanislav Sinyagin * xmlconfig/generic/rfc2863.if-mib.xml: rrd-create-max=1e15 for HC packet and octets counters * lib/Torrus/DevDiscover/RFC2863_IF_MIB.pm (buildConfig): New interface counters: iftable-discards 2003-11-05 Stanislav Sinyagin * New devdiscover modules: "RFC2662_ADSL_LINE" and "Paradyne" 2003-11-04 Stanislav Sinyagin * lib/Torrus/Collector/SNMP.pm (initTarget): New parameter: snmp-oids-per-pdu 2003-11-03 Stanislav Sinyagin * NEWS: Release 0.1.3 * doc/, doc/devdoc/: Documentation is reorganized. Developer documentation is separated from User docs. 2003-10-31 Stanislav Sinyagin * templates/overview-subleaves.html: Replacement for InOutBps. New parameters: has-overview-subleaves, overview-subleave-name, overview-shortcut-text, overview-shortcut-title, overview-page-title 2003-10-30 Stanislav Sinyagin * lib/Torrus/DevDiscover/CiscoIOS_SAA.pm: New discovery module 2003-10-29 Stanislav Sinyagin * lib/Torrus/Renderer.pm (do_render_rrdgraph): New parameter: rrd-scaling-base (new): cache initialization optimized 2003-10-28 Stanislav Sinyagin * doc/devdiscover_devguide.pod: new Device Discovery Developer's Guide 2003-10-27 Stanislav Sinyagin * lib/Torrus/DevDiscover/RFC2790_HOST_RESOURCES.pm: New Host resources MIB discovery module 2003-10-26 Stanislav Sinyagin * examples/setmonitor.xupdate.xml: XUpdate technique to update autogenerated files. Described in userguide.pod. 2003-10-24 Stanislav Sinyagin * xmlconfig/generic/rfc2863.if-mib.xml: New names for interace counter RRD files: host_intf_octets.rrd, host_intf_packets.rrd, etc. * xmlconfig/snmp-defs.xml: data-file and data-dir are no longer defined in snmp-defaults. * xmlconfig/generic/rfc2863.if-mib.xml: Broke interface counter templates into smaller parts. New counters template: "iftable-errors". * xmlconfig/snmp-defs.xml: Moved interface counters to generic/rfc2863.if-mib.xml 2003-10-21 Stanislav Sinyagin * New ACL user and group attribute: "modified" 2003-10-20 Stanislav Sinyagin * lib/Torrus/DevDiscover.pm (genDataDir): data-dir hash implemented * bin/devdiscover.in: Default subtree is now /Routers. Alternative device names may be given as host:devname * xmlconfig/: Vendor and generic templates from Shawn Ferry 2003-10-19 Stanislav Sinyagin * Shawn Ferry's contribution on styling profiles, with recursive color references 2003-10-18 Stanislav Sinyagin * lib/Torrus/ConfigTree/XMLCompiler.pm (compile): directives are now processed recursively, before any other processing. 2003-10-17 Stanislav Sinyagin * xmlconfig/snmp-defs.xml: Replaced subtree /SNMP with template Moved old version to generic/snmp-defs.old-0.1.2.xml 2003-10-15 Stanislav Sinyagin * bin/devdiscover.in: First proof of concept version of a new modular device discovery tool 2003-10-14 Stanislav Sinyagin * NEWS: Release 0.1.2 * lib/Torrus/ConfigTree/Writer.pm (addChild): Nodes longer than 20 characters are reported with warning. 2003-10-13 Stanislav Sinyagin * xmlconfig: New vendor files: vendor/ascend.max.xml, examples/ascend.max.xml, generic/rfc2670.docsis-if.xml * doc/userguide.pod, xmlconfig/examples/servers.data, xmlconfig/examples/servers.tmpl: New approach in automatic config generation. 2003-10-12 Stanislav Sinyagin * bin/mkroutercfg.in (retrieveSnmpData): VLAN interfaces are excluded from the list of discovered interfaces. 2003-10-09 Stanislav Sinyagin * lib/Torrus/ConfigTree/Writer.pm (propagateViewParams): Moved view parameter inheritance from XML compiler to Writer post-processing 2003-10-07 Stanislav Sinyagin * lib/Torrus/Renderer.pm (do_render_rrdgraph): New view parameters: ignore-limits, ignore-lower-limit, ignore-upper-limit * bin/cleanup.in: Cronjob for cleaning up diskspace. * lib/Torrus/Renderer.pm (do_render_rrdgraph): New parameters: graph-lower-limit, graph-upper-limit 2003-10-06 Stanislav Sinyagin * styling/torrus-original.pl: Styling profiles implemented 2003-10-04 Stanislav Sinyagin * lib/Torrus/Renderer.pm: New parameter: vertical-label 2003-09-30 Stanislav Sinyagin * lib/Torrus/Renderer.pm (do_render_rrdgraph): Added HRULE handling 2003-09-29 Stanislav Sinyagin * lib/Torrus/Renderer.pm (render_html): Added current time in HTML output 2003-09-18 Stanislav Sinyagin * lib/Torrus/Scheduler.pm: VmWare clock support 2003-09-17 Stanislav Sinyagin * lib/Torrus/Monitor.pm (setAlarm): New parameter: monitor-action-target 2003-09-14 Stanislav Sinyagin * NEWS: Release 0.1.1 2003-09-13 Stanislav Sinyagin * lib/Torrus/ConfigTree.pm: %Torrus::ConfigTree::expand_params now contains parameters for expansion * lib/Torrus/ConfigTree/Writer.pm: %Torrus::ConfigTree::Writer::remove_space now contains parameters for space removal * lib/Torrus/Collector.pm (addTarget): New parameter: value-map * configure.ac: New configure variable: torrus_user. torrus_var default value changed from root to torrus 2003-09-09 Stanislav Sinyagin * init.torrus.in: New launcher for multi-tree support. FreeBSD 5.1 gives weird error without "&" in launching command. Needs testing on other systems. 2003-09-07 Stanislav Sinyagin * Monitor event "throw" changed to "set" 2003-09-05 Stanislav Sinyagin * lib/Torrus/ACL/Import.pm, lib/Torrus/ACL/Export.pm: ACL import/export utilities * bin/aclfixup.in: Temporary utility to convert ACL database to the new format. * lib/Torrus/ACL/Edit.pm: ACL Database structure changed: added "uA:" lists 2003-09-03 Stanislav Sinyagin * lib/Torrus/RPN.pm: Got use of use Math::BigFloat, as suggested by Christian. * xmlconfig/snmp-defs.xml: Changed xff to 0.5, as recommended by rodrigo.cunha at corp.vodafone.pt * lib/Torrus/DB.pm: Database handles are held in a pool and reused 2003-09-02 Stanislav Sinyagin * Added user authentication: lib/Torrus/ACL*, bin/acledit, Apache handler * Multiple trees support as described in Requirements 0.1 2003-08-26 Stanislav Sinyagin * lib/Torrus/Collector/SNMP.pm: Moved the validator parameters to a separate module 2003-08-07 Stanislav Sinyagin * xmlconfig/defaults.xml: Tokenset views expiry time changed from 300 to 60 * lib/Torrus/Renderer.pm (checkAndClearCache): Renderer cache is cleared at least once a day * webmux.pl: New Apache init script. DB environment is now correctly destroyed 2003-08-06 Stanislav Sinyagin * mibs/Torrus-MIB.txt: Added DS tree name to Monitor action exec and helper programs * web/plain/torrus.css: Replaced
with display:block in current path * height-hint parameter is removed. * templates/routercfg.xml: Fixed the subtree deepness bug for temperature sensors. * First steps towards version 0.1: Multiple trees and database split are implemented. 2003-08-04 Stanislav Sinyagin * NEWS: Release 0.0.20 2003-07-31 Stanislav Sinyagin * lib/Torrus/Renderer.pm: added $Torrus::Renderer::rendererURL and $Torrus::Renderer::plainURL 2003-07-29 Stanislav Sinyagin * templates/html-incblocks.txt: Absolute URL for CSS stylesheet * lib/Torrus/Collector/SNMP.pm: multiple ports and SNMP communities per IP address. 2003-07-23 Stanislav Sinyagin * templates/routercfg.xml: moved snmp-community and other parameters to a host-level subtree 2003-07-17 Stanislav Sinyagin * SNMP Agent reload and unavailable handling 2003-07-15 Stanislav Sinyagin * bin/mkroutercfg.in, templates/*, lib/Torrus/Renderer.pm: Bugs item #747893 resolved. 2003-07-02 Stanislav Sinyagin * bin/mkroutercfg.in (reportResults), templates/routercfg.xml: Legend is now XML-escaped 2003-07-01 Stanislav Sinyagin * NEWS: Release 0.0.19 2003-06-26 Stanislav Sinyagin * xmlconfig/snmp-defs.xml, lib/Torrus/Collector/RRDStorage.pm, lib/Torrus/ConfigTree/Validator.pm: typo fixed: rrd-create-heartbit changed to rrd-create-heartbeat * xmlconfig/snmp-defs.xml: as proposed by Christian Schnidrig, rrd-create-heartbeat changed from 1800 to 500 2003-06-10 Stanislav Sinyagin * bin/mkroutercfg.in (reportResults), templates/routercfg.xml: SNMP version bugfix * configure.ac: Now most of the directory names are configurable 2003-05-18 Stanislav Sinyagin * lib/Torrus/Renderer.pm (render): Bug #735753 (Christian Schnidrig) fixed * bin/mkroutercfg.in, templates/routercfg.xml: Marc Haber's patch for deeper subtrees * torrus-config.pl: added @Torrus::ConfigTree::XMLCompiler::listparams 2003-05-01 Stanislav Sinyagin * lib/Torrus/Collector/SNMP.pm: SNMP-specific config validator is now within the module. * lib/Torrus/ConfigTree/Validator.pm: Additional validation parameters are read from @Torrus::Validator::loadLeafValidators * lib/Torrus/Collector.pm: Collector modules are loaded from @Torrus::Collector::loadModules 2003-04-02 Stanislav Sinyagin * NEWS: Release 0.0.18 2003-03-31 Stanislav Sinyagin * xmlconfig/defaults.xml: New parameter: rrgraph-views 2003-03-30 * xmlconfig/Makefile.am: Added Cisco MAC accounting 2003-03-27 Stanislav Sinyagin * lib/Torrus/Renderer.pm and temlates: reorganized Holt-Winters views 2003-03-25 Stanislav Sinyagin * torrus-config.pl: Moved monitor parameters from siteconfig to default config. 2003-03-21 Stanislav Sinyagin * NEWS: Release 0.0.17 * web/plain/torrus-printer.css: Finalized the printer-friendly layout 2003-03-17 Stanislav Sinyagin * init.torrus.in: now running under user "torrus" 2003-03-15 Stanislav Sinyagin * configure.ac: Changed the group to "torrus"; init.torrus is more universal 2003-03-15 Stanislav Sinyagin * lib/Torrus/Renderer.pm, lib/Torrus/ApacheHandler.pm: optimized Renderer to reuse Template processor in mod_perl 2003-03-15 Stanislav Sinyagin * web/plain/torrus.css: New HTML layout 2003-03-11 Stanislav Sinyagin * xmlconfig/Makefile.am (dist_examples_DATA): Moved apcups-example.xml to apc-ups.xml. Added hpux.xml * bin/rrd_getdim.in, bin/prepviews.in, xmlconfig/Makefile.am: "make install prefix=/some/path" now works correctly. * lib/Bundle/Torrus.pm: Perl bundle for easy installation 2003-03-04 Stanislav Sinyagin * NEWS: Release 0.0.16 * lib/Torrus/Renderer.pm (do_render_rrdgraph): Fixed TICK bug * xmlconfig/vendor/hp.hpux.xml: New definitions file from Aaron Bush * xmlconfig/vendor/apc.ups.xml: * xmlconfig/examples/apcups-example.xml: Merged the several templates into one. 2003-03-03 Stanislav Sinyagin * Makefile.am: added torrus-config.dtd to distribution * xmlsup/torrus-config.dtd: The configuration DTD first cut 2003-03-02 * Makefile.am (dist_mibs_DATA): Moved mibs from lib to share 2003-03-01 Stanislav Sinyagin * bin/mkroutercfg.in (reportResults): Added vendor/cisco.ios.xml chekup * xmlconfig/examples/apcups-defs.xml: moved to xmlconfig/vendor/apc.ups.xml * xmlconfig/examples/snmp-view.xml: moved contents into xmlconfig/vendor/cisco.ios.xml * xmlconfig/snmp-defs.xml: Moved Cisco specifics to xmlconfig/vendor/cisco.ios.xml * xmlconfig/Makefile.am: snmp-defs.xml is not any more preserved * configure.ac, Makefile.am: added plugin functionality 2003-02-27 Stanislav Sinyagin * lib/Torrus/Renderer.pm (render_html), lib/Torrus/ApacheHandler.pm (handler), web/grapher.cgi.in: Fixed the non-ASCII display problem. Also XML-LibXML-1.54_3 is required. 2003-02-26 Stanislav Sinyagin * NEWS: Release 0.0.15 * xmlconfig/examples/apcups-defs.xml: * xmlconfig/examples/apcups-example.xml: Added APC UPS example configurations * lib/Torrus/Collector/RRDStorage.pm (updateRRD): Reverted to a more promiscious code, because the memory problem persists with perl 5.8. 2003-02-20 Stanislav Sinyagin * NEWS: Release 0.0.14 2003-02-10 Stanislav Sinyagin * lib/Torrus/ConfigTree/Writer.pm: fixed bug with parameter cache 2003-01-29 Stanislav Sinyagin * bin/mkroutercfg.in: fixed the exit code bug 2003-01-24 Stanislav Sinyagin * xmlconfig/Makefile.am: added xmlconfig/examples/snmp-view.xml * lib/Torrus/ConfigTree/XMLCompiler.pm, bin/compilexml.in: added XML statement 2003-01-20 Stanislav Sinyagin * NEWS: Release 0.0.13 * bin/compilexml.in, bin/collector.in, bin/monitor.in: Added signal handlers for more graceful database closing. 2003-01-13 Stanislav Sinyagin * lib/Torrus/ConfigTree.pm: Now compiler waits for readers to finish. 2003-01-08 Stanislav Sinyagin * lib/Torrus/ConfigTree.pm: implemented ConfigurationReady checkup * lib/Torrus/ApacheHandler.pm, web/grapher.cgi.in: more user friendly error reporting 2003-01-05 Stanislav Sinyagin * xmlconfig/snmp-defs.xml: Added InOutBps leaf to the templates. Affected files: xmlconfig/defaults.xml, templates/routercfg.xml, templates/default-dir.html, templates/inout-leaves.html 2003-01-03 Stanislav Sinyagin * xmlconfig/snmp-defs.xml: Added graph-legend parameters 2003-01-02 Stanislav Sinyagin * xmlconfig/Makefile.am: moved XML examples to a separate directory * implemented 'rrd-multigraph' * changed ds-type RRDfile to rrd-file 2002-09-10 Stanislav Sinyagin * Release 0.0.5 published. Everything except SNMP data collector is ready to run. 2002-08-12 Stanislav Sinyagin * Reorganized a lot of things. First cut of monitor is runnable. 2002-07-19 Stanislav Sinyagin * Implemented Holt-Winters support 2002-07-18 Stanislav Sinyagin * Reorganized ConfigTree and implemented tokens torrus-3.00/systemd/0000755000175000017500000000000013131663306011465 500000000000000torrus-3.00/systemd/torrus.service.in0000644000175000017500000000044713131655331014736 00000000000000[Unit] Description=Torrus collector and monitor daemons [Service] Type=forking ExecStart=@pkgbindir@/launcher --cmd=start ExecStop=@pkgbindir@/launcher --cmd=stop GuessMainPID=false TimeoutSec=45s Restart=no KillMode=control-group User=root Group=daemon [Install] WantedBy=multi-user.target torrus-3.00/systemd/torrus.tmpfile.in0000644000175000017500000000004713131655331014732 00000000000000d @piddir@ 0755 @var_user@ @var_group@ torrus-3.00/DIST_REVISION0000644000175000017500000000012113131663307011714 00000000000000Thu Jul 13 14:25:43 CEST 2017 * master 8be3311 [origin/master] installer cleanup torrus-3.00/configure0000755000175000017500000040423513131655450011635 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for torrus 3.00. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: ssinyagin@users.sourceforge.net about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='torrus' PACKAGE_TARNAME='torrus' PACKAGE_VERSION='3.00' PACKAGE_STRING='torrus 3.00' PACKAGE_BUGREPORT='ssinyagin@users.sourceforge.net' PACKAGE_URL='' ac_subst_vars='LTLIBOBJS LIBOBJS defrrddir mansec_misc mansec_usercmd wrapperdir sesstordir seslockdir reportsdir gitrepodir varprefix piddir logdir sitexmldir tmpluserdir siteconfdir sitedir distxmldir tmpldir webscriptsdir webplaindir supdir scriptsdir plugwrapperdir plugdevdisccfgdir plugtorruscfgdir pluginsdir perllibdir exmpdir pkgdocdir cfgdefdir pkgbindir pkghome enable_varperm var_mode var_group var_user torrus_user perllibdirs PERLINC enable_pkgonly POD2MAN_PRESENT_FALSE POD2MAN_PRESENT_TRUE POD2MAN POD2TEXT_PRESENT_FALSE POD2TEXT_PRESENT_TRUE POD2TEXT GIT SLEEP RM FIND SED KILL SU PERLCRITIC PERL AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_pkgonly with_rrdtool enable_varperm ' ac_precious_vars='build_alias host_alias target_alias PERLINC torrus_user var_user var_group var_mode pkghome pkgbindir cfgdefdir pkgdocdir exmpdir perllibdir pluginsdir plugtorruscfgdir plugdevdisccfgdir plugwrapperdir scriptsdir supdir webplaindir webscriptsdir tmpldir distxmldir sitedir siteconfdir tmpluserdir sitexmldir logdir piddir varprefix gitrepodir reportsdir seslockdir sesstordir wrapperdir mansec_usercmd mansec_misc defrrddir' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures torrus 3.00 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/torrus] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of torrus 3.00:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-pkgonly Skip all checking --disable-varperm Disable directory access rights tuning Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rrdtool=DIR RRDTool location Some influential environment variables: PERLINC [] Additional space-separated Perl library paths torrus_user [torrus] UID to run the daemons var_user [TORRUS_USER] Owner of writable directories var_group [torrus] Group of writable directories var_mode [775] Mode of writable directories pkghome [PREFIX/torrus] Place for Torrus static files pkgbindir [PKGHOME/bin] Torrus executables cfgdefdir [PKGHOME/conf_defaults] torrus-config.pl and others pkgdocdir [PKGHOME/doc] Documentation files exmpdir [PKGHOME/examples] Examples perllibdir [PKGHOME/perllib] Torrus Perl libraries pluginsdir [PKGHOME/plugins] Plugin configurations plugtorruscfgdir [PLUGINSDIR/torrus-config] plugdevdisccfgdir [PLUGINSDIR/devdiscover-config] plugwrapperdir [PLUGINSDIR/wrapper] scriptsdir [PKGHOME/scripts] Script files supdir [PKGHOME/sup] Supplementary files webplaindir [SUPDIR/webplain] Web interface plain files path webscriptsdir [SUPDIR/webscripts] Directory for optional web scripts tmpldir [PKGHOME/templates] Template files distxmldir [PKGHOME/xmlconfig] Distribution XML config files sitedir [SYSCONFDIR/torrus] Site configuration files siteconfdir [SITEDIR/conf] Site configuration files tmpluserdir [SITEDIR/templates] User-defined Template files sitexmldir [SITEDIR/xmlconfig] Site XML configs logdir [/var/log/torrus] Log files piddir [/var/run/torrus] PID files varprefix [/var/torrus] Common prefix for runtime data gitrepodir [VARPREFIX/gitrepo] git repository dir reportsdir [VARPREFIX/reports] Reports output seslockdir [VARPREFIX/session_data/lock] Web session locks sesstordir [VARPREFIX/session_data/store] Web session storage wrapperdir [BINDIR] CLI wrapper mansec_usercmd [1] User commands man section mansec_misc [7] Miscellaneous man section defrrddir [/srv/torrus/collector_rrd] Default RRD storage path Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF torrus configure 3.00 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by torrus $as_me 3.00, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in conftools "$srcdir"/conftools; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in conftools \"$srcdir\"/conftools" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='torrus' VERSION='3.00' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "perlcritic", so it can be a program name with args. set dummy perlcritic; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERLCRITIC+:} false; then : $as_echo_n "(cached) " >&6 else case $PERLCRITIC in [\\/]* | ?:[\\/]*) ac_cv_path_PERLCRITIC="$PERLCRITIC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERLCRITIC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERLCRITIC" && ac_cv_path_PERLCRITIC="no" ;; esac fi PERLCRITIC=$ac_cv_path_PERLCRITIC if test -n "$PERLCRITIC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERLCRITIC" >&5 $as_echo "$PERLCRITIC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Need this for init.torrus # Extract the first word of "su", so it can be a program name with args. set dummy su; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SU+:} false; then : $as_echo_n "(cached) " >&6 else case $SU in [\\/]* | ?:[\\/]*) ac_cv_path_SU="$SU" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SU="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_SU" && ac_cv_path_SU="no" ;; esac fi SU=$ac_cv_path_SU if test -n "$SU"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SU" >&5 $as_echo "$SU" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "kill", so it can be a program name with args. set dummy kill; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_KILL+:} false; then : $as_echo_n "(cached) " >&6 else case $KILL in [\\/]* | ?:[\\/]*) ac_cv_path_KILL="$KILL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_KILL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_KILL" && ac_cv_path_KILL="no" ;; esac fi KILL=$ac_cv_path_KILL if test -n "$KILL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KILL" >&5 $as_echo "$KILL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_SED" && ac_cv_path_SED="no" ;; esac fi SED=$ac_cv_path_SED if test -n "$SED"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 $as_echo "$SED" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "find", so it can be a program name with args. set dummy find; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_FIND+:} false; then : $as_echo_n "(cached) " >&6 else case $FIND in [\\/]* | ?:[\\/]*) ac_cv_path_FIND="$FIND" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_FIND" && ac_cv_path_FIND="no" ;; esac fi FIND=$ac_cv_path_FIND if test -n "$FIND"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIND" >&5 $as_echo "$FIND" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_RM+:} false; then : $as_echo_n "(cached) " >&6 else case $RM in [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_RM" && ac_cv_path_RM="no" ;; esac fi RM=$ac_cv_path_RM if test -n "$RM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 $as_echo "$RM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "sleep", so it can be a program name with args. set dummy sleep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SLEEP+:} false; then : $as_echo_n "(cached) " >&6 else case $SLEEP in [\\/]* | ?:[\\/]*) ac_cv_path_SLEEP="$SLEEP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SLEEP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_SLEEP" && ac_cv_path_SLEEP="no" ;; esac fi SLEEP=$ac_cv_path_SLEEP if test -n "$SLEEP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SLEEP" >&5 $as_echo "$SLEEP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "git", so it can be a program name with args. set dummy git; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GIT+:} false; then : $as_echo_n "(cached) " >&6 else case $GIT in [\\/]* | ?:[\\/]*) ac_cv_path_GIT="$GIT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GIT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GIT" && ac_cv_path_GIT="no" ;; esac fi GIT=$ac_cv_path_GIT if test -n "$GIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 $as_echo "$GIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # This will generate doc pages from POD sources # Extract the first word of "pod2text", so it can be a program name with args. set dummy pod2text; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_POD2TEXT+:} false; then : $as_echo_n "(cached) " >&6 else case $POD2TEXT in [\\/]* | ?:[\\/]*) ac_cv_path_POD2TEXT="$POD2TEXT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_POD2TEXT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_POD2TEXT" && ac_cv_path_POD2TEXT="no" ;; esac fi POD2TEXT=$ac_cv_path_POD2TEXT if test -n "$POD2TEXT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POD2TEXT" >&5 $as_echo "$POD2TEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$POD2TEXT" != no; then POD2TEXT_PRESENT_TRUE= POD2TEXT_PRESENT_FALSE='#' else POD2TEXT_PRESENT_TRUE='#' POD2TEXT_PRESENT_FALSE= fi # Extract the first word of "pod2man", so it can be a program name with args. set dummy pod2man; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_POD2MAN+:} false; then : $as_echo_n "(cached) " >&6 else case $POD2MAN in [\\/]* | ?:[\\/]*) ac_cv_path_POD2MAN="$POD2MAN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_POD2MAN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_POD2MAN" && ac_cv_path_POD2MAN="no" ;; esac fi POD2MAN=$ac_cv_path_POD2MAN if test -n "$POD2MAN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POD2MAN" >&5 $as_echo "$POD2MAN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$POD2MAN" != no; then POD2MAN_PRESENT_TRUE= POD2MAN_PRESENT_FALSE='#' else POD2MAN_PRESENT_TRUE='#' POD2MAN_PRESENT_FALSE= fi # Check whether --enable-pkgonly was given. if test "${enable_pkgonly+set}" = set; then : enableval=$enable_pkgonly; fi perllibdirs="\'\${perllibdir}\'" PERLOPTS= if test ! -z "$PERLINC"; then for d in $PERLINC; do PERLOPTS="${PERLOPTS} -I${d}" perllibdirs=${perllibdirs}"\,\'"${d}"\'" done fi find_rrdtool () { if ${PERL} -e 'use RRDs' 2>/dev/null; then :; else if test "$enable_pkgonly" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: RRDs.pm is not in default Perl search paths." >&5 $as_echo "$as_me: RRDs.pm is not in default Perl search paths." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: checking RRDtool in /usr/local/rrdtool*" >&5 $as_echo_n "checking RRDtool in /usr/local/rrdtool*... " >&6; } with_rrdtool=`ls -1dr /usr/local/rrdtool* | head -1` if test -d $with_rrdtool; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_rrdtool}" >&5 $as_echo "${with_rrdtool}" >&6; } else as_fn_error $? "Cannot find RRDtool" "$LINENO" 5 fi test_rrdtool else with_rrdtool="/usr/local/rrdtool" fi fi } test_rrdtool () { if test "$enable_pkgonly" != yes; then if ${PERL} -I${with_rrdtool}/lib/perl -e 'use RRDs'; then :; else as_fn_error $? "Could not find RRDs perl module in ${with_rrdtool}" "$LINENO" 5 fi fi perllibdirs=${perllibdirs}"\,\'"${with_rrdtool}"/lib/perl/\'" } # Check whether --with-rrdtool was given. if test "${with_rrdtool+set}" = set; then : withval=$with_rrdtool; test_rrdtool else find_rrdtool fi perllibdirs=${perllibdirs} # Check the necessary Perl modules if test "$enable_pkgonly" != yes; then if test ${GIT} = no; then as_fn_error $? "Git executable is required" "$LINENO" 5 fi for module in 'Redis::Fast' \ 'Git::Raw 0.72' 'Git::ObjectStore 0.007' \ 'Cache::Ref' \ 'XML::LibXML' 'Template' \ 'Proc::Daemon' 'Net::SNMP' 'URI::Escape' 'Apache::Session' \ 'Date::Parse' 'JSON' 'JSON::XS' 'FCGI' do { $as_echo "$as_me:${as_lineno-$LINENO}: checking presence of $module" >&5 $as_echo_n "checking presence of $module... " >&6; } if ${PERL} ${PERLOPTS} -e "use $module" 2>/dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Ok" >&5 $as_echo "Ok" >&6; } else as_fn_error $? "Perl cannot find $module" "$LINENO" 5; fi done # Check if Perl threads can be used. # Requirements are: perl 5.8.9 with threads compiled, # threads ver. 1.41 or higher, threads::shared ver. 1.03 or higher perlithreads=1 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Perl version is 5.8.9 or higher" >&5 $as_echo_n "checking if Perl version is 5.8.9 or higher... " >&6; } if ${PERL} ${PERLOPTS} -e 'use 5.8.9' 2>/dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Ok" >&5 $as_echo "Ok" >&6; } else perlithreads=0 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test ${perlithreads} -eq 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking threading support in Perl" >&5 $as_echo_n "checking threading support in Perl... " >&6; } if ${PERL} ${PERLOPTS} -e 'use threads' 2>/dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Ok" >&5 $as_echo "Ok" >&6; } else perlithreads=0 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test ${perlithreads} -eq 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if threads module version is 1.41 or higher" >&5 $as_echo_n "checking if threads module version is 1.41 or higher... " >&6; } if ${PERL} ${PERLOPTS} -e \ 'use threads; exit($threads::VERSION >= 1.41 ? 0:1)'; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Ok" >&5 $as_echo "Ok" >&6; } else perlithreads=0 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test ${perlithreads} -eq 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if threads::shared module version is 1.03 or higher" >&5 $as_echo_n "checking if threads::shared module version is 1.03 or higher... " >&6; } if ${PERL} ${PERLOPTS} -e \ 'use threads; use threads::shared; exit($threads::shared::VERSION >= 1.03 ? 0:1)'; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Ok" >&5 $as_echo "Ok" >&6; } else perlithreads=0 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test ${perlithreads} -eq 0; then as_fn_error $? "Perl multithreading is disabled or modules are too old" "$LINENO" 5 fi fi if test -z "$torrus_user"; then torrus_user=torrus; fi if test "$enable_pkgonly" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if user ${torrus_user} exists" >&5 $as_echo_n "checking if user ${torrus_user} exists... " >&6; } torrus_check_file=torrus_usercheck_$$ torrus_check_error=no if ! touch ${torrus_check_file}; then as_fn_error $? "Cannot create ${torrus_check_file}" "$LINENO" 5 elif ! chown ${torrus_user} ${torrus_check_file}; then torrus_check_error=yes fi rm -f ${torrus_check_file} if test ${torrus_check_error} = yes; then as_fn_error $? "User ${torrus_user} does not exist" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Ok" >&5 $as_echo "Ok" >&6; } fi fi # Set the var/db and var/cache ownership if test -z "$var_user"; then var_user='${torrus_user}'; fi if test -z "$var_group"; then var_group='torrus'; fi if test -z "$var_mode"; then var_mode='775'; fi # Check whether --enable-varperm was given. if test "${enable_varperm+set}" = set; then : enableval=$enable_varperm; else enable_varperm="yes" fi if test -z "$pkghome"; then pkghome='${prefix}/torrus'; fi if test -z "$pkgbindir"; then pkgbindir='${pkghome}/bin'; fi if test -z "$cfgdefdir"; then cfgdefdir='${pkghome}/conf_defaults'; fi if test -z "$pkgdocdir"; then pkgdocdir='${pkghome}/doc'; fi if test -z "$exmpdir"; then exmpdir='${pkghome}/examples'; fi if test -z "$perllibdir"; then perllibdir='${pkghome}/lib'; fi if test -z "$pluginsdir"; then pluginsdir='${pkghome}/plugins'; fi if test -z "$plugtorruscfgdir"; then plugtorruscfgdir='${pluginsdir}/torrus-config'; fi if test -z "$plugdevdisccfgdir"; then plugdevdisccfgdir='${pluginsdir}/devdiscover-config'; fi if test -z "$plugwrapperdir"; then plugwrapperdir='${pluginsdir}/wrapper'; fi if test -z "$scriptsdir"; then scriptsdir='${pkghome}/scripts'; fi if test -z "$supdir"; then supdir='${pkghome}/sup'; fi if test -z "$webplaindir"; then webplaindir='${supdir}/webplain'; fi if test -z "$webscriptsdir"; then webscriptsdir='${supdir}/webscripts'; fi if test -z "$tmpldir"; then tmpldir='${pkghome}/templates'; fi if test -z "$distxmldir"; then distxmldir='${pkghome}/xmlconfig'; fi if test -z "$sitedir"; then sitedir='${sysconfdir}/torrus'; fi if test -z "$siteconfdir"; then siteconfdir='${sitedir}/conf'; fi if test -z "$tmpluserdir"; then tmpluserdir='${sitedir}/templates'; fi if test -z "$sitexmldir"; then sitexmldir='${sitedir}/xmlconfig'; fi if test -z "$logdir"; then logdir='/var/log/torrus'; fi if test -z "$piddir"; then piddir='/var/run/torrus'; fi if test -z "$varprefix"; then varprefix='/var/torrus'; fi if test -z "$gitrepodir"; then gitrepodir='${varprefix}/gitrepo'; fi if test -z "$reportsdir"; then reportsdir='${varprefix}/reports'; fi if test -z "$seslockdir"; then seslockdir='${varprefix}/session_data/lock'; fi if test -z "$sesstordir"; then sesstordir='${varprefix}/session_data/store'; fi if test -z "$wrapperdir"; then wrapperdir='${bindir}'; fi if test -z "$mansec_usercmd"; then mansec_usercmd='1'; fi if test -z "$mansec_misc"; then mansec_misc='7'; fi if test -z "$defrrddir"; then defrrddir='/srv/torrus/collector_rrd'; fi ac_config_files="$ac_config_files Makefile bin/Makefile configs/Makefile" ac_config_files="$ac_config_files doc/Makefile doc/manpages/Makefile" ac_config_files="$ac_config_files examples/Makefile lib/Makefile" ac_config_files="$ac_config_files sup/Makefile xmlconfig/Makefile" ac_config_files="$ac_config_files setup_tools/substvars.sh" ac_config_files="$ac_config_files setup_tools/mkvardir.sh" ac_config_files="$ac_config_files init.d/torrus" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -z "${POD2TEXT_PRESENT_TRUE}" && test -z "${POD2TEXT_PRESENT_FALSE}"; then as_fn_error $? "conditional \"POD2TEXT_PRESENT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${POD2MAN_PRESENT_TRUE}" && test -z "${POD2MAN_PRESENT_FALSE}"; then as_fn_error $? "conditional \"POD2MAN_PRESENT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by torrus $as_me 3.00, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ torrus config.status 3.00 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; "configs/Makefile") CONFIG_FILES="$CONFIG_FILES configs/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/manpages/Makefile") CONFIG_FILES="$CONFIG_FILES doc/manpages/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "sup/Makefile") CONFIG_FILES="$CONFIG_FILES sup/Makefile" ;; "xmlconfig/Makefile") CONFIG_FILES="$CONFIG_FILES xmlconfig/Makefile" ;; "setup_tools/substvars.sh") CONFIG_FILES="$CONFIG_FILES setup_tools/substvars.sh" ;; "setup_tools/mkvardir.sh") CONFIG_FILES="$CONFIG_FILES setup_tools/mkvardir.sh" ;; "init.d/torrus") CONFIG_FILES="$CONFIG_FILES init.d/torrus" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "setup_tools/substvars.sh":F) chmod +x setup_tools/substvars.sh ;; "setup_tools/mkvardir.sh":F) chmod +x setup_tools/mkvardir.sh ;; "init.d/torrus":F) chmod +x init.d/torrus ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi VARSAVE=configs/instvars echo creating $VARSAVE rm -f $VARSAVE for VAR in $ac_subst_vars; do case ${VAR} in DEFS | PACKAGE* | INSTALL* | VERSION | ACLOCAL | AUTO* | MAKEINFO |\ install_sh | AM* | am* | ac* | ECHO* | build* | host* | target* |\ CYG* | PATH_SEPARATOR | AWK | STRIP | mkdir* |\ perllibdirs ) ;; *) eval 'VAL=${'$VAR'}' echo ${VAR}=\'${VAL}\' >>$VARSAVE ;; esac done torrus-3.00/configure.ac0000644000175000017500000002625413131655331012213 00000000000000# Copyright (C) 2002-2016 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # AC_INIT([torrus],[3.00],[ssinyagin@users.sourceforge.net]) AC_PREREQ([2.59]) AC_CONFIG_AUX_DIR(conftools) AC_CANONICAL_HOST AM_INIT_AUTOMAKE(1.9) AC_PATH_PROG(PERL, perl, no) AC_PATH_PROG(PERLCRITIC, perlcritic, no) # Need this for init.torrus AC_PATH_PROG(SU, su, no) AC_PATH_PROG(KILL, kill, no) AC_PATH_PROG(SED, sed, no) AC_PATH_PROG(FIND, find, no) AC_PATH_PROG(RM, rm, no) AC_PATH_PROG(SLEEP, sleep, no) AC_PATH_PROG(GIT, git, no) # This will generate doc pages from POD sources AC_PATH_PROG(POD2TEXT, pod2text, no) AM_CONDITIONAL([POD2TEXT_PRESENT], [test "$POD2TEXT" != no]) AC_PATH_PROG(POD2MAN, pod2man, no) AM_CONDITIONAL([POD2MAN_PRESENT], [test "$POD2MAN" != no]) AC_ARG_ENABLE(pkgonly, [AC_HELP_STRING([--enable-pkgonly], [Skip all checking])]) AC_SUBST(enable_pkgonly) perllibdirs="\'\${perllibdir}\'" PERLOPTS= AC_ARG_VAR(PERLINC, [[] Additional space-separated Perl library paths]) if test ! -z "$PERLINC"; then for d in $PERLINC; do PERLOPTS="${PERLOPTS} -I${d}" perllibdirs=${perllibdirs}"\,\'"${d}"\'" done fi find_rrdtool () { if ${PERL} -e 'use RRDs' 2>/dev/null; then :; else if test "$enable_pkgonly" != yes; then AC_MSG_NOTICE([RRDs.pm is not in default Perl search paths.]) AC_MSG_CHECKING([RRDtool in /usr/local/rrdtool*]) with_rrdtool=`ls -1dr /usr/local/rrdtool* | head -1` if test -d $with_rrdtool; then AC_MSG_RESULT([${with_rrdtool}]) else AC_MSG_ERROR([Cannot find RRDtool]) fi test_rrdtool else with_rrdtool="/usr/local/rrdtool" fi fi } test_rrdtool () { if test "$enable_pkgonly" != yes; then if ${PERL} -I${with_rrdtool}/lib/perl -e 'use RRDs'; then :; else AC_MSG_ERROR([Could not find RRDs perl module in ${with_rrdtool}]) fi fi perllibdirs=${perllibdirs}"\,\'"${with_rrdtool}"/lib/perl/\'" } AC_ARG_WITH(rrdtool, [AC_HELP_STRING(--with-rrdtool=DIR,RRDTool location)], test_rrdtool, find_rrdtool) AC_SUBST(perllibdirs, [${perllibdirs}]) # Check the necessary Perl modules if test "$enable_pkgonly" != yes; then if test ${GIT} = no; then AC_MSG_ERROR([Git executable is required]) fi for module in 'Redis::Fast' \ 'Git::Raw 0.72' 'Git::ObjectStore 0.007' \ 'Cache::Ref' \ 'XML::LibXML' 'Template' \ 'Proc::Daemon' 'Net::SNMP' 'URI::Escape' 'Apache::Session' \ 'Date::Parse' 'JSON' 'JSON::XS' 'FCGI' do AC_MSG_CHECKING([presence of $module]) if ${PERL} ${PERLOPTS} -e "use $module" 2>/dev/null; then AC_MSG_RESULT([Ok]) else AC_MSG_ERROR([Perl cannot find $module]); fi done # Check if Perl threads can be used. # Requirements are: perl 5.8.9 with threads compiled, # threads ver. 1.41 or higher, threads::shared ver. 1.03 or higher perlithreads=1 AC_MSG_CHECKING([if Perl version is 5.8.9 or higher]) if ${PERL} ${PERLOPTS} -e 'use 5.8.9' 2>/dev/null; then AC_MSG_RESULT([Ok]) else perlithreads=0 AC_MSG_RESULT([no]) fi if test ${perlithreads} -eq 1; then AC_MSG_CHECKING([threading support in Perl]) if ${PERL} ${PERLOPTS} -e 'use threads' 2>/dev/null; then AC_MSG_RESULT([Ok]) else perlithreads=0 AC_MSG_RESULT([no]) fi fi if test ${perlithreads} -eq 1; then AC_MSG_CHECKING([if threads module version is 1.41 or higher]) if ${PERL} ${PERLOPTS} -e \ 'use threads; exit($threads::VERSION >= 1.41 ? 0:1)'; then AC_MSG_RESULT([Ok]) else perlithreads=0 AC_MSG_RESULT([no]) fi fi if test ${perlithreads} -eq 1; then AC_MSG_CHECKING([if threads::shared module version is 1.03 or higher]) if ${PERL} ${PERLOPTS} -e \ 'use threads; use threads::shared; exit($threads::shared::VERSION >= 1.03 ? 0:1)'; then AC_MSG_RESULT([Ok]) else perlithreads=0 AC_MSG_RESULT([no]) fi fi if test ${perlithreads} -eq 0; then AC_MSG_ERROR([Perl multithreading is disabled or modules are too old]) fi fi AC_ARG_VAR(torrus_user, [[torrus] UID to run the daemons]) if test -z "$torrus_user"; then torrus_user=torrus; fi if test "$enable_pkgonly" != yes; then AC_MSG_CHECKING([if user ${torrus_user} exists]) torrus_check_file=torrus_usercheck_$$ torrus_check_error=no if ! touch ${torrus_check_file}; then AC_MSG_ERROR([Cannot create ${torrus_check_file}]) elif ! chown ${torrus_user} ${torrus_check_file}; then torrus_check_error=yes fi rm -f ${torrus_check_file} if test ${torrus_check_error} = yes; then AC_MSG_ERROR([User ${torrus_user} does not exist]) else AC_MSG_RESULT([Ok]) fi fi # Set the var/db and var/cache ownership AC_ARG_VAR(var_user, [[TORRUS_USER] Owner of writable directories]) if test -z "$var_user"; then var_user='${torrus_user}'; fi AC_ARG_VAR(var_group, [[torrus] Group of writable directories]) if test -z "$var_group"; then var_group='torrus'; fi AC_ARG_VAR(var_mode, [[775] Mode of writable directories]) if test -z "$var_mode"; then var_mode='775'; fi AC_ARG_ENABLE(varperm, [AC_HELP_STRING(--disable-varperm, Disable directory access rights tuning)], [], [enable_varperm="yes"]) AC_SUBST(enable_varperm) AC_ARG_VAR(pkghome, [[PREFIX/torrus] Place for Torrus static files]) if test -z "$pkghome"; then pkghome='${prefix}/torrus'; fi AC_ARG_VAR(pkgbindir, [[PKGHOME/bin] Torrus executables]) if test -z "$pkgbindir"; then pkgbindir='${pkghome}/bin'; fi AC_ARG_VAR(cfgdefdir, [[PKGHOME/conf_defaults] torrus-config.pl and others]) if test -z "$cfgdefdir"; then cfgdefdir='${pkghome}/conf_defaults'; fi AC_ARG_VAR(pkgdocdir, [[PKGHOME/doc] Documentation files]) if test -z "$pkgdocdir"; then pkgdocdir='${pkghome}/doc'; fi AC_ARG_VAR(exmpdir, [[PKGHOME/examples] Examples]) if test -z "$exmpdir"; then exmpdir='${pkghome}/examples'; fi AC_ARG_VAR(perllibdir, [[PKGHOME/perllib] Torrus Perl libraries]) if test -z "$perllibdir"; then perllibdir='${pkghome}/lib'; fi AC_ARG_VAR(pluginsdir, [[PKGHOME/plugins] Plugin configurations]) if test -z "$pluginsdir"; then pluginsdir='${pkghome}/plugins'; fi AC_ARG_VAR(plugtorruscfgdir, [[PLUGINSDIR/torrus-config]]) if test -z "$plugtorruscfgdir"; then plugtorruscfgdir='${pluginsdir}/torrus-config'; fi AC_ARG_VAR(plugdevdisccfgdir, [[PLUGINSDIR/devdiscover-config]]) if test -z "$plugdevdisccfgdir"; then plugdevdisccfgdir='${pluginsdir}/devdiscover-config'; fi AC_ARG_VAR(plugwrapperdir, [[PLUGINSDIR/wrapper]]) if test -z "$plugwrapperdir"; then plugwrapperdir='${pluginsdir}/wrapper'; fi AC_ARG_VAR(scriptsdir, [[PKGHOME/scripts] Script files]) if test -z "$scriptsdir"; then scriptsdir='${pkghome}/scripts'; fi AC_ARG_VAR(supdir, [[PKGHOME/sup] Supplementary files]) if test -z "$supdir"; then supdir='${pkghome}/sup'; fi AC_ARG_VAR(webplaindir, [[SUPDIR/webplain] Web interface plain files path]) if test -z "$webplaindir"; then webplaindir='${supdir}/webplain'; fi AC_ARG_VAR(webscriptsdir, [[SUPDIR/webscripts] Directory for optional web scripts]) if test -z "$webscriptsdir"; then webscriptsdir='${supdir}/webscripts'; fi AC_ARG_VAR(tmpldir, [[PKGHOME/templates] Template files]) if test -z "$tmpldir"; then tmpldir='${pkghome}/templates'; fi AC_ARG_VAR(distxmldir, [[PKGHOME/xmlconfig] Distribution XML config files]) if test -z "$distxmldir"; then distxmldir='${pkghome}/xmlconfig'; fi AC_ARG_VAR(sitedir, [[SYSCONFDIR/torrus] Site configuration files]) if test -z "$sitedir"; then sitedir='${sysconfdir}/torrus'; fi AC_ARG_VAR(siteconfdir, [[SITEDIR/conf] Site configuration files]) if test -z "$siteconfdir"; then siteconfdir='${sitedir}/conf'; fi AC_ARG_VAR(tmpluserdir, [[SITEDIR/templates] User-defined Template files]) if test -z "$tmpluserdir"; then tmpluserdir='${sitedir}/templates'; fi AC_ARG_VAR(sitexmldir, [[SITEDIR/xmlconfig] Site XML configs]) if test -z "$sitexmldir"; then sitexmldir='${sitedir}/xmlconfig'; fi AC_ARG_VAR(logdir, [[/var/log/torrus] Log files]) if test -z "$logdir"; then logdir='/var/log/torrus'; fi AC_ARG_VAR(piddir, [[/var/run/torrus] PID files]) if test -z "$piddir"; then piddir='/var/run/torrus'; fi AC_ARG_VAR(varprefix, [[/var/torrus] Common prefix for runtime data]) if test -z "$varprefix"; then varprefix='/var/torrus'; fi AC_ARG_VAR(gitrepodir, [[VARPREFIX/gitrepo] git repository dir]) if test -z "$gitrepodir"; then gitrepodir='${varprefix}/gitrepo'; fi AC_ARG_VAR(reportsdir, [[VARPREFIX/reports] Reports output]) if test -z "$reportsdir"; then reportsdir='${varprefix}/reports'; fi AC_ARG_VAR(seslockdir, [[VARPREFIX/session_data/lock] Web session locks]) if test -z "$seslockdir"; then seslockdir='${varprefix}/session_data/lock'; fi AC_ARG_VAR(sesstordir, [[VARPREFIX/session_data/store] Web session storage]) if test -z "$sesstordir"; then sesstordir='${varprefix}/session_data/store'; fi AC_ARG_VAR(wrapperdir, [[BINDIR] CLI wrapper]) if test -z "$wrapperdir"; then wrapperdir='${bindir}'; fi AC_ARG_VAR(mansec_usercmd, [[1] User commands man section]) if test -z "$mansec_usercmd"; then mansec_usercmd='1'; fi AC_ARG_VAR(mansec_misc, [[7] Miscellaneous man section]) if test -z "$mansec_misc"; then mansec_misc='7'; fi AC_ARG_VAR(defrrddir, [[/srv/torrus/collector_rrd] Default RRD storage path]) if test -z "$defrrddir"; then defrrddir='/srv/torrus/collector_rrd'; fi AC_CONFIG_FILES([Makefile bin/Makefile configs/Makefile]) AC_CONFIG_FILES([doc/Makefile doc/manpages/Makefile]) AC_CONFIG_FILES([examples/Makefile lib/Makefile]) AC_CONFIG_FILES([sup/Makefile xmlconfig/Makefile]) AC_CONFIG_FILES([setup_tools/substvars.sh],[chmod +x setup_tools/substvars.sh]) AC_CONFIG_FILES([setup_tools/mkvardir.sh], [chmod +x setup_tools/mkvardir.sh]) AC_CONFIG_FILES([init.d/torrus], [chmod +x init.d/torrus]) AC_SUBST(VERSION) AC_OUTPUT VARSAVE=configs/instvars echo creating $VARSAVE rm -f $VARSAVE for VAR in $ac_subst_vars; do case ${VAR} in DEFS | PACKAGE* | INSTALL* | VERSION | ACLOCAL | AUTO* | MAKEINFO |\ install_sh | AM* | am* | ac* | ECHO* | build* | host* | target* |\ CYG* | PATH_SEPARATOR | AWK | STRIP | mkdir* |\ perllibdirs ) ;; *) eval 'VAL=${'$VAR'}' echo ${VAR}=\'${VAL}\' >>$VARSAVE ;; esac done torrus-3.00/configs/0000755000175000017500000000000013131663306011425 500000000000000torrus-3.00/configs/devdiscover-siteconfig.pl0000644000175000017500000000011611545711242016345 00000000000000# Torrus Device Discovery Site config. Put all your site specifics here. 1; torrus-3.00/configs/email-siteconfig.pl0000644000175000017500000000062111545711242015120 00000000000000# Torrus Email notifications configuration. Put all your site specifics here. # The URL where the user can browse the datasources $Torrus::Email::url = 'http://localhost/torrus'; # Filename within templates directory which will be used # for e-mail notification $Torrus::Email::template = 'email-alarm.txt'; 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/configs/torrus-siteconfig.pl0000644000175000017500000000126611642656034015402 00000000000000# Torrus Site config. Put all your site specifics here. # You need to stop and start Apache server every time you change this file. use Sys::Hostname qw(hostname); @Torrus::Global::xmlAlwaysIncludeFirst = ( 'defaults.xml', 'site-global.xml' ); %Torrus::Global::treeConfig = ( 'main' => { 'description' => 'The main tree', 'info' => 'some tree', 'xmlfiles' => [qw(routers.xml)], 'run' => { 'collector' => 1, 'monitor' => 0 } } ); # Customizable look in the HTML page top # $Torrus::Renderer::companyName = 'Your company name'; # $Torrus::Renderer::companyURL = 'http://torrus.sf.net'; # $Torrus::Renderer::siteInfo = hostname(); 1; torrus-3.00/configs/Makefile.am0000644000175000017500000000311513131655331013400 00000000000000 # Copyright (C) 2004 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # EXTRA_DIST = \ devdiscover-config.pl \ devdiscover-siteconfig.pl \ email-siteconfig.pl \ initscript.conf \ notify-siteconfig.pl \ snmptrap-siteconfig.pl \ torrus-config.pl \ torrus-siteconfig.pl DISTCLEANFILES = instvars instvarsdir = $(cfgdefdir) nodist_instvars_DATA = instvars install-data-local: $(mkinstalldirs) $(DESTDIR)$(cfgdefdir) $(DESTDIR)$(siteconfdir) for f in initscript.conf devdiscover-config.pl torrus-config.pl; do \ @abs_top_builddir@/setup_tools/substvars.sh $$f > \ $(DESTDIR)$(cfgdefdir)/$$f; \ done for f in devdiscover-siteconfig.pl email-siteconfig.pl \ notify-siteconfig.pl \ snmptrap-siteconfig.pl torrus-siteconfig.pl; do \ if test ! -r $(DESTDIR)$(siteconfdir)/$$f; then \ $(INSTALL_DATA) $$f $(DESTDIR)$(siteconfdir)/$$f; \ fi \ done torrus-3.00/configs/initscript.conf0000644000175000017500000000042513131655331014404 00000000000000# Torrus init script configuration # You can override any value in @siteconfdir@/initscript.siteconf # setuid to this user before launching the daemons TORRUS_USER=@torrus_user@ # Local Variables: # mode: shell-script # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/configs/notify-siteconfig.pl0000644000175000017500000000130511545711242015341 00000000000000 %Torrus::Notify::programs = ( 'mailto' => '$TORRUS_BIN/action_printemail | /usr/bin/mail $ARG1', 'page' => '/usr/bin/echo $TORRUS_NODEPATH:$TORRUS_MONITOR ' . '>> /tmp/monitor.$ARG1.log' ); %Torrus::Notify::policies = ( 'CUST_A' => { 'match' => sub { $ENV{'TORRUS_P_notify_policy'} eq 'A' }, 'severity' => { '3' => [ 'mailto:aaa@domain.com', 'mailto:bbb@domain.com' ], '5' => [ 'page:1234', 'mailto:boss@domain.com' ] } } ); # Torrus::Log::setLevel('debug'); 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/configs/Makefile.in0000644000175000017500000003704113131655451013421 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2004 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = configs DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(instvarsdir)" DATA = $(nodist_instvars_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ FIND = @FIND@ GIT = @GIT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KILL = @KILL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERLCRITIC = @PERLCRITIC@ PERLINC = @PERLINC@ POD2MAN = @POD2MAN@ POD2TEXT = @POD2TEXT@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLEEP = @SLEEP@ STRIP = @STRIP@ SU = @SU@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cfgdefdir = @cfgdefdir@ datadir = @datadir@ datarootdir = @datarootdir@ defrrddir = @defrrddir@ distxmldir = @distxmldir@ docdir = @docdir@ dvidir = @dvidir@ enable_pkgonly = @enable_pkgonly@ enable_varperm = @enable_varperm@ exec_prefix = @exec_prefix@ exmpdir = @exmpdir@ gitrepodir = @gitrepodir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mansec_misc = @mansec_misc@ mansec_usercmd = @mansec_usercmd@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perllibdir = @perllibdir@ perllibdirs = @perllibdirs@ piddir = @piddir@ pkgbindir = @pkgbindir@ pkgdocdir = @pkgdocdir@ pkghome = @pkghome@ plugdevdisccfgdir = @plugdevdisccfgdir@ pluginsdir = @pluginsdir@ plugtorruscfgdir = @plugtorruscfgdir@ plugwrapperdir = @plugwrapperdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ reportsdir = @reportsdir@ sbindir = @sbindir@ scriptsdir = @scriptsdir@ seslockdir = @seslockdir@ sesstordir = @sesstordir@ sharedstatedir = @sharedstatedir@ siteconfdir = @siteconfdir@ sitedir = @sitedir@ sitexmldir = @sitexmldir@ srcdir = @srcdir@ supdir = @supdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tmpldir = @tmpldir@ tmpluserdir = @tmpluserdir@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ torrus_user = @torrus_user@ var_group = @var_group@ var_mode = @var_mode@ var_user = @var_user@ varprefix = @varprefix@ webplaindir = @webplaindir@ webscriptsdir = @webscriptsdir@ wrapperdir = @wrapperdir@ EXTRA_DIST = \ devdiscover-config.pl \ devdiscover-siteconfig.pl \ email-siteconfig.pl \ initscript.conf \ notify-siteconfig.pl \ snmptrap-siteconfig.pl \ torrus-config.pl \ torrus-siteconfig.pl DISTCLEANFILES = instvars instvarsdir = $(cfgdefdir) nodist_instvars_DATA = instvars all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu configs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu configs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-nodist_instvarsDATA: $(nodist_instvars_DATA) @$(NORMAL_INSTALL) @list='$(nodist_instvars_DATA)'; test -n "$(instvarsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(instvarsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(instvarsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(instvarsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(instvarsdir)" || exit $$?; \ done uninstall-nodist_instvarsDATA: @$(NORMAL_UNINSTALL) @list='$(nodist_instvars_DATA)'; test -n "$(instvarsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(instvarsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(instvarsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-nodist_instvarsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nodist_instvarsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-nodist_instvarsDATA install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am \ uninstall-nodist_instvarsDATA install-data-local: $(mkinstalldirs) $(DESTDIR)$(cfgdefdir) $(DESTDIR)$(siteconfdir) for f in initscript.conf devdiscover-config.pl torrus-config.pl; do \ @abs_top_builddir@/setup_tools/substvars.sh $$f > \ $(DESTDIR)$(cfgdefdir)/$$f; \ done for f in devdiscover-siteconfig.pl email-siteconfig.pl \ notify-siteconfig.pl \ snmptrap-siteconfig.pl torrus-siteconfig.pl; do \ if test ! -r $(DESTDIR)$(siteconfdir)/$$f; then \ $(INSTALL_DATA) $$f $(DESTDIR)$(siteconfdir)/$$f; \ fi \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torrus-3.00/configs/torrus-config.pl0000644000175000017500000003706313131655331014513 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # DO NOT EDIT THIS FILE! # Torrus local configuration. # Put all your local settings into torrus-siteconfig.pl use lib(@perllibdirs@); $Torrus::Global::version = '@VERSION@'; $Torrus::Global::gitExec = '@GIT@'; $Torrus::Global::cfgDefsDir = '@cfgdefdir@'; $Torrus::Global::cfgSiteDir = '@siteconfdir@'; $Torrus::Global::pkgbindir = '@pkgbindir@'; $Torrus::Global::templateDirs = ['@tmpluserdir@','@tmpldir@']; $Torrus::Global::stylingDir = '@styldir@'; $Torrus::Global::pidDir = '@piddir@'; $Torrus::Global::logDir = '@logdir@'; $Torrus::Global::reportsDir = '@reportsdir@'; $Torrus::Global::sesStoreDir = '@sesstordir@'; $Torrus::Global::sesLockDir = '@seslockdir@'; $Torrus::Global::webPlainDir = '@webplaindir@'; $Torrus::Global::gitRepoDir = '@gitrepodir@'; @Torrus::Global::xmlDirs = ('@distxmldir@', '@sitexmldir@'); $Torrus::Global::healthIconsDir = $Torrus::Global::stylingDir; # By default, local Redis server is used $Torrus::Global::redisServer = '127.0.0.1:6379'; # All keys and channel names in redis are prepended with this prefix. # It should be unique per Torrus instance within the same Redis # database. $Torrus::Global::redisPrefix = 'torrus:'; $Torrus::ConfigTree::writerAuthorName = 'Torrus Compiler'; $Torrus::ConfigTree::writerAuthorEmail = 'torrus@localhost'; $Torrus::ConfigTree::objCacheSize = 2048; # This is to prevent Git garbage collector from running while there is # a compiler process running (default: 4 hours). $Torrus::ConfigTree::writerTimeout = 14400; #rrdcached support can be enabled by specifying the path of rrdcached socket #$Torrus::Global::RRDCachedSock = '/var/rrdtool/rrdcached/rrdcached.sock'; # How much the timestamps can differ in one RRD file, in seconds $Torrus::Global::RRDTimestampTolerance = 15; # Syslog facility for collector and monitor daemons $Torrus::Log::syslogFacility = 'local0'; # Defaults used by launcher $Torrus::Collector::default_cmdopts = ''; $Torrus::Monitor::default_cmdopts = '--delay=10'; $Torrus::Launcher::default_stop_timeout = 30; # When true, daemon logging is sent to syslog instead of logfile. $Torrus::Collector::useSyslog = 1; $Torrus::Monitor::useSyslog = 1; # Optionally Syslog socket options can be specified. By default, the native # Syslog socket on the local host is used # $Torrus::Log::syslogSockOpt = ['unix', '/home/jsmith/tmp/syslog.sock']; # If true, daemons will continue running even if there are no relevant # datasource leaves $Torrus::Collector::runAlways = 0; $Torrus::Monitor::runAlways = 0; # By default, run 3 full collector cycles immediately at start. This # allows all SNMP name->index maps to be fetched and used ASAP # The 3rd cycle is needed for cbQoS to fetch its mappings $Torrus::Collector::fastCycles = 0; # SO_RCVBUF, the receiving buffer size of the SNMP collector socket. # Should be large enough to sustain the traffic bursts, and should be # within limits incurred by local OS and kernel settings. # Check your system manuals and the results of network statistics. # # On Solaris, the maximum buffer size is 256k, and it is configurable # via "/usr/sbin/ndd /dev/udp udp_max_buf ", # and the statistics are shown in udpInOverflows of "netstat -s -P ip" output. # # On FreeBSD, the statistics can be obtained via "netstat -s -p udp". # The maximum socket buffer can be changed via # "sysctl kern.ipc.maxsockbuf=", and default is 256k. # On startup, the OS reads these settings from /etc/sysctl.conf # # On Linux (FC2), the default limit is 131071, and it can be changed # by "sysctl -w net.core.rmem_max=". On startup, the OS reads these # settings from /etc/sysctl.conf # $Torrus::Collector::SNMP::RxBuffer = 131071; # The time period after which we give up to reach the host being unreachable $Torrus::Collector::SNMP::unreachableTimeout = 0; # never give up # For unreachable host, we retry SNMP query not earlier than this $Torrus::Collector::SNMP::unreachableRetryDelay = 600; # 10 min # Variables that define the SNMP map refreshing. # The maps (e.g. ifDescr=>ifIndex mapping) are stored in the collector # process and are not automatically refreshed after recompiling. # They refresh only when the SNMP agent is rebooted or at periodic intervals # defined below. For SNMPv1 agents, periodic refreshing is disabled # because of performance impact. # # Refresh SNMP maps every 5 to 7 hours $Torrus::Collector::SNMP::mapsRefreshPeriod = 18000; $Torrus::Collector::SNMP::mapsRefreshRandom = 0.40; # After configuration re-compiling, update the maps. # Do it randomly and spread the load evenly between 0 and 30 minutes. $Torrus::Collector::SNMP::mapsUpdateInterval = 1800; # Wait 10min between refresh checkups $Torrus::Collector::SNMP::mapsExpireCheckPeriod = 600; # There is a strange bug that with more than 400 sessions per SNMP # dispatcher some requests are not sent at all $Torrus::Collector::SNMP::maxSessionsPerDispatcher = 100; # How many unwritten updates are allowed to stay in the queue $Torrus::Collector::RRDStorage::thrQueueLimit = 1000000; # The following errors are caused by changes in the device configurations, # when the collector tries to store data in a RRD file, but the # structure of the file is no longer suitable: # Datasource exists in RRD file, but is not updated # Datasource being updated does not exist # Set this variable to true if you want these RRD files automatically moved. # The current date is appended to the filename, and the file # is moved to another directory or renamed. $Torrus::Collector::RRDStorage::moveConflictRRD = 0; # The path where conflicted RRD files would be moved. This directory # should exist, be writable by Torrus daemon user, and in most OSes # it must reside in the same filesystem as the original files. # When undefined, the files are renamed within their original directory. $Torrus::Collector::RRDStorage::conflictRRDPath = undef; # Sleep interval when scheduler initialization failed (i.e. configuration # reading timeout) $Torrus::Scheduler::failedInitSleep = 1800; # When positive, the scheduler will sleep in small intervals. # Use this when the system clock is not reliable, like in VmWare $Torrus::Scheduler::maxSleepTime = 0; # Set this to true when the system clock is not reliable, like in VmWare $Torrus::Scheduler::ignoreClockSkew = 0; # Exponential decay parameter (alpha) for Scheduler statistics averages: # # Xnew = alpha * Xmes + (1-alpha) * Xprev # Xnew: new calculated average # Xmes: measured value # Xprev: old calculated average # # Alpha defines how many previous measurements composite the average: # alpha = 1.0 - exp( log(1-TotalWeight)/NPoints ) # TotalWeight: the weight of NPoints measurements # NPoints: number of measurements # 0.63 corresponds to TotalWeight=0.95 and NPoints=3 (95% of average is from # last three datapoints # $Torrus::Scheduler::statsExpDecayAlpha = 0.63; # Monitor alarms may become orphaned if the configuration changes # in the middle of an event. Events older than this time are cleaned up # default: 2 weeks $Torrus::Monitor::alarmTimeout = 1209600; # The default CSS stylesheet and other details for HTML output. # These settings may optionally be overwritten by the styling profile below. # Additional CSS overlay may be specified with 'cssoverlay' property, # It should point to an absolute URL. # for example: # $Torrus::Renderer::styling{'default'}{'cssoverlay'} = '/mystyle.css'; # %Torrus::Renderer::styling = ( 'default' => {'stylesheet' => 'torrus.css'}, 'printer' => {'stylesheet' => 'torrus-printer.css'}, 'report' => {'stylesheet' => 'torrus-report.css'} ); # Color schema for RRDtool graph. It can be extended by setting # $Torrus::Renderer::stylingProfileOverlay. The overlay should # be an absolute file name. You can use $Torrus::Global::cfgSiteDir # to refer to the site configs path. $Torrus::Renderer::stylingProfile = 'torrus-schema'; # Top level URI $Torrus::Renderer::rendererURL = '/torrus'; # Trailing slash is important! $Torrus::Renderer::plainURL = '/torrus/plain/'; # The small piece of text in the corner of the HTML output. $Torrus::Renderer::companyName = 'Your company name'; # The URL to use for that piece of text $Torrus::Renderer::companyURL = 'http://torrus.sf.net'; # The URL of your company logo which will be displayed instead of # companyName # $Torrus::Renderer::companyLogo = 'http://domain.com/logo.png'; # Another piece of text on the right to the company name $Torrus::Renderer::siteInfo = undef; # URL to be shown on the login page for lost password # You have to implement that yourself # $Torrus::Renderer::lostPasswordURL = 'http://domain.com/lostpw.cgi'; # The time format to print in HTML $Torrus::Renderer::timeFormat = '%d-%m-%Y %H:%M'; # Exception characters for URI::Escape # By default, slash (/) is escaped, and we don't really want it $Torrus::Renderer::uriEscapeExceptions = '^A-Za-z0-9-._~/:'; # The page that lets you choose the tree from the list $Torrus::Renderer::Chooser::mimeType = 'text/html; charset=UTF-8'; $Torrus::Renderer::Chooser::expires = '60'; $Torrus::Renderer::Chooser::template = 'default-chooser.html'; $Torrus::Renderer::Chooser::searchTemplate = 'globalsearch.html'; # Some RRDtool versions may report errors on decorations $Torrus::Renderer::ignoreDecorations = 0; # This enables full Apache handler debugging $Torrus::Renderer::globalDebug = 0; # When true, Holt-Winters boundaries and failures are described in the # graph legend $Torrus::Renderer::hwGraphLegend = 0; # When true, users may view service usage reports (requires SQL connection) $Torrus::Renderer::displayReports = 0; # Allow tree searching. $Torrus::Renderer::searchEnabled = 1; # Allow global searching across the trees. If the user authentication # is enabled, the user should have rights DisplayTree and GlobalSearch for '*' $Torrus::Renderer::globalSearchEnabled = 1; # Set to true if you want JSON to be pretty and canonical (needs extra # CPU cycles) $Torrus::Renderer::RPC::pretty_json = 0; # List of parameters which are never returned by RPC calls %Torrus::Renderer::RPC::params_blacklist = ('snmp-community' => 1, 'snmp-username' => 1, 'snmp-authpassword' => 1, 'snmp-privpassword' => 1); # List of leaf parameters that are always queried @Torrus::Renderer::RPC::default_leaf_params = ('nodeid', 'system-id', 'descriptive-nickname', 'comment', 'node-display-name'); # Modules that Collector will use for collecting and storing data. @Torrus::Collector::loadModules = ( 'Torrus::Collector::SNMP', 'Torrus::Collector::CDef', 'Torrus::Collector::RRDStorage' ); # Configurable part of Validator @Torrus::Validator::loadLeafValidators = ( 'Torrus::Collector::SNMP_Params', 'Torrus::Collector::CDef_Params' ); # Configurable part of AdmInfo renderer @Torrus::Renderer::loadAdmInfo = ( 'Torrus::Collector::SNMP_Params', 'Torrus::Collector::CDef_Params' ); # Display health icons in directory listings $Torrus::Renderer::displayHealthIcons = 1; # View definition for health icons $Torrus::Renderer::healthView = 'health'; # Parameters that are comma-separated values @Torrus::ConfigTree::XMLCompiler::listparams = (); # XML files to be compiled first for every tree @Torrus::Global::xmlAlwaysIncludeFirst = (); # XML files to be compiled after the tree files, but before the files # included with XML directive @Torrus::Global::xmlAlwaysIncludeLast = (); # Do we need Web user authentication/authorization ? $Torrus::CGI::authorizeUsers = 1; # User authentication method may be changed locally $Torrus::ACL::userAuthModule = 'Torrus::ACL::AuthLocalMD5'; # Minimum allowed password length $Torrus::ACL::minPasswordLength = 6; # The login page $Torrus::Renderer::LoginScreen::mimeType = 'text/html; charset=UTF-8'; $Torrus::Renderer::LoginScreen::template = 'default-login.html'; # FCGI process lifetime limits. $Torrus::FCGI::maxRequests = 5000; $Torrus::FCGI::maxRequestsRandomFactor = 200; $Torrus::FCGI::maxLifetime = 172800; #48 hours $Torrus::FCGI::maxLifetimeRandomFactor = 10800; #3 hours #### #### SQL connections configuration # For a given Perl class and an optional subtype, # the connection attributes are derived in the following order: # 'Default', 'Default/[subtype]', '[Class]', '[Class]/[subtype]', # 'All/[subtype]'. # For a simple setup, the default attributes are usually defined for # 'Default' key. # The key attributes are: 'dsn', 'username', and 'password'. %Torrus::SQL::connections = ('Default' => {'dsn' => 'DBI:mysql:database=torrus;host=localhost', 'username' => 'torrus', 'password' => 'torrus'} ); #### #### ExternalStorage collector module initialization. # In order to enable External storage, add these lines to torrus-siteconfig.pl: # push(@Torrus::Collector::loadModules, 'Torrus::Collector::ExternalStorage'); # # Other configuration available: # Maximum age for backlog in case of unavailable storage. # We stop recording new data when maxage is reached. Default: 24h $Torrus::Collector::ExternalStorage::backlogMaxAge = 86400; # How often we retry to contact an unreachable external storage. Default: 10min $Torrus::Collector::ExternalStorage::unavailableRetry = 600; # Backend engine for External storage $Torrus::Collector::ExternalStorage::backend = 'Torrus::Collector::ExtDBI'; # SQL table configuration for collector's external storage $Torrus::SQL::SrvExport::tableName = 'srvexport'; %Torrus::SQL::SrvExport::columns = ('srv_date' => 'srv_date', 'srv_time' => 'srv_time', 'serviceid' => 'serviceid', 'value' => 'value', 'intvl' => 'intvl'); # Optional SQL connection subtype for Collector export # $Torrus::Collector::ExtDBI::subtype # SQL table configuration for Reports $Torrus::SQL::Reports::tableName = 'reports'; %Torrus::SQL::Reports::columns = ('id' => 'id', 'rep_date' => 'rep_date', 'rep_time' => 'rep_time', 'reportname' => 'reportname', 'iscomplete' => 'iscomplete'); $Torrus::SQL::ReportFields::tableName = 'reportfields'; %Torrus::SQL::ReportFields::columns = ('id' => 'id', 'rep_id' => 'rep_id', 'name' => 'name', 'serviceid' => 'serviceid', 'value' => 'value', 'units' => 'units'); %Torrus::ReportGenerator::modules = ( 'MonthlyUsage' => 'Torrus::ReportGenerator::MonthlySrvUsage' ); %Torrus::ReportOutput::HTML::templates = ( 'index' => 'report-index.html', 'serviceid' => 'report-serviceid.html', 'monthly' => 'report-monthly.html', 'yearly' => 'report-yearly.html'); # Read plugin configurations { my $dir = '@plugtorruscfgdir@'; opendir(CFGDIR, $dir) or die("Cannot open directory $dir: $!"); my @files = grep { !/^\./ } readdir(CFGDIR); closedir( CFGDIR ); foreach my $file ( @files ) { require $dir . '/' . $file; } } require '@torrus_siteconfig_pl@'; 1; torrus-3.00/configs/snmptrap-siteconfig.pl0000644000175000017500000000055311545711242015701 00000000000000# Torrus SNMP Trap configuration. Put all your site specifics here. # Hosts that will receive traps @Torrus::Snmptrap::hosts = qw( localhost ); # SNMP community for trap sending $Torrus::Snmptrap::community = 'public'; # SNMP trap port. $Torrus::Snmptrap::port = 162; 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/configs/devdiscover-config.pl0000644000175000017500000016117413131655331015473 00000000000000# Copyright (C) 2003 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # DO NOT EDIT THIS FILE! # Torrus Device Discovery local configuration. # Put all your local settings into devdiscover-siteconfig.pl use lib(@perllibdirs@); $Torrus::Global::version = '@VERSION@'; $Torrus::Global::discoveryDir = '@sitedir@/discovery/'; $Torrus::Global::siteXmlDir = '@sitexmldir@'; $Torrus::Global::threadsEnabled = '@perlithreads@'; $Torrus::DevDiscover::timeFormat = '%d-%m-%Y %H:%M'; @Torrus::DevDiscover::loadModules = ( 'Torrus::DevDiscover::RFC1628_UPS_MIB', 'Torrus::DevDiscover::RFC1657_BGP4_MIB', 'Torrus::DevDiscover::RFC2011_IP_MIB', 'Torrus::DevDiscover::RFC2863_IF_MIB', 'Torrus::DevDiscover::RFC2662_ADSL_LINE', 'Torrus::DevDiscover::RFC2670_DOCS_IF', 'Torrus::DevDiscover::RFC2737_ENTITY_MIB', 'Torrus::DevDiscover::RFC2790_HOST_RESOURCES', 'Torrus::DevDiscover::RFC4293_IP_MIB', 'Torrus::DevDiscover::RFC4319_HDSL2_SHDSL_LINE_MIB', 'Torrus::DevDiscover::Actelis', 'Torrus::DevDiscover::Albis_ULAF', 'Torrus::DevDiscover::Alteon', 'Torrus::DevDiscover::ALU_Timetra', 'Torrus::DevDiscover::AlliedTelesyn_PBC18', 'Torrus::DevDiscover::APC_PowerNet', 'Torrus::DevDiscover::Apple_AE', 'Torrus::DevDiscover::Arbor_E', 'Torrus::DevDiscover::Arista', 'Torrus::DevDiscover::AscendMax', 'Torrus::DevDiscover::ATMEL', 'Torrus::DevDiscover::AxxessIT', 'Torrus::DevDiscover::BetterNetworks', 'Torrus::DevDiscover::CasaCMTS', 'Torrus::DevDiscover::CCOM', 'Torrus::DevDiscover::CiscoCatOS', 'Torrus::DevDiscover::CiscoFirewall', 'Torrus::DevDiscover::CiscoGeneric', 'Torrus::DevDiscover::CiscoIOS', 'Torrus::DevDiscover::CiscoIOS_Docsis', 'Torrus::DevDiscover::CiscoIOS_MacAccounting', 'Torrus::DevDiscover::CiscoIOS_SAA', 'Torrus::DevDiscover::CiscoSCE', 'Torrus::DevDiscover::CiscoVDSL', 'Torrus::DevDiscover::CiscoWLC', 'Torrus::DevDiscover::CompaqCIM', 'Torrus::DevDiscover::ComtechEFData', 'Torrus::DevDiscover::EmpireSystemedge', 'Torrus::DevDiscover::F5BigIp', 'Torrus::DevDiscover::Fortinet', 'Torrus::DevDiscover::Foundry', 'Torrus::DevDiscover::FTOS', 'Torrus::DevDiscover::Jacarta', 'Torrus::DevDiscover::JunOS', 'Torrus::DevDiscover::Liebert', 'Torrus::DevDiscover::MicrosoftWindows', 'Torrus::DevDiscover::MotorolaBSR', 'Torrus::DevDiscover::NetApp', 'Torrus::DevDiscover::NetScreen', 'Torrus::DevDiscover::NetBotz', 'Torrus::DevDiscover::NexComm', 'Torrus::DevDiscover::OracleDatabase', 'Torrus::DevDiscover::Paradyne', # needs testing 'Torrus::DevDiscover::Patton', 'Torrus::DevDiscover::RFC1697_RDBMS', 'Torrus::DevDiscover::Symmetricom', 'Torrus::DevDiscover::Thomson_xDSL', 'Torrus::DevDiscover::UcdSnmp', 'Torrus::DevDiscover::Xylan' ); # Template name and source file for each template referenced in discovery # modules %Torrus::ConfigBuilder::templateRegistry = ( #### SNMP defaults '::holt-winters-defaults' => { 'name' => 'holt-winters-defaults', 'source' => 'snmp-defs.xml' }, '::snmp-defaults' => { 'name' => 'snmp-defaults', 'source' => 'snmp-defs.xml' }, '::viewonly-defaults' => { 'name' => 'viewonly-defaults', 'source' => 'snmp-defs.xml' }, '::snmp-reachability' => { 'name' => 'snmp-reachability', 'source' => 'snmp-defs.xml' }, #### CDef Collector defaults '::cdef-collector-defaults' => { 'name' => 'cdef-collector-defaults', 'source' => 'cdef-collector-defs.xml' }, #### UPS-MIB 'RFC1628_UPS_MIB::battery-subtree' => { 'name' => 'battery-subtree', 'source' => 'generic/rfc1628.ups.xml' }, 'RFC1628_UPS_MIB::ups-input-subtree' => { 'name' => 'ups-input-subtree', 'source' => 'generic/rfc1628.ups.xml' }, 'RFC1628_UPS::ups-input-leaf' => { 'name' => 'ups-input-leaf', 'source' => 'generic/rfc1628.ups.xml' }, 'RFC1628_UPS_MIB::ups-output-subtree' => { 'name' => 'ups-output-subtree', 'source' => 'generic/rfc1628.ups.xml' }, 'RFC1628_UPS::ups-output-leaf' => { 'name' => 'ups-output-leaf', 'source' => 'generic/rfc1628.ups.xml' }, 'RFC1628_UPS_MIB::ups-bypass-subtree' => { 'name' => 'ups-bypass-subtree', 'source' => 'generic/rfc1628.ups.xml' }, 'RFC1628_UPS::ups-bypass-leaf' => { 'name' => 'ups-bypass-leaf', 'source' => 'generic/rfc1628.ups.xml' }, #### IF-MIB 'RFC2863_IF_MIB::rfc2863-ifmib-hostlevel' => { 'name' => 'rfc2863-ifmib-hostlevel', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::rfc2863-ifmib-subtree' => { 'name' => 'rfc2863-ifmib-subtree', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::iftable-octets' => { 'name' => 'iftable-octets', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::iftable-ucast-packets' => { 'name' => 'iftable-ucast-packets', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::iftable-discards-in' => { 'name' => 'iftable-discards-in', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::iftable-discards-out' => { 'name' => 'iftable-discards-out', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::iftable-errors-in' => { 'name' => 'iftable-errors-in', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::iftable-errors-out' => { 'name' => 'iftable-errors-out', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::iftable-ifspeed' => { 'name' => 'iftable-ifspeed', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::ifxtable-hcoctets' => { 'name' => 'ifxtable-hcoctets', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::ifxtable-hcucast-packets' => { 'name' => 'ifxtable-hcucast-packets', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::iftable-ifhighspeed' => { 'name' => 'iftable-ifhighspeed', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::interface-bandwidth-usage' => { 'name' => 'interface-bandwidth-usage', 'source' => 'generic/rfc2863.if-mib.xml' }, 'RFC2863_IF_MIB::interface-bandwidth-usage-ifspeed' => { 'name' => 'interface-bandwidth-usage-ifspeed', 'source' => 'generic/rfc2863.if-mib.xml' }, #### RDBMS MIB 'RFC1697_RDBMS::rdbms-dbtable' => { 'name' => 'rdbms-dbtable', 'source' => 'generic/rfc1697.rdbms.xml', }, #### DOCSIS MIB 'RFC2670_DOCS_IF::docsis-downstream-subtree' => { 'name' => 'docsis-downstream-subtree', 'source' => 'generic/rfc2670.docsis-if.xml' }, 'RFC2670_DOCS_IF::docsis-downstream-util' => { 'name' => 'docsis-downstream-util', 'source' => 'generic/rfc2670.docsis-if.xml' }, 'RFC2670_DOCS_IF::docsis-upstream-subtree' => { 'name' => 'docsis-upstream-subtree', 'source' => 'generic/rfc2670.docsis-if.xml' }, 'RFC2670_DOCS_IF::docsis-upstream-stats' => { 'name' => 'docsis-upstream-stats', 'source' => 'generic/rfc2670.docsis-if.xml' }, #### RFC2790_HOST_RESOURCES 'RFC2790_HOST_RESOURCES::hr-system-performance-subtree' => { 'name' => 'hr-system-performance-subtree', 'source' => 'generic/rfc2790.host-resources.xml' }, 'RFC2790_HOST_RESOURCES::hr-system-uptime' => { 'name' => 'hr-system-uptime', 'source' => 'generic/rfc2790.host-resources.xml' }, 'RFC2790_HOST_RESOURCES::hr-system-num-users' => { 'name' => 'hr-system-num-users', 'source' => 'generic/rfc2790.host-resources.xml' }, 'RFC2790_HOST_RESOURCES::hr-system-processes' => { 'name' => 'hr-system-processes', 'source' => 'generic/rfc2790.host-resources.xml' }, 'RFC2790_HOST_RESOURCES::hr-processor-load' => { 'name' => 'hr-processor-load', 'source' => 'generic/rfc2790.host-resources.xml' }, 'RFC2790_HOST_RESOURCES::hr-storage-subtree' => { 'name' => 'hr-storage-subtree', 'source' => 'generic/rfc2790.host-resources.xml' }, 'RFC2790_HOST_RESOURCES::hr-storage-usage' => { 'name' => 'hr-storage-usage', 'source' => 'generic/rfc2790.host-resources.xml' }, #### ADSL-LINE-MIB 'RFC2662_ADSL_LINE::adsl-line-snr' => { 'name' => 'adsl-line-snr', 'source' => 'generic/rfc2662.adsl-line.xml' }, 'RFC2662_ADSL_LINE::adsl-line-atn' => { 'name' => 'adsl-line-atn', 'source' => 'generic/rfc2662.adsl-line.xml' }, 'RFC2662_ADSL_LINE::adsl-line-attrate' => { 'name' => 'adsl-line-attrate', 'source' => 'generic/rfc2662.adsl-line.xml' }, 'RFC2662_ADSL_LINE::adsl-channel-txrate' => { 'name' => 'adsl-channel-txrate', 'source' => 'generic/rfc2662.adsl-line.xml' }, 'RFC2662_ADSL_LINE::adsl-perf-lofs' => { 'name' => 'adsl-perf-lofs', 'source' => 'generic/rfc2662.adsl-line.xml' }, 'RFC2662_ADSL_LINE::adsl-perf-loss' => { 'name' => 'adsl-perf-loss', 'source' => 'generic/rfc2662.adsl-line.xml' }, 'RFC2662_ADSL_LINE::adsl-perf-lprs' => { 'name' => 'adsl-perf-lprs', 'source' => 'generic/rfc2662.adsl-line.xml' }, 'RFC2662_ADSL_LINE::adsl-perf-ess' => { 'name' => 'adsl-perf-ess', 'source' => 'generic/rfc2662.adsl-line.xml' }, 'RFC2662_ADSL_LINE::adsl-perf-inits' => { 'name' => 'adsl-perf-inits', 'source' => 'generic/rfc2662.adsl-line.xml' }, #### IP-MIB traffic stats 'RFC4293_IP_MIB::rfc4293-ipmib-subtree' => { 'name' => 'rfc4293-ipmib-subtree', 'source' => 'generic/rfc4293.ip-mib.xml' }, 'RFC4293_IP_MIB::ipifstats-hcoctets' => { 'name' => 'ipifstats-hcoctets', 'source' => 'generic/rfc4293.ip-mib.xml' }, #### HDSL2-SHDSL-LINE-MIB 'RFC4319_HDSL2_SHDSL_LINE_MIB::hdsl-subtree' => { 'name' => 'hdsl-subtree', 'source' => 'generic/rfc4319_hdsl2_shdsl_line.xml' }, 'RFC4319_HDSL2_SHDSL_LINE_MIB::hdsl-interface' => { 'name' => 'hdsl-interface', 'source' => 'generic/rfc4319_hdsl2_shdsl_line.xml' }, 'RFC4319_HDSL2_SHDSL_LINE_MIB::hdsl-endpoint' => { 'name' => 'hdsl-endpoint', 'source' => 'generic/rfc4319_hdsl2_shdsl_line.xml' }, #### Albis technologies ULAF 'Albis_ULAF::albis-soam-lm-subtree' => { 'name' => 'albis-soam-lm-subtree', 'source' => 'vendor/albis-ulaf.xml' }, 'Albis_ULAF::albis-soam-lm' => { 'name' => 'albis-soam-lm', 'source' => 'vendor/albis-ulaf.xml' }, 'Albis_ULAF::albis-soam-dm-subtree' => { 'name' => 'albis-soam-dm-subtree', 'source' => 'vendor/albis-ulaf.xml' }, 'Albis_ULAF::albis-soam-dm' => { 'name' => 'albis-soam-dm', 'source' => 'vendor/albis-ulaf.xml' }, #### Alteon application switches 'Alteon::alteon-cpu' => { 'name' => 'alteon-cpu', 'source' => 'vendor/alteon.xml' }, 'Alteon::alteon-mem' => { 'name' => 'alteon-mem', 'source' => 'vendor/alteon.xml' }, 'Alteon::alteon-packets' => { 'name' => 'alteon-packets', 'source' => 'vendor/alteon.xml' }, 'Alteon::alteon-sensor' => { 'name' => 'alteon-sensor', 'source' => 'vendor/alteon.xml' }, 'Alteon::alteon-vserver-subtree' => { 'name' => 'alteon-vserver-subtree', 'source' => 'vendor/alteon.xml' }, 'Alteon::alteon-vserver' => { 'name' => 'alteon-vserver', 'source' => 'vendor/alteon.xml' }, 'Alteon::alteon-maint-subtree' => { 'name' => 'alteon-maint-subtree', 'source' => 'vendor/alteon.xml' }, 'Alteon::alteon-maint' => { 'name' => 'alteon-maint', 'source' => 'vendor/alteon.xml' }, #### Alcatel-Lucent ESS and SR 'ALU_Timetra::alu-timetra-customer' => { 'name' => 'alu-timetra-customer', 'source' => 'vendor/alu-timetra.xml' }, 'ALU_Timetra::alu-timetra-sap' => { 'name' => 'alu-timetra-sap', 'source' => 'vendor/alu-timetra.xml' }, #### APC Powernet 'APC_PowerNet::apc-pdu2-subtree' => { 'name' => 'apc-pdu2-subtree', 'source' => 'vendor/apc.powernet.xml' }, 'APC_PowerNet::apc-pdu2-phase' => { 'name' => 'apc-pdu2-phase', 'source' => 'vendor/apc.powernet.xml' }, 'APC_PowerNet::apc-pdu2-bank' => { 'name' => 'apc-pdu2-bank', 'source' => 'vendor/apc.powernet.xml' }, 'APC_PowerNet::apc-pdu-subtree' => { 'name' => 'apc-pdu-subtree', 'source' => 'vendor/apc.powernet.xml' }, 'APC_PowerNet::apc-pdu-stat' => { 'name' => 'apc-pdu-stat', 'source' => 'vendor/apc.powernet.xml' }, 'APC_PowerNet::apc-mem-subtree' => { 'name' => 'apc-mem-subtree', 'source' => 'vendor/apc.powernet.xml' }, 'APC_PowerNet::apc-mem-sensor' => { 'name' => 'apc-mem-sensor', 'source' => 'vendor/apc.powernet.xml' }, #### Apple Airport Extreme 'Apple_AE::ae-wireless-clients-subtree' => { 'name' => 'ae-wireless-clients-subtree', 'source' => 'vendor/apple.ae.xml' }, 'Apple_AE::ae-wireless-clients-leaf' => { 'name' => 'ae-wireless-clients-leaf', 'source' => 'vendor/apple.ae.xml' }, 'Apple_AE::ae-global-stats' => { 'name' => 'ae-global-stats', 'source' => 'vendor/apple.ae.xml' }, #### Arbor Networks E Series 'Arbor_E::arbor-bundle-subtree' => { 'name' => 'arbor-bundle-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::arbor-bundle' => { 'name' => 'arbor-bundle', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::arbor-bundle-deny' => { 'name' => 'arbor-bundle-deny', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::arbor-bundle-pktsize' => { 'name' => 'arbor-bundle-pktsize', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::arbor-bundle-ratelimit' => { 'name' => 'arbor-bundle-ratelimit', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::arbor-bundle-subcount' => { 'name' => 'arbor-bundle-subcount', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::arbor-flowlkup-subtree' => { 'name' => 'arbor-flowlkup-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::arbor-flowlkup' => { 'name' => 'arbor-flowlkup', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::arbor-flowlkup-leaf' => { 'name' => 'arbor-flowlkup-leaf', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-buffers' => { 'name' => 'e30-buffers', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-bundle-subtree' => { 'name' => 'e30-bundle-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-bundle' => { 'name' => 'e30-bundle', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-bundle-deny' => { 'name' => 'e30-bundle-deny', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-bundle-ratelimit' => { 'name' => 'e30-bundle-ratelimit', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-cpu' => { 'name' => 'e30-cpu', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-fwdTable' => { 'name' => 'e30-fwdTable', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-fwdTable-login' => { 'name' => 'e30-fwdTable-login', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-hdd-subtree' => { 'name' => 'e30-hdd-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-hdd' => { 'name' => 'e30-hdd', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-hdd-errors' => { 'name' => 'e30-hdd-errors', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-hdd-logs' => { 'name' => 'e30-hdd-logs', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-l2tp-subtree' => { 'name' => 'e30-l2tp-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-l2tp' => { 'name' => 'e30-l2tp', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-l2tp-secure-endpoints-subtree' => { 'name' => 'e30-l2tp-secure-endpoints-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-l2tp-secure-endpoints-leaf' => { 'name' => 'e30-l2tp-secure-endpoints-leaf', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-mem' => { 'name' => 'e30-mem', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-mempool-subtree' => { 'name' => 'e30-mempool-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-mempool' => { 'name' => 'e30-mempool', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e30-slowpath' => { 'name' => 'e30-slowpath', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e100-cpu-subtree' => { 'name' => 'e100-cpu-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e100-cpu' => { 'name' => 'e100-cpu', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e100-hdd-subtree' => { 'name' => 'e100-hdd-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e100-hdd' => { 'name' => 'e100-hdd', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e100-mem-subtree' => { 'name' => 'e100-mem-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e100-mem' => { 'name' => 'e100-mem', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e100-policymgmt' => { 'name' => 'e100-policymgmt', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e100-submgmt-subtree' => { 'name' => 'e100-submgmt-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e100-submgmt-state-subtree' => { 'name' => 'e100-submgmt-state-subtree', 'source' => 'vendor/arbor_e.xml' }, 'Arbor_E::e100-submgmt-state' => { 'name' => 'e100-submgmt-state', 'source' => 'vendor/arbor_e.xml' }, #### ATMEL smartbridges 'ATMEL::atmel-device-subtree' => { 'name' => 'atmel-device-subtree', 'source' => 'vendor/atmel.xml' }, 'ATMEL::atmel-accesspoint-stats' => { 'name' => 'atmel-accesspoint-stats', 'source' => 'vendor/atmel.xml' }, 'ATMEL::atmel-client-stats' => { 'name' => 'atmel-client-stats', 'source' => 'vendor/atmel.xml' }, #### AscendMax 'AscendMax::ascend-totalcalls' => { 'name' => 'ascend-totalcalls', 'source' => 'vendor/ascend.max.xml' }, 'AscendMax::ascend-line-stats' => { 'name' => 'ascend-line-stats', 'source' => 'vendor/ascend.max.xml' }, #### BetterNetworks 'BetterNetworks::betternetworks-sensor' => { 'name' => 'betternetworks-sensor', 'source' => 'vendor/betternetworks.xml' }, #### CASA Systems CMTS 'CasaCMTS::casa-docsis-mac-subtree' => { 'name' => 'casa-docsis-mac-subtree', 'source' => 'vendor/casa-cmts.xml' }, 'CasaCMTS::casa-docsis-mac-util' => { 'name' => 'casa-docsis-mac-util', 'source' => 'vendor/casa-cmts.xml' }, 'CasaCMTS::casa-docsis-upstream-util' => { 'name' => 'casa-docsis-upstream-util', 'source' => 'vendor/casa-cmts.xml' }, 'CasaCMTS::casa-docsis-downstream-util' => { 'name' => 'casa-docsis-downstream-util', 'source' => 'vendor/casa-cmts.xml' }, #### Cisco 'CiscoGeneric::cisco-cpu' => { 'name' => 'cisco-cpu', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::cisco-cpu-revised' => { 'name' => 'cisco-cpu-revised', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::cisco-cpu-usage-subtree' => { 'name' => 'cisco-cpu-usage-subtree', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::old-cisco-cpu' => { 'name' => 'old-cisco-cpu', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::old-cisco-mempool' => { 'name' => 'cisco-mempool', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::cisco-mempool' => { 'name' => 'cisco-mempool', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::cisco-enh-mempool' => { 'name' => 'cisco-enh-mempool', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::cisco-enh-mempool-hc' => { 'name' => 'cisco-enh-mempool-hc', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::cisco-memusage-subtree' => { 'name' => 'cisco-memusage-subtree', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::cisco-temperature-subtree' => { 'name' => 'cisco-temperature-subtree', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::cisco-temperature-sensor' => { 'name' => 'cisco-temperature-sensor', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::cisco-temperature-sensor-fahrenheit' => { 'name' => 'cisco-temperature-sensor-fahrenheit', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::cisco-power-supply' => { 'name' => 'cisco-power-supply', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoGeneric::cisco-system-ext-mib' => { 'name' => 'cisco-system-ext-mib', 'source' => 'vendor/cisco.generic.xml' }, 'CiscoIOS::cisco-interface-counters' => { 'name' => 'cisco-interface-counters', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS::old-cisco-memory-buffers' => { 'name' => 'old-cisco-memory-buffers', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS::cisco-ipsec-flow-globals' => { 'name' => 'cisco-ipsec-flow-globals', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS::cisco-bgp' => { 'name' => 'cisco-bgp', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS::cisco-car-subtree' => { 'name' => 'cisco-car-subtree', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS::cisco-car' => { 'name' => 'cisco-car', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS::cisco-vpdn-subtree' => { 'name' => 'cisco-vpdn-subtree', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS::cisco-vpdn-leaf' => { 'name' => 'cisco-vpdn-leaf', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS::cisco-3g-gsm-stats' => { 'name' => 'cisco-3g-gsm-stats', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS::cisco-port-qos-packets' => { 'name' => 'cisco-port-qos-packets', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS_Docsis::cisco-docsis-mac-subtree' => { 'name' => 'cisco-docsis-mac-subtree', 'source' => 'vendor/cisco.ios.docsis.xml' }, 'CiscoIOS_Docsis::cisco-docsis-mac-util' => { 'name' => 'cisco-docsis-mac-util', 'source' => 'vendor/cisco.ios.docsis.xml' }, 'CiscoIOS_Docsis::cisco-docsis-upstream-util' => { 'name' => 'cisco-docsis-upstream-util', 'source' => 'vendor/cisco.ios.docsis.xml' }, 'CiscoIOS_MacAccounting::cisco-macacc-subtree' => { 'name' => 'cisco-macacc-subtree', 'source' => 'vendor/cisco.ios.mac-accounting.xml' }, 'CiscoIOS_MacAccounting::cisco-macacc' => { 'name' => 'cisco-macacc', 'source' => 'vendor/cisco.ios.mac-accounting.xml' }, 'CiscoIOS_SAA::cisco-saa-subtree' => { 'name' => 'cisco-saa-subtree', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS_SAA::cisco-rtt-echo-subtree' => { 'name' => 'cisco-rtt-echo-subtree', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoIOS_SAA::cisco-rtt-jitter-subtree' => { 'name' => 'cisco-rtt-jitter-subtree', 'source' => 'vendor/cisco.ios.xml' }, 'CiscoFirewall::cisco-firewall-subtree' => { 'name' => 'cisco-firewall-subtree', 'source' => 'vendor/cisco.firewall.xml', }, 'CiscoFirewall::events' => { 'name' => 'cisco-firewall-events-delta', 'source' => 'vendor/cisco.firewall.xml', }, 'CiscoFirewall::connections' => { 'name' => 'cisco-firewall-connections', 'source' => 'vendor/cisco.firewall.xml', }, 'CiscoSCE::cisco-sce-disk' => { 'name' => 'cisco-sce-disk', 'source' => 'vendor/cisco.sce.xml', }, 'CiscoSCE::cisco-sce-subscribers' => { 'name' => 'cisco-sce-subscribers', 'source' => 'vendor/cisco.sce.xml', }, 'CiscoSCE::cisco-sce-tp-subtree' => { 'name' => 'cisco-sce-tp-subtree', 'source' => 'vendor/cisco.sce.xml', }, 'CiscoSCE::cisco-sce-tp' => { 'name' => 'cisco-sce-tp', 'source' => 'vendor/cisco.sce.xml', }, 'CiscoSCE::cisco-sce-rdr' => { 'name' => 'cisco-sce-rdr', 'source' => 'vendor/cisco.sce.xml', }, 'CiscoSCE::cisco-sce-rdr-category' => { 'name' => 'cisco-sce-rdr-category', 'source' => 'vendor/cisco.sce.xml', }, 'CiscoSCE::cisco-sce-rdr-category-subtree' => { 'name' => 'cisco-sce-rdr-category-subtree', 'source' => 'vendor/cisco.sce.xml', }, 'CiscoSCE::cisco-sce-queues-subtree' => { 'name' => 'cisco-sce-queues-subtree', 'source' => 'vendor/cisco.sce.xml', }, 'CiscoSCE::cisco-sce-gc-subtree' => { 'name' => 'cisco-sce-gc-subtree', 'source' => 'vendor/cisco.sce.xml', }, 'CiscoSCE::cisco-sce-gcounter' => { 'name' => 'cisco-sce-gcounter', 'source' => 'vendor/cisco.sce.xml', }, 'CiscoVDSL::cvdsl-subtree' => { 'name' => 'cvdsl-subtree', 'source' => 'vendor/cisco.vdsl-line.xml', }, 'CiscoVDSL::cvdsl-interface' => { 'name' => 'cvdsl-interface', 'source' => 'vendor/cisco.vdsl-line.xml', }, 'CiscoWLC::ciscowlc-clients-subtree' => { 'name' => 'ciscowlc-clients-subtree', 'source' => 'vendor/cisco.wlc.xml', }, 'CiscoWLC::ciscowlc-ess-leaf' => { 'name' => 'ciscowlc-ess-leaf', 'source' => 'vendor/cisco.wlc.xml', }, ### Compaq Insite Manager 'CompaqCIM::cpq-cim-temperature-sensor' => { 'name' => 'cpq-cim-temperature-sensor', 'source' => 'vendor/compaq.cim.xml', }, 'CompaqCIM::cpq-cim-corr-mem-errs' => { 'name' => 'cpq-cim-corr-mem-errs', 'source' => 'vendor/compaq.cim.xml', }, ### Comtech EF Data 'ComtechEFData::cdm570' => { 'name' => 'cdm570', 'source' => 'vendor/comtechefdata.xml', }, 'ComtechEFData::cdmip' => { 'name' => 'cdmip', 'source' => 'vendor/comtechefdata.xml', }, #### Empire Sysedge 'EmpireSystemedge::sysedge_opmode' => { 'name' => 'sysedge_opmode', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-memory' => { 'name' => 'empire-memory', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-swap-counters-nt' => { 'name' => 'empire-swap-counters-nt', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-swap-counters-nt40Intel' => { 'name' => 'empire-swap-counters-nt40Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-swap-counters-nt50Intel' => { 'name' => 'empire-swap-counters-nt50Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-swap-counters-unix' => { 'name' => 'empire-swap-counters-unix', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-swap-counters-solarisSparc' => { 'name' => 'empire-swap-counters-solarisSparc', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-swap-counters-aix5RS6000' => { 'name' => 'empire-swap-counters-aix5RS6000', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-swap-counters-linuxIntel' => { 'name' => 'empire-swap-counters-linuxIntel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-performance' => { 'name' => 'empire-performance', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-device-subtree' => { 'name' => 'empire-device-subtree', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-device' => { 'name' => 'empire-device', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-load' => { 'name' => 'empire-load', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-subtree' => { 'name' => 'empire-cpu-subtree', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-nt' => { 'name' => 'empire-cpu-nt', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-nt40Intel' => { 'name' => 'empire-cpu-nt40Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-nt50Intel' => { 'name' => 'empire-cpu-nt50Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-unix' => { 'name' => 'empire-cpu-unix', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-solarisSparc' => { 'name' => 'empire-cpu-solarisSparc', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-aix5RS6000' => { 'name' => 'empire-cpu-aix5RS6000', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-linuxIntel' => { 'name' => 'empire-cpu-linuxIntel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-nt' => { 'name' => 'empire-total-cpu-nt', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-nt40Intel' => { 'name' => 'empire-total-cpu-nt40Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-nt50Intel' => { 'name' => 'empire-total-cpu-nt50Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-unix' => { 'name' => 'empire-total-cpu-unix', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-solarisSparc' => { 'name' => 'empire-total-cpu-solarisSparc', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-aix5RS6000' => { 'name' => 'empire-total-cpu-aix5RS6000', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-linuxIntel' => { 'name' => 'empire-total-cpu-linuxIntel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-raw-unix' => { 'name' => 'empire-cpu-raw-unix', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-raw-solarisSparc' => { 'name' => 'empire-cpu-raw-solarisSparc', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-raw-aix5RS6000' => { 'name' => 'empire-cpu-raw-aix5RS6000', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-raw-linuxIntel' => { 'name' => 'empire-cpu-raw-linuxIntel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-raw-nt' => { 'name' => 'empire-cpu-raw-nt', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-raw-nt40Intel' => { 'name' => 'empire-cpu-raw-nt40Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-cpu-raw-nt50Intel' => { 'name' => 'empire-cpu-raw-nt50Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-raw-nt' => { 'name' => 'empire-total-cpu-raw-nt', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-raw-nt40Intel' => { 'name' => 'empire-total-cpu-raw-nt40Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-raw-nt50Intel' => { 'name' => 'empire-total-cpu-raw-nt50Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-raw-unix' => { 'name' => 'empire-total-cpu-raw-unix', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-raw-solarisSparc' => { 'name' => 'empire-total-cpu-raw-solarisSparc', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-raw-aix5RS6000' => { 'name' => 'empire-total-cpu-raw-aix5RS6000', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-total-cpu-raw-linuxIntel' => { 'name' => 'empire-total-cpu-raw-linuxIntel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-counters-nt' => { 'name' => 'empire-counters-nt', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-counters-nt40Intel' => { 'name' => 'empire-counters-nt40Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-counters-nt50Intel' => { 'name' => 'empire-counters-nt50Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-counters-unix' => { 'name' => 'empire-counters-unix', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-counters-solarisSparc' => { 'name' => 'empire-counters-solarisSparc', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-counters-aix5RS6000' => { 'name' => 'empire-counters-aix5RS6000', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-counters-linuxIntel' => { 'name' => 'empire-counters-linuxIntel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-runq' => { 'name' => 'empire-runq', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-diskwait' => { 'name' => 'empire-diskwait', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-pagewait' => { 'name' => 'empire-pagewait', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-swapactive' => { 'name' => 'empire-swapactive', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-sleepactive' => { 'name' => 'empire-sleepactive', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-disk-stats-subtree' => { 'name' => 'empire-disk-stats-subtree', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-disk-stats-unix' => { 'name' => 'empire-disk-stats-unix', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-disk-stats-solarisSparc' => { 'name' => 'empire-disk-stats-solarisSparc', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-disk-stats-aix5RS6000' => { 'name' => 'empire-disk-stats-aix5RS6000', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-disk-stats-linuxIntel' => { 'name' => 'empire-disk-stats-linuxIntel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-disk-stats-nt' => { 'name' => 'empire-disk-stats-nt', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-disk-stats-nt40Intel' => { 'name' => 'empire-disk-stats-nt40Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-disk-stats-nt50Intel' => { 'name' => 'empire-disk-stats-nt50Intel', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-svc-subtree' => { 'name' => 'empire-svc-subtree', 'source' => 'vendor/empire.systemedge.xml', }, 'EmpireSystemedge::empire-svc-response' => { 'name' => 'empire-svc-response', 'source' => 'vendor/empire.systemedge.xml', }, #### F5 BigIP 'F5BigIp::f5-global-host' => { 'name' => 'f5-global-host', 'source' => 'vendor/f5.bigip.xml', }, 'F5BigIp::f5-multihost-host' => { 'name' => 'f5-multihost-host', 'source' => 'vendor/f5.bigip.xml', }, 'F5BigIp::f5-multihost-cpu-subtree' => { 'name' => 'f5-multihost-cpu-subtree', 'source' => 'vendor/f5.bigip.xml', }, 'F5BigIp::f5-multihost-cpu' => { 'name' => 'f5-multihost-cpu', 'source' => 'vendor/f5.bigip.xml', }, 'F5BigIp::f5-interface-counters-subtree' => { 'name' => 'f5-interface-counters-subtree', 'source' => 'vendor/f5.bigip.xml', }, 'F5BigIp::f5-interface' => { 'name' => 'f5-interface', 'source' => 'vendor/f5.bigip.xml', }, 'F5BigIp::f5-object-statistics' => { 'name' => 'f5-object-statistics', 'source' => 'vendor/f5.bigip.xml', }, 'F5BigIp::ltm-node-statistics' => { 'name' => 'ltm-node-statistics', 'source' => 'vendor/f5.bigip.xml', }, 'F5BigIp::ltm-pool-statistics' => { 'name' => 'ltm-pool-statistics', 'source' => 'vendor/f5.bigip.xml', }, 'F5BigIp::ltm-poolmember-statistics' => { 'name' => 'ltm-poolmember-statistics', 'source' => 'vendor/f5.bigip.xml', }, 'F5BigIp::ltm-vserver-statistics' => { 'name' => 'ltm-vserver-statistics', 'source' => 'vendor/f5.bigip.xml', }, 'F5BigIp::f5-category-subtree' => { 'name' => 'f5-category-subtree', 'source' => 'vendor/f5.bigip.xml', }, #### Fortinet 'Fortinet::fortigate-system-stats' => { 'name' => 'fortigate-system-stats', 'source' => 'vendor/fortinet.xml', }, 'Fortinet::fortigate-cpu' => { 'name' => 'fortigate-cpu', 'source' => 'vendor/fortinet.xml', }, 'Fortinet::fortigate-vdoms-subtree' => { 'name' => 'fortigate-vdoms-subtree', 'source' => 'vendor/fortinet.xml', }, 'Fortinet::fortigate-vdom' => { 'name' => 'fortigate-vdom', 'source' => 'vendor/fortinet.xml', }, 'Fortinet::fortimanager-system-stats' => { 'name' => 'fortimanager-system-stats', 'source' => 'vendor/fortinet.xml', }, #### MicrosoftWindows 'MicrosoftWindows::microsoft-iis-ftp-stats' => { 'name' => 'microsoft-iis-ftp-stats', 'source' => 'vendor/microsoft.windows.xml', }, 'MicrosoftWindows::microsoft-iis-http-stats' => { 'name' => 'microsoft-iis-http-stats', 'source' => 'vendor/microsoft.windows.xml', }, #### Motorola BSR 'MotorolaBSR::motorola-bsr-docsis-upstream-util' => { 'name' => 'motorola-bsr-docsis-upstream-util', 'source' => 'vendor/motorola.bsr.xml', }, ##### Foundry/Brocade 'Foundry::fdry-chass-temperature' => { 'name' => 'fdry-chass-temperature', 'source' => 'vendor/foundry.xml', }, 'Foundry::fdry-board-overview' => { 'name' => 'fdry-board-overview', 'source' => 'vendor/foundry.xml', }, 'Foundry::fdry-board-subtree' => { 'name' => 'fdry-board-subtree', 'source' => 'vendor/foundry.xml', }, 'Foundry::fdry-board-memstats' => { 'name' => 'fdry-board-memstats', 'source' => 'vendor/foundry.xml', }, 'Foundry::fdry-board-cpustats' => { 'name' => 'fdry-board-cpustats', 'source' => 'vendor/foundry.xml', }, 'Foundry::fdry-board-tempstats' => { 'name' => 'fdry-board-tempstats', 'source' => 'vendor/foundry.xml', }, 'Foundry::fdry-board-temp-sensor-halfcelsius' => { 'name' => 'fdry-board-temp-sensor-halfcelsius', 'source' => 'vendor/foundry.xml', }, ##### Force10 networks (by Jon Nistor) 'FTOS::ftos-cpu-subtree' => { 'name' => 'ftos-cpu-subtree', 'source' => 'vendor/ftos.xml', }, 'FTOS::ftos-cpu' => { 'name' => 'ftos-cpu', 'source' => 'vendor/ftos.xml', }, 'FTOS::ftos-power-supply-leaf' => { 'name' => 'ftos-power-supply-leaf', 'source' => 'vendor/ftos.xml', }, 'FTOS::ftos-temperature-subtree' => { 'name' => 'ftos-temperature-subtree', 'source' => 'vendor/ftos.xml', }, 'FTOS::ftos-temperature-sensor' => { 'name' => 'ftos-temperature-sensor', 'source' => 'vendor/ftos.xml', }, 'FTOS::ftos-temperature-sensor-fahrenheit' => { 'name' => 'ftos-temperature-sensor-fahrenheit', 'source' => 'vendor/ftos.xml', }, #### Jacarta 'Jacarta::imeter-amps-sensor' => { 'name' => 'imeter-amps-sensor', 'source' => 'vendor/jacarta.xml', }, 'Jacarta::imeter-humi-sensor' => { 'name' => 'imeter-humi-sensor', 'source' => 'vendor/jacarta.xml', }, 'Jacarta::imeter-temp-sensor' => { 'name' => 'imeter-temp-sensor', 'source' => 'vendor/jacarta.xml', }, ##### Juniper JunOS (by Jon Nistor) 'JunOS::junos-cos-subtree' => { 'name' => 'junos-cos-subtree', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-cos-subtree-interface' => { 'name' => 'junos-cos-subtree-interface', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-cos-leaf' => { 'name' => 'junos-cos-leaf', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-cos-red' => { 'name' => 'junos-cos-red', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-cos-tail' => { 'name' => 'junos-cos-tail', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-cpu-subtree' => { 'name' => 'junos-cpu-subtree', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-cpu' => { 'name' => 'junos-cpu', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-firewall-subtree' => { 'name' => 'junos-firewall-subtree', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-firewall-filter-subtree' => { 'name' => 'junos-firewall-filter-subtree', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-firewall-filter' => { 'name' => 'junos-firewall-filter', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-firewall-filter-counter' => { 'name' => 'junos-firewall-filter-counter', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-firewall-filter-policer' => { 'name' => 'junos-firewall-filter-policer', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-memory-subtree' => { 'name' => 'junos-memory-subtree', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-memory' => { 'name' => 'junos-memory', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-rpf-subtree' => { 'name' => 'junos-rpf-subtree', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-rpf' => { 'name' => 'junos-rpf', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-temperature-subtree' => { 'name' => 'junos-temperature-subtree', 'source' => 'vendor/junos.xml', }, 'JunOS::junos-temperature-sensor' => { 'name' => 'junos-temperature-sensor', 'source' => 'vendor/junos.xml', }, ##### Liebert 'Liebert::humidity-sensor' => { 'name' => 'humidity-sensor', 'source' => 'vendor/liebert.xml', }, 'Liebert::humidity-subtree' => { 'name' => 'humidity-subtree', 'source' => 'vendor/liebert.xml', }, 'Liebert::state-subtree' => { 'name' => 'state-subtree', 'source' => 'vendor/liebert.xml', }, 'Liebert::state-capacity' => { 'name' => 'state-capacity', 'source' => 'vendor/liebert.xml', }, 'Liebert::temperature-subtree' => { 'name' => 'temperature-subtree', 'source' => 'vendor/liebert.xml', }, 'Liebert::temperature-sensor' => { 'name' => 'temperature-sensor', 'source' => 'vendor/liebert.xml', }, 'Liebert::temperature-sensor-fahrenheit' => { 'name' => 'temperature-sensor-fahrenheit', 'source' => 'vendor/liebert.xml', }, ##### Ucd Snmp 'UcdSnmp::ucdsnmp-memory-real' => { 'name' => 'ucdsnmp-memory-real', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-memory-swap' => { 'name' => 'ucdsnmp-memory-swap', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-blockio' => { 'name' => 'ucdsnmp-blockio', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-raw-interrupts' => { 'name' => 'ucdsnmp-raw-interrupts', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-user-multi' => { 'name' => 'ucdsnmp-cpu-user-multi', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-user' => { 'name' => 'ucdsnmp-cpu-user', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-system-multi' => { 'name' => 'ucdsnmp-cpu-system-multi', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-system' => { 'name' => 'ucdsnmp-cpu-system', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-wait-multi' => { 'name' => 'ucdsnmp-cpu-wait-multi', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-wait' => { 'name' => 'ucdsnmp-cpu-wait', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-kernel-multi' => { 'name' => 'ucdsnmp-cpu-kernel-multi', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-kernel' => { 'name' => 'ucdsnmp-cpu-kernel', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-idle-multi' => { 'name' => 'ucdsnmp-cpu-idle-multi', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-idle' => { 'name' => 'ucdsnmp-cpu-idle', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-nice-multi' => { 'name' => 'ucdsnmp-cpu-nice-multi', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-nice' => { 'name' => 'ucdsnmp-cpu-nice', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-interrupts-multi' => { 'name' => 'ucdsnmp-cpu-interrupts-multi', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-softirq' => { 'name' => 'ucdsnmp-cpu-softirq', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-softirq-multi' => { 'name' => 'ucdsnmp-cpu-softirq-multi', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-cpu-interrupts' => { 'name' => 'ucdsnmp-cpu-interrupts', 'source' => 'vendor/ucd.ucd-snmp.xml', }, 'UcdSnmp::ucdsnmp-load-average' => { 'name' => 'ucdsnmp-load-average', 'source' => 'vendor/ucd.ucd-snmp.xml', }, #### NetApp (Network Appliance) 'NetApp::CPU' => { 'name' => 'netapp-cpu', 'source' => 'vendor/netapp.filer.xml', }, 'NetApp::misc' => { 'name' => 'netapp-misc', 'source' => 'vendor/netapp.filer.xml', }, 'NetApp::nfsv2' => { 'name' => 'netapp-nfsv2', 'source' => 'vendor/netapp.filer.xml', }, 'NetApp::nfsv3' => { 'name' => 'netapp-nfsv3', 'source' => 'vendor/netapp.filer.xml', }, 'NetApp::cifs' => { 'name' => 'netapp-cifs', 'source' => 'vendor/netapp.filer.xml', }, #### NetBotz 'NetBotz::netbotz-temp-sensor' => { 'name' => 'netbotz-temp-sensor', 'source' => 'vendor/netbotz.xml', }, 'NetBotz::netbotz-humi-sensor' => { 'name' => 'netbotz-humi-sensor', 'source' => 'vendor/netbotz.xml', }, 'NetBotz::netbotz-dew-sensor' => { 'name' => 'netbotz-dew-sensor', 'source' => 'vendor/netbotz.xml', }, 'NetBotz::netbotz-audio-sensor' => { 'name' => 'netbotz-audio-sensor', 'source' => 'vendor/netbotz.xml', }, 'NetBotz::netbotz-air-sensor' => { 'name' => 'netbotz-air-sensor', 'source' => 'vendor/netbotz.xml', }, 'NetBotz::netbotz-door-sensor' => { 'name' => 'netbotz-door-sensor', 'source' => 'vendor/netbotz.xml', }, #### NetScreen 'NetScreen::netscreen-cpu-stats' => { 'name' => 'netscreen-cpu-stats', 'source' => 'vendor/netscreen.xml', }, 'NetScreen::netscreen-memory-stats' => { 'name' => 'netscreen-memory-stats', 'source' => 'vendor/netscreen.xml', }, 'NetScreen::netscreen-sessions-stats' => { 'name' => 'netscreen-sessions-stats', 'source' => 'vendor/netscreen.xml', }, #### OracleDatabase 'OracleDatabase::Sys' => { 'name' => 'oracle-database-sys', 'source' => 'vendor/oracle.database.xml', }, 'OracleDatabase::CacheSum' => { 'name' => 'oracle-cache-sum', 'source' => 'vendor/oracle.database.xml', }, 'OracleDatabase::SGA' => { 'name' => 'oracle-sga', 'source' => 'vendor/oracle.database.xml', }, 'OracleDatabase::table-space' => { 'name' => 'oracle-table-space', 'source' => 'vendor/oracle.database.xml', }, 'OracleDatabase::data-file' => { 'name' => 'oracle-data-file', 'source' => 'vendor/oracle.database.xml', }, 'OracleDatabase::library-cache' => { 'name' => 'oracle-library-cache', 'source' => 'vendor/oracle.database.xml', }, #### Paradyne 'Paradyne::paradyne-xdsl-interface' => { 'name' => 'paradyne-xdsl-interface', 'source' => 'vendor/paradyne.xdsl.xml' }, #### Symmetricom 'Symmetricom::ntp-stats' => { 'name' => 'ntp-stats', 'source' => 'vendor/symmetricom.xml' }, ); ########################## # Common parameters # If true, data-dir would be hashed across a number of subdirectories # Only concatenation of hostname and domain name is hashed. $Torrus::DevDiscover::hashDataDirEnabled = 0; # Format for hashed data-dir subdirectory name. The argument is a number # from 0 to bucketSize-1. $Torrus::DevDiscover::hashDataDirFormat = '%.2X'; # How many hashed data-dir subdirectories are used. $Torrus::DevDiscover::hashDataDirBucketSize = 256; ########################## # RFC2790_HOST_RESOURCES parameters # The top level of the Host Resources Storage graph, percentage $Torrus::DevDiscover::RFC2790_HOST_RESOURCES::storageGraphTop = 105; # Where to draw the hi-mark line in Host Resources Storage, percentage $Torrus::DevDiscover::RFC2790_HOST_RESOURCES::storageHiMark = 100; ########################## # EmpireSystemedge parameters # The top level of the Host Resources Storage graph, percentage $Torrus::DevDiscover::EmpireSystemedge::storageGraphTop = 105; # Where to draw the hi-mark line in Empire Storage, percentage $Torrus::DevDiscover::EmpireSystemedge::storageHiMark = 100; ########################## # CiscoIOS parameters # For mkroutercfg compatibility, set this to 1 $Torrus::DevDiscover::CiscoIOS::useCiscoInterfaceCounters = 0; # Read plugin configurations { my $dir = '@plugdevdisccfgdir@'; local *CFGDIR; opendir(CFGDIR, $dir) or die("Cannot open directory $dir: $!"); my @files = grep { !/^\./ } readdir(CFGDIR); closedir( CFGDIR ); foreach my $file ( @files ) { require $dir . '/' . $file; } } require '@devdiscover_siteconfig_pl@'; 1; torrus-3.00/NEWS0000644000175000017500000004262713131655331010426 0000000000000013-JUL-2017: Torrus release 3.00 This release replaces the database back-end completely. Now instead of BerkeleyDB, it uses Git repository as data store. The XML compiler is now incremental, and also the collector updates itself incrementally. The file doc/devdoc/v3_changes contains details on changed software requirements and obsoleted modules. Also new in this release: -- Health status icons for device reachability -- Jitter statistics for Cisco SAA -- Traffic usage statistics are generated in Excel format 17-FEB-2016: Torrus release 2.09 In this release: -- RRDtool 1.4.8 or newer is required -- New and improved SNMP discovery modules (Fortinet, Cisco Nexus, Albis ULAF, F5 BigIP) -- Configuration parameters that prevent Collector and Monitor from exiting when there's no work to do: $Torrus::Collector::runAlways, $Torrus::Monitor::runAlways, and CLI option: --runalways. -- Two new horizontal rules: warn-level, crit-level -- Horizontal rules are drawn semi-transparent -- New discovery parameter: RFC2863_IF_MIB::disable-all to disable all interface stats -- Improvements and new options in the RPC interface -- DNS errors are treated as host unreachable -- New sysvinit startup script, more reliable and providing better control over processes -- other minor bugfixes and improvements 02-OCT-2014: Torrus release 2.08 In this release: -- Fix for a long time hidden bug in Cisco IOS discovery modules. It popped up first under Perl 5.18 -- IPv6 traffic statistics via RFC4293_IP_MIB -- Cisco IOS: support for persistent interface indexes; 64-bit memory statistics; IOS and IOS XR detection from sysDescr string -- Improvements for unknown devices (port name and comment hints) -- RPC interface allows retrieving of time series. -- Support for Albis Technologies ULAF devices -- Support for context name in SNMPv3 -- Event escalation for threshold monitors -- Various improvements in RFC2662_ADSL_LINE discovery module 29-APR-2013: Torrus release 2.07 This is a bugfix release that fixes some problems in tp-cbqos plugin 15-FEB-2013: Torrus release 2.06 In this release: -- F5 BigIP LTM support added -- action_snmptrap now sends the severity level properly -- Bugfix in Cisco QoS plugin: unreachable devices could block the QoS collector from initialization. 07-OCT-2012: Torrus release 2.05 In this release: -- Important bugfixes: collector worked incorrectly with SNMPv1 devices (maxrepetitions parameter is incompatible with v1); "disable-snmpcollector" in DDX produced invalid configuration. -- APC PowerNet: added support for Modular Environmental Manager -- Removed support for F5 BigIP version 4.x because it's end of life and outdated. Support for version 11 is in development. 16-AUG-2012: Torrus release 2.04 In this release: -- Default value for $Torrus::Collector::SNMP::unreachableTimeout is set to 0 instead of 6 hours, and now collector never gives up on unreachable hosts. -- CA eHealth SystemEDGE support is significantly refactored by Roman Hochuli. -- New URL parameters: Gborder, Gcolors. -- New graph view for embedding into external websites: "embedded-small", in addition to the existing "embedded" view. -- Added support for Comtech EF Data satellite modems. -- New plugin: "tp-rrdfit" for updating the existing RRD files to match the torrus conbfiguration. 22-APR-2012: Torrus release 2.03 This is a bugfix release. No new features are added. The MAC address based ifIndex mapping was broken in 2.02. 20-MAR-2012: Torrus release 2.02 In this release: -- Collector and Monitor daemons now send logs to Syslog facility local0 by default. torrus-siteconfig.pl can be used to change the facility or revert to the file logging (file logging is not recommended because of no rotation mechanism). File log rotation on SIGHUP is removed (it never was stable anyway). Syslog to a custom UNIX socket is also supported. -- WebUI: In/Out graphs now use a slightly darker green area. Also new URL arguments are supported to display the maximums alongside averages: Gmaxline, Gmaxlinestep -- RPN expressions can now refer to leaves by their NodeID: [[nodeid]] -- Discovery modules refactored: $dd->walkSnmpTable() is the only recommended way to walk SNMP tables. Older methods are still supported, but deprecated. -- New parameter: "snmp-maxrepetitions", with default value: 10. This ensures proper work of the Collector and Devdiscover when retrieving interface names. -- RFC2863_IF_MIB: interface speed can be monitored (used for Actelis SHDSL modems). -- New parameter "RFC2863_IF_MIB::sort-by-name" disables the sorting by ifIndex. -- New discovery modules: RFC4319_HDSL2_SHDSL_LINE_MIB, APC_PowerNet -- Improved discovery modules: NetBotz, RFC2670_DOCS_IF -- "rrd-create-rra" is now automatically copied from DDX into Torrus configuration. -- Minor bugfixes and improvements to increase the database stability. 04-SEP-2011: Torrus release 2.01 In this release: -- New release numbering scheme. Torrus releases are two-number, and compatible plugins have 3-number versions. -- New discovery modules: CiscoWLC, C-COM CAPSPAN, Thomson_xDSL, Actelis, NexComm, Patton -- New MIBs supported: CISCO-WAN-3G-MIB -- New IF-MIB selector action: AddTemplates -- "rrgraph-view" parameter can be used in tokensets to define the default graph presentation. It can also be set by XXX-tokenset-rrgraph-view in DevDiscover input file. -- RFC2662_ADSL_LINE discovery module is now compatible with Cisco 837 -- Port QoS stats for Cisco ME3400 -- ifDescr and ifName uniqueness is checked before using them as interface identifiers. This eases the use of new devices with their special interface naming. -- WebUI now uses NodeID whenever it is available instead of tokens, and full node paths if NodeID is unavailable. -- MicrosoftWindows discovery module is improved and lots of unneeded IF-MIB interfaces are eliminated. -- New feature: SNMP reachability statistics for devices. -- FastCGI handler is automatically re-spawning every 5000 requests. -- Device uptime is no longer displayed in the graph legend. -- Exclusive collector initialization lock is added for servers with multiple collector processes. This reduces the disk seek concurrency at collector startup. -- Default rrd-create-heartbeat changed from 500 to 720 -- Reduced the possibility for NaN values in RRD files at collector re-initialization -- Integration into external portals: Web RPC, embedded graph view, PDF and SVG formats for the graphs -- New plugin: tp-siam for SIAM library integration. It enables to build customer portals with the use of Extopus software and an external service inventory. See docs/nodeid_usage.pod for more details. 24-OCT-2010: Torrus release 1.0.9 It is recommended to re-run discovery and compilation immediately after upgrading from 1.0.8. In this release: -- WebUI handling is re-designed. FastCGI is supported with Apache and Lighttpd. User authorization option has changed its name: "$Torrus::CGI::authorizeUsers". Login page has now "remember me" checkbox. Apache configuration statements for mod_perl have slightly changed. Removed dependency: libapreq2 is no longer needed. -- New Perl module required by installer: JSON -- New discovery modules: Force10, NetBotz, Arista, ALU_Timetra, Foundry, CasaCMTS, Jacarta. -- Support for semi-transparent lines and areas in multigraphs. -- Support for arbitrary names for subtrees and leaves (node-display-name parameter). Now original interface names are displayed, without underscores. -- Monitor alarms are now preserved between config re-compilations. Also dynamic tokenset members are preserved. A new utility: "torrus flushmonitors" flushes old alarms. -- New parameter: nodeid. It is designed for easier integration of Torrus with other OSS systems. See the "NodeID usage guidelines" document for more details. -- Current SNMP failures are recorded in a database and displayed by "torrus snmpfailures" utility. The output is in JSON format, so it's easy to integrate into other alerting systems. -- RHEL compatibility: the old Init script did not stop the daemons properly upon a system reboot. -- Compatibility with the newest version of Net::SNMP module. -- Host-based authentication: remote systems, such as customer self-care portals, can retrieve graphs from Torrus WebUI. -- Performance optimizations: XML compiler runs 10-15% faster. -- Custom CSS styles must no longer reside in Torrus installation directory. 26-APR-2010: Torrus release 1.0.8bf01 Bugfix release. No new features or functionality. 05-APR-2009: Torrus release 1.0.8 Note: a complete re-compile of the XML is required after upgrading. In this release: -- BerkeleyDB stability has significantly improved due to new signal handlers. -- View parameters can be overridden with URL variables "Gstart", "Gend" and so on. -- Collector initialization time is improved by shifting some work to the XML compiler. -- New command-line utility: srvderive. It combines several serviceIDs into a single report by calculating their sum or maximum value (sponsored by nexellent ag, www.nexellent.ch) -- A number of bugfixes and minor imprvements. -- Added SNMP discovery support for Arbor E series and Liebert HVAC 05-AUG-2008: Torrus release 1.0.7 In this release: -- Added and improved vendor support for Symmetricom, Juniper JunOS, Cisco SCE, -- New discovery parameters, selectors and selector actions. -- Default value for "collector-timeoffset-step" increased from 30 to 60 seconds. 30 seconds is too short for many installations. -- Support for PostgreSQL in reports generator. -- Support for IPv6 in SNMP discovery and collector. -- New collector plugin: "tp-rawexport" for plaintext export of collector data. -- Cisco QoS monitoring plugin "tp-cisco-cbqos" upgraded to version 1.6. It fixes an old bug in RRD file naming, thus all the QoS-related RRD files would have to be renamed or started from scratch. -- Other minor enhancements and bugfixes (see ChangeLog for details). 03-AUG-2007: Torrus release 1.0.6 In this release: -- All the trees need to be recompiled after Torrus upgrade. -- Search capability. The nodes can be searched within a tree or globally. The search database needs to be updated with "torrus buildsearchdb" utility. -- GUI improvements. Recursive view is restricted and is not offered averywhere. Bugfix for Mozilla browser compatibility: now the graph images are clickable. -- devdiscover accepts multiple DDX files. Combined with multithreading, this improves the discovery performance even further. -- SNMP collector periodically refreshes the table mappings. This helps for modular routers with online insertion and removal: the collector does not need to be restarted after the physical configuration changes. Also the OIDs that return noSuchObject are excluded from polling immediately. -- New MIBs support: Cisco SCE per-service traffic statistics; Cisco CAR statistics; Cisco Ethernet MAC accounting statistics now available on subinterfaces; JunOS per-CoS stats; support for Alteon hardware. -- XML statement is no longer supported. Use the rrddir2xml utility instead. -- The CDEF collector from Chrstian Schnidrig is integrated in the main distribution. Devdiscover supports traffic summaries for multiple interfaces. -- The report generator can generate HTML in any tree. Earlier it was generating the reports only for the trees where data was collected. This improvement allows to split the collecting and viewing trees. -- The installer allows multithreading for Perl version 5.8.8 or higher only. Earlier versions are known for memory leaks in multithreaded operation. -- Multiple collector instances per tree. This improves the CPU utilization for multi-CPU servers. See the torrus_collector manpage. 25-JAN-2007: Torrus release 1.0.5 This is a major release with many new features. In this release: -- Bugfixes in SNMPv3 support -- Perl multithreading. If threads are supported by local Perl, Devdiscover can perform parallel discoveries per output file. Also the Collector runs a background thread for RRD updates. -- Improvement in SNMP collector initialization. Now the collector expands the interface names and other maps asynchronously, which dramatically reduces the initialization time for large installations. Cisco QoS plugin needs an upgrade to version 1.4 or higher. -- New vendor support in SNMP discovery engine: Motorola BSR CMTS (ex-Riverdelta), Cisco SCE, BGP prefix statistics for Cisco IOS routers, Cisco IOS XR support. -- DOCSIS upstream statistics have changed the format, therefore the old stats will be lost after upgrade. The stats now include the US Frequency graphs. -- Interface statistics now contain "All Errors" tab with all error graphs in one page. -- Interface traffic graphs may contain bandwidth utilization percentage information (see RFC2863_IF_MIB::bandwidth-usage in SNMP Discovery Guide). -- Cisco MAC accounting can also be used for billing reports. 20-JUL-2006: Torrus release 1.0.4 This is a major release with many new features. In this release: -- SNMP Version 3 support in Devdiscover and SNMP collector. -- Usage reports for billing. Including 95% percentile reports. More details at http://torrus.org/reporting_setup.pod.html -- Various improvements in SNMP discovery engine and new equipment vendor support -- Improved monitor notifications. New parameter: "severity" and new action "action_notify". -- New torrus-siteconfig.pl variables to improve WebUI customization 02-AUG-2005: Torrus release 1.0.3 This is a minor bugfix release. Unreachable device handling is improved, and also there's a possibility to specify extra Perl library path in ./configure 27-JUL-2005: Torrus release 1.0.2 The new release requires one additional Perl module to be installed: Date::Parse. You can install it from CPAN by using the command: perl -MCPAN -e 'install Date::Parse' In this release: -- Unreachable SNMP devices handling has significantly improved. The default unreachable timeout is set to 6 hours. -- Support for the new mod_perl 2.0 layout. -- New OID in TORRUS-MIB: torrusMonitorDesc, for easier processing of SNMP traps. -- ./configure checks if the user "torrus" exists in the system -- New SNMP discovery parameters: RFC2863_IF_MIB::only-interfaces disable-snmpcollector -- On the graph page, it is now possible to choose the date for displaying old statistics. -- The Cisco CPUs are now managed by devdiscover's selectors. This allows you to add monitors to specific CPU graphs, and also add them to a tokenset. 21-JUN-2005: Torrus release 1.0.1 In this release: -- SNMP errors are now handled better. See the User guide for more details. -- New command line option for monitor: --delay. The init script launches the monitor with 20 minutes delay, to allow the collector update RRD files before monitoring them. -- New devdiscover option: --fallback. It is useful in large production environments when it's important to have a device in the web interface even if it's turned off -- Cisco DOCSIS templates now include Total, Active, and Registered modem quantities. RRD file structure has changed, so the graphs will start anew. -- The meaning of $Torrus::Renderer::stylingProfileOverlay has changed: now it refers to a file name. 10-JUN-2005: Torrus release 1.0.0 In this release, compared to RRFW release 0.1.8: -- New directory structure, with local configuration completely separated from the distribution files -- Comand-line wrapper "torrus" for executing all commands, with short aliases ("dd" for "devdiscover" etc.) -- Plugins may be easily added to existing installation -- Relative file names in DDX files searched in the right directories -- Discovery object selectors: the new way to customize the discovery results -- New discovery modules: AxxessIT.pm: Cisco ONS 15300 SDH switches CiscoIOS_Docsis.pm: Cisco IOS DOCSIS specifics: upstream utilization and modem quantities BetterNetworks.pm: BetterNetworks EthernetBox sensors (temperature, humidity and so on) CiscoIOS_MacAccounting.pm: Automated discovery for Cisco MAC accounting. If applicable, MAC peers are associated with BGP peers. -- Discovery modules improvements: IF-MIB indexing hints for unknown devices Docsis downstream utilization Selector actions for IF-MIB, Docsis, and temperature sensor objects Line cards and modules memory stats for modular Ciscso routers -- Improved performance of monitor daemon -- extended example of DOCSIS monitors and 3-level alarms in xmlconfig/examples/docsis-monitors.xml -- Renderer module improved for multi-CPU servers -- Web interface improvements: Recursive directory view, Monitor names and comments diaplayed, Sizes of tokensets displayed Multiple overviews possible for a subtree -- SO_RCVBUF is set explicitly in SNMP collector to sustain bursts of traffic -- RRD files automatically moved in case of conflicts -- ttproclist: the new utility for automating the DDX files generation -- action_snmptrap now sends an optional severity parameter -- New option for devdiscover: --forcebundle to write the bundle file even if errors occur -- The init script is configurable by a separate configuration file. It also launches the monitors with 20 minutes delay if monitors are launched together with collectors torrus-3.00/Makefile.am0000644000175000017500000000731213131663222011751 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # SUBDIRS = . bin configs doc examples lib sup xmlconfig SUBST = @abs_top_builddir@/setup_tools/substvars.sh EXTRA_DIST = \ setup_tools/cpanm_install_modules.sh \ setup_tools/configure_fhs \ setup_tools/check_perlthreading.pl \ systemd/torrus.service.in \ systemd/torrus.tmpfile.in noinst_SCRIPTS = \ setup_tools/substvars.sh \ setup_tools/mkvardir.sh \ init.d/torrus \ systemd/torrus.service \ systemd/torrus.tmpfile tmpldir = @tmpldir@ dist_tmpl_DATA = \ templates/aclexport.xml \ templates/adminfo.html \ templates/default-chooser.html \ templates/default-dir.html \ templates/default-helptext.html \ templates/default-login.html \ templates/default-recursivedir.html \ templates/default-rrd.html \ templates/default-tset.html \ templates/expanded-dir.html \ templates/globalsearch.html \ templates/overview-subleaves.html \ templates/report-index.html \ templates/report-monthly.html \ templates/report-serviceid.html \ templates/report-yearly.html \ templates/search.html \ templates/html-incblocks.txt \ templates/iframe-rrd.html \ templates/tset-list.html \ templates/email-alarm.txt CLEANFILES = \ systemd/torrus.service \ systemd/torrus.tmpfile scriptsdir = @scriptsdir@ dist_scripts_DATA = scripts/rrdup_notify.sh xmlscriptsdir = @scriptsdir@/xml dist_xmlscripts_DATA = scripts/xml/extract-skeleton.xsl discoverydir = @sitedir@/discovery dist_discovery_DATA = discovery/README systemd/torrus.service: systemd/torrus.service.in $(SUBST) systemd/torrus.service.in > systemd/torrus.service systemd/torrus.tmpfile: systemd/torrus.tmpfile.in $(SUBST) systemd/torrus.tmpfile.in > systemd/torrus.tmpfile mkvardir=@abs_top_builddir@/setup_tools/mkvardir.sh install-data-local: @echo Testing if prefix has changed during make test "$(prefix)" = "@prefix@" $(mkvardir) $(DESTDIR)$(gitrepodir) $(mkvardir) $(DESTDIR)$(piddir) $(mkvardir) $(DESTDIR)$(reportsdir) $(mkvardir) $(DESTDIR)$(logdir) $(mkvardir) $(DESTDIR)$(sesstordir) $(mkvardir) $(DESTDIR)$(seslockdir) $(mkinstalldirs) $(DESTDIR)$(tmpluserdir) $(mkinstalldirs) $(DESTDIR)$(plugtorruscfgdir) $(mkinstalldirs) $(DESTDIR)$(plugdevdisccfgdir) $(mkinstalldirs) $(DESTDIR)$(plugwrapperdir) HTMLDIR = @abs_top_builddir@/../htdocs htdocs: cd doc; make htdocs @for f in $(dist_mibs_DATA); do \ f2=$(HTMLDIR)/`basename $$f`; \ if test ! -f $$f2 -o $$f -nt $$f2; then \ echo "cp $$f $$f2"; \ cp $$f $$f2; \ fi; \ done UPLOADPATH = \ ssinyagin,torrus@web.sourceforge.net:/home/groups/t/to/torrus/htdocs/devel upload: dist scp $(distdir).tar.gz TODO $(UPLOADPATH) todoup: scp TODO $(UPLOADPATH) dist-hook: date >DIST_REVISION git branch -vv >>DIST_REVISION cp DIST_REVISION $(distdir)/ PERLCRITIC_CMD = ${PERLCRITIC} --profile=critic.profile critic: @if test ${PERLCRITIC} != no; then \ ${PERLCRITIC_CMD} `egrep -l '^\#..PERL' bin/*.in`; \ ${PERLCRITIC_CMD} lib/Torrus/; \ else \ echo 'perlcritic command not found'; \ fi torrus-3.00/xmlconfig/0000755000175000017500000000000013131663307011764 500000000000000torrus-3.00/xmlconfig/generic/0000755000175000017500000000000013131663307013400 500000000000000torrus-3.00/xmlconfig/generic/rfc2863.if-mib.xml0000644000175000017500000006743012661115746016321 00000000000000 torrus-3.00/xmlconfig/generic/monitors.xml0000644000175000017500000000604411545711242015717 00000000000000 torrus-3.00/xmlconfig/generic/rfc4319_hdsl2_shdsl_line.xml0000644000175000017500000003154411666706264020457 00000000000000 torrus-3.00/xmlconfig/generic/rfc4293.ip-mib.xml0000644000175000017500000001213512661115746016322 00000000000000 torrus-3.00/xmlconfig/generic/rfc2790.host-resources.xml0000644000175000017500000001734212004057517020127 00000000000000 torrus-3.00/xmlconfig/generic/rfc1697.rdbms.xml0000644000175000017500000002432611545711242016257 00000000000000 torrus-3.00/xmlconfig/generic/rfc1628.ups.xml0000644000175000017500000003771311545711242015755 00000000000000 torrus-3.00/xmlconfig/generic/collector-periods.xml0000644000175000017500000000645611545711242017505 00000000000000 torrus-3.00/xmlconfig/generic/rfc2670.docsis-if.xml0000644000175000017500000003444412661115746017031 00000000000000 Signal/Noise-Ratio was lower than 20dB torrus-3.00/xmlconfig/generic/rfc2662.adsl-line.xml0000644000175000017500000005762012413217640017012 00000000000000 torrus-3.00/xmlconfig/defaults.xml0000644000175000017500000003765313131655331014251 00000000000000 # Business day: 8:00 to 17:00 LTIME,86400,%,DUP,28800,GE,EXC,61200,LE,*,INF,UNKN,IF # Evening: 17:00 to 22:00 LTIME,86400,%,DUP,61200,GE,EXC,79200,LE,*,INF,UNKN,IF # Night: 22:00 to 6:00 LTIME,86400,%,DUP,79200,GE,EXC,21600,LE,+,INF,UNKN,IF # GPRINT stuff last24h-small,last24h,lastweek,lastmonth,lastyear torrus-3.00/xmlconfig/Makefile.am0000644000175000017500000000635513131655331013747 00000000000000 # Copyright (C) 2002-2010 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # EXTRA_DIST = \ site-global.xml xmldir = $(distxmldir) dist_xml_DATA = \ defaults.xml snmp-defs.xml cdef-collector-defs.xml vendordir = $(distxmldir)/vendor dist_vendor_DATA = \ vendor/albis-ulaf.xml \ vendor/alteon.xml \ vendor/alu-timetra.xml \ vendor/apc.powernet.xml \ vendor/apc.ups.xml \ vendor/apple.ae.xml \ vendor/arbor_e.xml \ vendor/ascend.max.xml \ vendor/atmel.xml \ vendor/betternetworks.xml \ vendor/casa-cmts.xml \ vendor/cisco.firewall.xml \ vendor/cisco.generic.xml \ vendor/cisco.ios.xml \ vendor/cisco.ios.docsis.xml \ vendor/cisco.ios.mac-accounting.xml \ vendor/cisco.sce.xml \ vendor/cisco.vdsl-line.xml \ vendor/cisco.wlc.xml \ vendor/compaq.cim.xml \ vendor/comtechefdata.xml \ vendor/empire.systemedge.xml \ vendor/empire.systemedge.ntregperf.xml \ vendor/f5.bigip.xml \ vendor/fortinet.xml \ vendor/foundry.xml \ vendor/ftos.xml \ vendor/jacarta.xml \ vendor/junos.xml \ vendor/hp.hpux.xml \ vendor/hp.procurve.xml \ vendor/liebert.xml \ vendor/microsoft.windows.xml \ vendor/motorola.bsr.xml \ vendor/netapp.filer.xml \ vendor/netbotz.xml \ vendor/netscreen.xml \ vendor/paradyne.xdsl.xml \ vendor/symmetricom.xml \ vendor/ucd.ucd-snmp.xml genericdir = $(distxmldir)/generic dist_generic_DATA = \ generic/collector-periods.xml \ generic/monitors.xml \ generic/rfc1628.ups.xml \ generic/rfc1697.rdbms.xml \ generic/rfc2662.adsl-line.xml \ generic/rfc2670.docsis-if.xml \ generic/rfc2790.host-resources.xml \ generic/rfc2863.if-mib.xml \ generic/rfc4293.ip-mib.xml \ generic/rfc4319_hdsl2_shdsl_line.xml examplesdir = $(distxmldir)/examples dist_examples_DATA = \ examples/apc-ups.xml \ examples/ascend.max.xml \ examples/docsis-monitors.xml \ examples/generic-netsnmp.xml \ examples/hpux.xml \ examples/monitors.xml \ examples/rainbow-schema.xml \ examples/servers.data \ examples/servers.tmpl olddir = $(distxmldir)/old dist_old_DATA = \ old/cisco.generic.old-0.1.4.xml \ old/cisco.ios.mac-accounting-0.1.8.xml \ old/cisco-mac-accounting-example.xml \ old/rfc1213.xml \ old/rfc2670.docsis-if.old.0.1.5d-20040224.xml \ old/rfc2670.docsis-if.old.1.0.4.xml \ old/rfc2863.if-mib.old-0.1.4.xml \ old/rfc2863.if-mib.old-0.1.7.xml \ old/snmp-defs.old-0.1.2.xml install-data-local: $(mkinstalldirs) $(DESTDIR)$(sitexmldir) if test ! -r $(DESTDIR)$(sitexmldir)/site-global.xml; then \ $(INSTALL_DATA) site-global.xml \ $(DESTDIR)$(sitexmldir)/site-global.xml; \ fi torrus-3.00/xmlconfig/cdef-collector-defs.xml0000644000175000017500000000535612661115746016251 00000000000000 torrus-3.00/xmlconfig/site-global.xml0000644000175000017500000000036113131655331014626 00000000000000 torrus-3.00/xmlconfig/snmp-defs.xml0000644000175000017500000001556213131655331014331 00000000000000 torrus-3.00/xmlconfig/vendor/0000755000175000017500000000000013131663307013261 500000000000000torrus-3.00/xmlconfig/vendor/cisco.generic.xml0000644000175000017500000004445412661115746016457 00000000000000 torrus-3.00/xmlconfig/vendor/netscreen.xml0000644000175000017500000001233511545711243015715 00000000000000 torrus-3.00/xmlconfig/vendor/f5.bigip.xml0000644000175000017500000010710012661115746015333 00000000000000 torrus-3.00/xmlconfig/vendor/comtechefdata.xml0000644000175000017500000002461612000630635016513 00000000000000 torrus-3.00/xmlconfig/vendor/apc.ups.xml0000644000175000017500000001215211545711243015275 00000000000000 torrus-3.00/xmlconfig/vendor/alu-timetra.xml0000644000175000017500000004423511545711243016157 00000000000000 torrus-3.00/xmlconfig/vendor/atmel.xml0000644000175000017500000007507412661115746015050 00000000000000 torrus-3.00/xmlconfig/vendor/symmetricom.xml0000644000175000017500000000564411545711243016304 00000000000000 torrus-3.00/xmlconfig/vendor/motorola.bsr.xml0000644000175000017500000001311112661115746016347 00000000000000 torrus-3.00/xmlconfig/vendor/betternetworks.xml0000644000175000017500000000402011545711243017001 00000000000000 torrus-3.00/xmlconfig/vendor/cisco.ios.docsis.xml0000644000175000017500000002566112661115746017117 00000000000000 torrus-3.00/xmlconfig/vendor/hp.procurve.xml0000644000175000017500000001142411663705141016201 00000000000000 torrus-3.00/xmlconfig/vendor/alteon.xml0000644000175000017500000007566311545711243015226 00000000000000 torrus-3.00/xmlconfig/vendor/hp.hpux.xml0000644000175000017500000002603711545711242015324 00000000000000 torrus-3.00/xmlconfig/vendor/apc.powernet.xml0000644000175000017500000002762612661115746016353 00000000000000 torrus-3.00/xmlconfig/vendor/albis-ulaf.xml0000644000175000017500000003770212661115746015761 00000000000000 torrus-3.00/xmlconfig/vendor/cisco.sce.xml0000644000175000017500000007225311545711242015604 00000000000000 torrus-3.00/xmlconfig/vendor/cisco.ios.xml0000644000175000017500000013476413131655331015631 00000000000000 torrus-3.00/xmlconfig/vendor/empire.systemedge.ntregperf.xml0000644000175000017500000014511111545711243021352 00000000000000 torrus-3.00/xmlconfig/vendor/junos.xml0000644000175000017500000010721111545711243015063 00000000000000 torrus-3.00/xmlconfig/vendor/ftos.xml0000644000175000017500000001502111545711243014675 00000000000000 torrus-3.00/xmlconfig/vendor/ucd.ucd-snmp.xml0000644000175000017500000005375711545711243016244 00000000000000 torrus-3.00/xmlconfig/vendor/apple.ae.xml0000644000175000017500000001730511545711243015416 00000000000000 torrus-3.00/xmlconfig/vendor/cisco.wlc.xml0000644000175000017500000000363711545711243015620 00000000000000 torrus-3.00/xmlconfig/vendor/paradyne.xdsl.xml0000644000175000017500000001413511545711243016503 00000000000000 torrus-3.00/xmlconfig/vendor/jacarta.xml0000644000175000017500000000600211545711243015326 00000000000000 torrus-3.00/xmlconfig/vendor/empire.systemedge.xml0000644000175000017500000027672412013222704017364 00000000000000 torrus-3.00/xmlconfig/vendor/netbotz.xml0000644000175000017500000001134511545711242015413 00000000000000 torrus-3.00/xmlconfig/vendor/ascend.max.xml0000644000175000017500000001021712661115746015753 00000000000000 torrus-3.00/xmlconfig/vendor/netapp.filer.xml0000644000175000017500000034570011545711243016323 00000000000000 torrus-3.00/xmlconfig/vendor/fortinet.xml0000644000175000017500000003362712661115746015576 00000000000000 torrus-3.00/xmlconfig/vendor/cisco.firewall.xml0000644000175000017500000000623211545711243016632 00000000000000 torrus-3.00/xmlconfig/vendor/microsoft.windows.xml0000644000175000017500000006506312004057517017431 00000000000000 torrus-3.00/xmlconfig/vendor/casa-cmts.xml0000644000175000017500000001771512661115746015617 00000000000000 torrus-3.00/xmlconfig/vendor/arbor_e.xml0000644000175000017500000041571111545711243015345 00000000000000 torrus-3.00/xmlconfig/vendor/foundry.xml0000644000175000017500000002611511545711243015416 00000000000000 torrus-3.00/xmlconfig/vendor/cisco.ios.mac-accounting.xml0000644000175000017500000001071312661115746020513 00000000000000 torrus-3.00/xmlconfig/vendor/liebert.xml0000644000175000017500000004532111545711243015356 00000000000000 torrus-3.00/xmlconfig/vendor/cisco.vdsl-line.xml0000644000175000017500000001503511545711243016723 00000000000000 torrus-3.00/xmlconfig/vendor/compaq.cim.xml0000644000175000017500000000541511545711243015757 00000000000000 torrus-3.00/xmlconfig/Makefile.in0000644000175000017500000005166213131655451013764 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2002-2010 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = xmlconfig DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(dist_examples_DATA) $(dist_generic_DATA) $(dist_old_DATA) \ $(dist_vendor_DATA) $(dist_xml_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(examplesdir)" "$(DESTDIR)$(genericdir)" \ "$(DESTDIR)$(olddir)" "$(DESTDIR)$(vendordir)" \ "$(DESTDIR)$(xmldir)" DATA = $(dist_examples_DATA) $(dist_generic_DATA) $(dist_old_DATA) \ $(dist_vendor_DATA) $(dist_xml_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ FIND = @FIND@ GIT = @GIT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KILL = @KILL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERLCRITIC = @PERLCRITIC@ PERLINC = @PERLINC@ POD2MAN = @POD2MAN@ POD2TEXT = @POD2TEXT@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLEEP = @SLEEP@ STRIP = @STRIP@ SU = @SU@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cfgdefdir = @cfgdefdir@ datadir = @datadir@ datarootdir = @datarootdir@ defrrddir = @defrrddir@ distxmldir = @distxmldir@ docdir = @docdir@ dvidir = @dvidir@ enable_pkgonly = @enable_pkgonly@ enable_varperm = @enable_varperm@ exec_prefix = @exec_prefix@ exmpdir = @exmpdir@ gitrepodir = @gitrepodir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mansec_misc = @mansec_misc@ mansec_usercmd = @mansec_usercmd@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perllibdir = @perllibdir@ perllibdirs = @perllibdirs@ piddir = @piddir@ pkgbindir = @pkgbindir@ pkgdocdir = @pkgdocdir@ pkghome = @pkghome@ plugdevdisccfgdir = @plugdevdisccfgdir@ pluginsdir = @pluginsdir@ plugtorruscfgdir = @plugtorruscfgdir@ plugwrapperdir = @plugwrapperdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ reportsdir = @reportsdir@ sbindir = @sbindir@ scriptsdir = @scriptsdir@ seslockdir = @seslockdir@ sesstordir = @sesstordir@ sharedstatedir = @sharedstatedir@ siteconfdir = @siteconfdir@ sitedir = @sitedir@ sitexmldir = @sitexmldir@ srcdir = @srcdir@ supdir = @supdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tmpldir = @tmpldir@ tmpluserdir = @tmpluserdir@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ torrus_user = @torrus_user@ var_group = @var_group@ var_mode = @var_mode@ var_user = @var_user@ varprefix = @varprefix@ webplaindir = @webplaindir@ webscriptsdir = @webscriptsdir@ wrapperdir = @wrapperdir@ EXTRA_DIST = \ site-global.xml xmldir = $(distxmldir) dist_xml_DATA = \ defaults.xml snmp-defs.xml cdef-collector-defs.xml vendordir = $(distxmldir)/vendor dist_vendor_DATA = \ vendor/albis-ulaf.xml \ vendor/alteon.xml \ vendor/alu-timetra.xml \ vendor/apc.powernet.xml \ vendor/apc.ups.xml \ vendor/apple.ae.xml \ vendor/arbor_e.xml \ vendor/ascend.max.xml \ vendor/atmel.xml \ vendor/betternetworks.xml \ vendor/casa-cmts.xml \ vendor/cisco.firewall.xml \ vendor/cisco.generic.xml \ vendor/cisco.ios.xml \ vendor/cisco.ios.docsis.xml \ vendor/cisco.ios.mac-accounting.xml \ vendor/cisco.sce.xml \ vendor/cisco.vdsl-line.xml \ vendor/cisco.wlc.xml \ vendor/compaq.cim.xml \ vendor/comtechefdata.xml \ vendor/empire.systemedge.xml \ vendor/empire.systemedge.ntregperf.xml \ vendor/f5.bigip.xml \ vendor/fortinet.xml \ vendor/foundry.xml \ vendor/ftos.xml \ vendor/jacarta.xml \ vendor/junos.xml \ vendor/hp.hpux.xml \ vendor/hp.procurve.xml \ vendor/liebert.xml \ vendor/microsoft.windows.xml \ vendor/motorola.bsr.xml \ vendor/netapp.filer.xml \ vendor/netbotz.xml \ vendor/netscreen.xml \ vendor/paradyne.xdsl.xml \ vendor/symmetricom.xml \ vendor/ucd.ucd-snmp.xml genericdir = $(distxmldir)/generic dist_generic_DATA = \ generic/collector-periods.xml \ generic/monitors.xml \ generic/rfc1628.ups.xml \ generic/rfc1697.rdbms.xml \ generic/rfc2662.adsl-line.xml \ generic/rfc2670.docsis-if.xml \ generic/rfc2790.host-resources.xml \ generic/rfc2863.if-mib.xml \ generic/rfc4293.ip-mib.xml \ generic/rfc4319_hdsl2_shdsl_line.xml examplesdir = $(distxmldir)/examples dist_examples_DATA = \ examples/apc-ups.xml \ examples/ascend.max.xml \ examples/docsis-monitors.xml \ examples/generic-netsnmp.xml \ examples/hpux.xml \ examples/monitors.xml \ examples/rainbow-schema.xml \ examples/servers.data \ examples/servers.tmpl olddir = $(distxmldir)/old dist_old_DATA = \ old/cisco.generic.old-0.1.4.xml \ old/cisco.ios.mac-accounting-0.1.8.xml \ old/cisco-mac-accounting-example.xml \ old/rfc1213.xml \ old/rfc2670.docsis-if.old.0.1.5d-20040224.xml \ old/rfc2670.docsis-if.old.1.0.4.xml \ old/rfc2863.if-mib.old-0.1.4.xml \ old/rfc2863.if-mib.old-0.1.7.xml \ old/snmp-defs.old-0.1.2.xml all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu xmlconfig/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu xmlconfig/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-dist_examplesDATA: $(dist_examples_DATA) @$(NORMAL_INSTALL) @list='$(dist_examples_DATA)'; test -n "$(examplesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(examplesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(examplesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(examplesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(examplesdir)" || exit $$?; \ done uninstall-dist_examplesDATA: @$(NORMAL_UNINSTALL) @list='$(dist_examples_DATA)'; test -n "$(examplesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(examplesdir)'; $(am__uninstall_files_from_dir) install-dist_genericDATA: $(dist_generic_DATA) @$(NORMAL_INSTALL) @list='$(dist_generic_DATA)'; test -n "$(genericdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(genericdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(genericdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(genericdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(genericdir)" || exit $$?; \ done uninstall-dist_genericDATA: @$(NORMAL_UNINSTALL) @list='$(dist_generic_DATA)'; test -n "$(genericdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(genericdir)'; $(am__uninstall_files_from_dir) install-dist_oldDATA: $(dist_old_DATA) @$(NORMAL_INSTALL) @list='$(dist_old_DATA)'; test -n "$(olddir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(olddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(olddir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(olddir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(olddir)" || exit $$?; \ done uninstall-dist_oldDATA: @$(NORMAL_UNINSTALL) @list='$(dist_old_DATA)'; test -n "$(olddir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(olddir)'; $(am__uninstall_files_from_dir) install-dist_vendorDATA: $(dist_vendor_DATA) @$(NORMAL_INSTALL) @list='$(dist_vendor_DATA)'; test -n "$(vendordir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(vendordir)'"; \ $(MKDIR_P) "$(DESTDIR)$(vendordir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(vendordir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(vendordir)" || exit $$?; \ done uninstall-dist_vendorDATA: @$(NORMAL_UNINSTALL) @list='$(dist_vendor_DATA)'; test -n "$(vendordir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(vendordir)'; $(am__uninstall_files_from_dir) install-dist_xmlDATA: $(dist_xml_DATA) @$(NORMAL_INSTALL) @list='$(dist_xml_DATA)'; test -n "$(xmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(xmldir)" || exit $$?; \ done uninstall-dist_xmlDATA: @$(NORMAL_UNINSTALL) @list='$(dist_xml_DATA)'; test -n "$(xmldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xmldir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(examplesdir)" "$(DESTDIR)$(genericdir)" "$(DESTDIR)$(olddir)" "$(DESTDIR)$(vendordir)" "$(DESTDIR)$(xmldir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dist_examplesDATA \ install-dist_genericDATA install-dist_oldDATA \ install-dist_vendorDATA install-dist_xmlDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_examplesDATA uninstall-dist_genericDATA \ uninstall-dist_oldDATA uninstall-dist_vendorDATA \ uninstall-dist_xmlDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-dist_examplesDATA \ install-dist_genericDATA install-dist_oldDATA \ install-dist_vendorDATA install-dist_xmlDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_examplesDATA \ uninstall-dist_genericDATA uninstall-dist_oldDATA \ uninstall-dist_vendorDATA uninstall-dist_xmlDATA install-data-local: $(mkinstalldirs) $(DESTDIR)$(sitexmldir) if test ! -r $(DESTDIR)$(sitexmldir)/site-global.xml; then \ $(INSTALL_DATA) site-global.xml \ $(DESTDIR)$(sitexmldir)/site-global.xml; \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torrus-3.00/xmlconfig/old/0000755000175000017500000000000013131663307012542 500000000000000torrus-3.00/xmlconfig/old/rfc2670.docsis-if.old.0.1.5d-20040224.xml0000644000175000017500000000562412661115746020445 00000000000000 Signal/Noise-Ratio was lower than 20dB torrus-3.00/xmlconfig/old/cisco.ios.mac-accounting-0.1.8.xml0000644000175000017500000000740312661115746020440 00000000000000 torrus-3.00/xmlconfig/old/cisco-mac-accounting-example.xml0000644000175000017500000000562312661115746020637 00000000000000 torrus-3.00/xmlconfig/old/rfc2670.docsis-if.old.1.0.4.xml0000644000175000017500000003071312661115746017402 00000000000000 Signal/Noise-Ratio was lower than 20dB torrus-3.00/xmlconfig/old/cisco.generic.old-0.1.4.xml0000644000175000017500000001013712661115746017142 00000000000000 torrus-3.00/xmlconfig/old/snmp-defs.old-0.1.2.xml0000644000175000017500000002657412661115746016335 00000000000000 RRA:AVERAGE:0.5:1:4032 RRA:AVERAGE:0.5:6:2016 RRA:MAX:0.5:6:2016 RRA:AVERAGE:0.5:288:732 RRA:MAX:0.5:288:732 torrus-3.00/xmlconfig/old/rfc1213.xml0000644000175000017500000002253111545711242014267 00000000000000 torrus-3.00/xmlconfig/old/rfc2863.if-mib.old-0.1.7.xml0000644000175000017500000004261012661115746016672 00000000000000 torrus-3.00/xmlconfig/old/rfc2863.if-mib.old-0.1.4.xml0000644000175000017500000004207012661115746016667 00000000000000 torrus-3.00/xmlconfig/examples/0000755000175000017500000000000013131663307013602 500000000000000torrus-3.00/xmlconfig/examples/monitors.xml0000644000175000017500000001071112661115746016124 00000000000000 echo `date '+%d-%b-%Y %H:%M:%S'` \ $TORRUS_MONITOR $TORRUS_EVENT $TORRUS_NODEPATH \ >> /tmp/torrus-events $TORRUS_HOME/bin/action_printemail | mail ssinyagin@k-open.com #max,GT #min,LT {(LAST-300)},10,*,GT, {(LAST)},{(LAST-300)},10,/,LT, OR, {T@(LAST)},3600,+,NOW,GE, AND {(LAST-600)},-,ABS,10485760,GT, {T@(LAST)},3600,+,NOW,GE, AND graph-devel, report-file, snmptrap torrus-3.00/xmlconfig/examples/apc-ups.xml0000644000175000017500000000356111545711242015620 00000000000000 Location: Chen's take-away, Duebendorf; Contact: Chen; Power consumer: Microwave oven torrus-3.00/xmlconfig/examples/generic-netsnmp.xml0000644000175000017500000001326311545711242017346 00000000000000 /usr/local/torrus-data/generic/snmp/%system-id% Location: System Localtion ; Contact: System Contact torrus-3.00/xmlconfig/examples/ascend.max.xml0000644000175000017500000000354712661115746016304 00000000000000 Location: Hardstrasse 235; Contact: GPS Technik AG, Zuercherstrasse 139, CH-8952 Schlieren torrus-3.00/xmlconfig/examples/servers.tmpl0000644000175000017500000000566311545711242016122 00000000000000 [% PROCESS $data %] [% FOREACH server = servers %] /ByName/[% server.name %]/ Description: [% server.description %] Location: [% server.location %] [% IF server.type == 'Linux'%] [% ELSE %] [% END %] [% SET precedence = 200 %] [% FOREACH disk = server.disks %] %system-id%_[%disk.nickName%].rrd [% SET precedence = precedence + 10 %] [% END %] [% FOREACH nic = server.nics %] [% SET precedence = precedence + 10 %] [% END %] [% END %] torrus-3.00/xmlconfig/examples/hpux.xml0000644000175000017500000000635011545711242015233 00000000000000 Location: Rack 01; Contact: John Doe torrus-3.00/xmlconfig/examples/docsis-monitors.xml0000644000175000017500000003226512661115746017416 00000000000000 Signal/Noise-Ratio lower than 24dB Signal/Noise-Ratio lower than 22dB Signal/Noise-Ratio lower than 18dB DUP, {Error-Free},{Uncorrectable},+,+, /,100,*,DUP, 10,GT,EXC,20,LE,AND FEC correctable error rate more than 10% DUP, {Error-Free},{Uncorrectable},+,+, /,100,*,DUP, 20,GT,EXC,100,LE,AND FEC correctable error rate more than 20% DUP, {Error-Free},{Correctable},+,+, /,100,*,DUP, 0.5,GT,EXC,1,LE,AND FEC uncorrectable error rate more than 0.5% DUP, {Error-Free},{Correctable},+,+, /,100,*,DUP, 1,GT,2,EXC,LE,AND FEC uncorrectable error rate more than 1% DUP, {Error-Free},{Correctable},+,+, /,100,*,DUP, 2,GT,100,EXC,LE,AND FEC uncorrectable error rate more than 2% {TotalBytes},/,100,*, DUP, 75,GT,EXC,80,LE,AND DOCSIS downstream utilization more than 75% {TotalBytes},/,100,*, DUP, 80,GT,EXC,85,LE,AND DOCSIS downstream utilization more than 80% {TotalBytes},/,100,*, 85,GT DOCSIS downstream utilization more than 85% DUP, 75,GT,EXC,80,LE,AND DOCSIS upstream utilization more than 75% DUP, 80,GT,EXC,85,LE,AND DOCSIS upstream utilization more than 80% 85,GT DOCSIS upstream utilization more than 85% DUP, 17,LT,EXC,12,GE,AND free DOCSIS upstream minislots less than 17% DUP, 12,LT,EXC,7,GE,AND free DOCSIS upstream minislots less than 12% 7,LT free DOCSIS upstream minislots less than 7% {Modems_Total},/,100,*,10,LT, {Modems_Total},100,LT,AND Less than 10% of DOCSIS modems online on a low-loaded interface {Modems_Total},/,100,*, DUP, 50,LT,EXC,10,GE,AND, {Modems_Total},100,GE,AND Less than 50% of DOCSIS modems online {Modems_Total},/,100,*,10,LT, {Modems_Total},100,GE,AND Less than 10% of DOCSIS modems online {Packets_In},/,100,*,DUP, 10,GT,EXC,50,LE,AND Input packet errors more than 10% {Packets_In},/,100,*,DUP, 50,GT,EXC,100,LE,AND Input packet errors more than 50% {Packets_Out},/,100,*,DUP, 10,GT,EXC,50,LE,AND Output packet errors more than 10% {Packets_Out},/,100,*,DUP, 50,GT,EXC,100,LE,AND Output packet errors more than 50% torrus-3.00/xmlconfig/examples/servers.data0000644000175000017500000000431611545711242016051 00000000000000[%# Example of using tpage for Torrus config generation. This is an example only. See User Guide for more details. Author: Christian Schnidrig Generate the XML configuration with tpage --define data=servers.data servers.tmpl >servers.xml %] [% servers = [ { name => 'torrus' type => 'Linux', location => 'Binz' description => 'Torrus (Front-end)' community => 'blabla', ram => 3000000000 numCpu => 2, disks => [ {name => '/', nickName => 'Root'} {name => '/var/snmpcollector/0', nickName => 'Collector_0'} {name => '/var/snmpcollector/1', nickName => 'Collector_1'} {name => '/var/snmpcollector/2', nickName => 'Collector_2'} {name => '/var/snmpcollector/3', nickName => 'Collector_3'} {name => '/var/snmpcollector/4', nickName => 'Collector_4'} ], nics => [ {name => 'eth0', nickName => 'nic', speed => 100000000} {name => 'eth1', nickName => 'local', speed => 1000000000} ] } { name => 'torrus2' type => 'Linux', location => 'Binz' description => 'Torrus (Collector)' community => 'blabla', ram => 3000000000 numCpu => 2, disks => [ {name => '/', nickName => 'Root'} {name => '/var/snmpcollector/5', nickName => 'Collector_5'} {name => '/var/snmpcollector/6', nickName => 'Collector_6'} {name => '/var/snmpcollector/7', nickName => 'Collector_7'} {name => '/var/snmpcollector/8', nickName => 'Collector_8'} {name => '/var/snmpcollector/9', nickName => 'Collector_9'} ], nics => [ {name => 'eth0', nickName => 'nic', speed => 100000000} {name => 'eth1', nickName => 'local', speed => 1000000000} ] } { name => 'someSolarisMachine', type => 'Solaris', location => 'Binz', description => 'Tacacs Server', community => 'blabla', ram => 224000000, numCpu => 1, disks => [ {name => '/', nickName => 'Root'} {name => '/log', nickName => 'Log'} ], nics => [ {name => 'le0', nickName => 'nic', speed => 100000000} ] } ] %] torrus-3.00/xmlconfig/examples/rainbow-schema.xml0000644000175000017500000001551211545711242017146 00000000000000 torrus-3.00/setup_tools/0000755000175000017500000000000013131663306012355 500000000000000torrus-3.00/setup_tools/mkvardir.sh.in0000644000175000017500000000250713131655331015060 00000000000000#!@SHELL@ # Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # dir=$1 user=@var_user@ group=@var_group@ mode=@var_mode@ SHELL=@SHELL@ if test ! -d $dir; then @install_sh@ -d $dir || exit 1 if test "@enable_varperm@" = "yes"; then test -z "$mode" || chmod $mode $dir || (rmdir $dir; exit 1) test -z "$user" || chown $user $dir || (rmdir $dir; exit 1) test -z "$group" || (chgrp $group $dir && chmod g+s $dir) || \ (rmdir $dir; exit 1) fi fi exit 0 # Local Variables: # mode: shell-script # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/setup_tools/cpanm_install_modules.sh0000644000175000017500000000053613131655331017210 00000000000000for m in \ Redis::Fast \ Git::Raw \ Git::ObjectStore \ Digest::SHA \ Cache::Ref \ JSON \ JSON::XS \ XML::LibXML \ Template \ Proc::Daemon \ Net::SNMP \ URI::Escape \ Apache::Session \ Date::Parse \ CGI::Fast \ FCGI \ ;do cpanm --notest $m if [ $? -ne 0 ]; then exit 1; fi done torrus-3.00/setup_tools/configure_fhs0000755000175000017500000000062412661115746015055 00000000000000#!/bin/sh # Configure script for FHC compliant setup (http://www.pathname.com/fhs/) # Stanislav Sinyagin if test ! -x ./configure; then echo "$0: cannot find ./configure" 2>&1 echo "Usage: ./setup_tools/configure_fhs [configure options]..." 2>&1 exit 1 fi ./configure \ --prefix=/opt \ --mandir=/opt/share/man \ pkghome=/opt/torrus \ sitedir=/etc/opt/torrus \ "$@" torrus-3.00/setup_tools/substvars.sh.in0000644000175000017500000000717213131655331015300 00000000000000#!@SHELL@ # Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # PACKAGE=@PACKAGE@ prefix=@prefix@ datarootdir=@datarootdir@ pkghome=@pkghome@ exec_prefix=@exec_prefix@ perllibdir=@perllibdir@ pluginsdir=@pluginsdir@ sysconfdir=@sysconfdir@ varprefix=@varprefix@ sitedir=@sitedir@ supdir=@supdir@ styldir=@supdir@/styling devdiscover_config_pl=@cfgdefdir@/devdiscover-config.pl torrus_config_pl=@cfgdefdir@/torrus-config.pl torrus_siteconfig_pl=@siteconfdir@/torrus-siteconfig.pl snmptrap_siteconfig_pl=@siteconfdir@/snmptrap-siteconfig.pl email_siteconfig_pl=@siteconfdir@/email-siteconfig.pl devdiscover_siteconfig_pl=@siteconfdir@/devdiscover-siteconfig.pl notify_siteconfig_pl=@siteconfdir@/notify-siteconfig.pl torrus_user=@torrus_user@ @SED@ \ -e "s,\@FIND\@,@FIND@,g" \ -e "s,\@PERL\@,@PERL@,g" \ -e "s,\@GIT\@,@GIT@,g" \ -e "s,\@RM\@,@RM@,g" \ -e "s,\@SHELL\@,@SHELL@,g" \ -e "s,\@VERSION\@,@VERSION@,g" \ -e "s,\@bindir\@,@bindir@,g" \ -e "s,\@cfgdefdir\@,@cfgdefdir@,g" \ -e "s,\@defrrddir\@,@defrrddir@,g" \ -e "s,\@devdiscover_config_pl\@,$devdiscover_config_pl,g" \ -e "s,\@devdiscover_siteconfig_pl\@,$devdiscover_siteconfig_pl,g" \ -e "s,\@distxmldir\@,@distxmldir@,g" \ -e "s,\@pkgdocdir\@,@pkgdocdir@,g" \ -e "s,\@email_siteconfig_pl\@,$email_siteconfig_pl,g" \ -e "s,\@exmpdir\@,@exmpdir@,g" \ -e "s,\@logdir\@,@logdir@,g" \ -e "s,\@mandir\@,@mandir@,g" \ -e "s,\@mansec_misc\@,@mansec_misc@,g" \ -e "s,\@mansec_usercmd\@,@mansec_usercmd@,g" \ -e "s,\@notify_siteconfig_pl\@,$notify_siteconfig_pl,g" \ -e "s,\@perllibdir\@,@perllibdir@,g" \ -e "s,\@perllibdirs\@,@perllibdirs@,g" \ -e "s,\@piddir\@,@piddir@,g" \ -e "s,\@pkgbindir\@,@pkgbindir@,g" \ -e "s,\@pkghome\@,@pkghome@,g" \ -e "s,\@plugdevdisccfgdir\@,@plugdevdisccfgdir@,g" \ -e "s,\@pluginsdir\@,@pluginsdir@,g" \ -e "s,\@plugtorruscfgdir\@,@plugtorruscfgdir@,g" \ -e "s,\@plugwrapperdir\@,@plugwrapperdir@,g" \ -e "s,\@reportsdir\@,@reportsdir@,g" \ -e "s,\@scriptsdir\@,@scriptsdir@,g" \ -e "s,\@seslockdir\@,@seslockdir@,g" \ -e "s,\@sesstordir\@,@sesstordir@,g" \ -e "s,\@siteconfdir\@,@siteconfdir@,g" \ -e "s,\@sitedir\@,@sitedir@,g" \ -e "s,\@sitexmldir\@,@sitexmldir@,g" \ -e "s,\@snmptrap_siteconfig_pl\@,$snmptrap_siteconfig_pl,g" \ -e "s,\@styldir\@,$styldir,g" \ -e "s,\@supdir\@,@supdir@,g" \ -e "s,\@tmpldir\@,@tmpldir@,g" \ -e "s,\@tmpluserdir\@,@tmpluserdir@,g" \ -e "s,\@torrus_config_pl\@,$torrus_config_pl,g" \ -e "s,\@torrus_siteconfig_pl\@,$torrus_siteconfig_pl,g" \ -e "s,\@torrus_user\@,@torrus_user@,g" \ -e "s,\@var_user\@,@var_user@,g" \ -e "s,\@var_group\@,@var_group@,g" \ -e "s,\@webplaindir\@,@webplaindir@,g" \ -e "s,\@gitrepodir\@,@gitrepodir@,g" \ $1 # Local Variables: # mode: shell-script # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/setup_tools/check_perlthreading.pl0000644000175000017500000000114111545711243016615 00000000000000 use threads; $| = 1; print "The child thread must keep ticking while the main thread sleeps\n"; print "If it's not so, then we have a compatibility problem\n"; my $thrChild = threads->create( \&child ); $thrChild->detach(); print "P> Launched the child thread. Now I sleep 20 seconds\n"; sleep(20); print "P> Parent woke up. Was there ticking inbetween?\n"; exit 0; sub child { print "C> Child thread started. I will print 10 lines, one per second\n"; foreach my $i (1..10) { print("C> Child tick " . $i . "\n"); sleep(1); } } torrus-3.00/scripts/0000755000175000017500000000000013131663306011464 500000000000000torrus-3.00/scripts/rrdup_notify.sh0000644000175000017500000000154012661115746014473 00000000000000#!/bin/sh # # Periodically check if there are RRD files not updated by collector, # and email the warning message. # *.old.rrd files are ignored # Stanislav Sinyagin # # Where the RRD files are located. Separate multiple paths with space RRDSTORAGE=/srv/torrus/collector_rrd # Maximum allowed age of an RRD file, in minutes. MAXAGE=60 # Where to send complaints NOTIFY=root TMPFILE=/tmp/rrdup_notify.$$ cp /dev/null ${TMPFILE} for d in ${RRDSTORAGE}; do find ${d} -name '*.rrd' ! -name '*.old.rrd' \ -mmin +${MAXAGE} -print >>${TMPFILE} done nLines=`wc -l ${TMPFILE} | awk '{print $1}'` if test ${nLines} -gt 0; then cat ${TMPFILE} | \ mail -s "`printf \"Warning: %d aged RRD files\" ${nLines}`" ${NOTIFY} fi rm ${TMPFILE} # Local Variables: # mode: shell-script # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/scripts/xml/0000755000175000017500000000000013131663306012264 500000000000000torrus-3.00/scripts/xml/extract-skeleton.xsl0000644000175000017500000000401412661115746016236 00000000000000 This file is a result of extract-skeleton.xsl template torrus-3.00/README0000644000175000017500000000045712661115746010612 00000000000000Torrus project http://sourceforge.net/projects/torrus http://torrus.org http://sourceforge.net/apps/mediawiki/torrus/ For installation instructions, see doc/install.txt or convert doc/install.pod into a format of your preference. (C) 2002-2010, Stanislav Sinyagin torrus-3.00/init.d/0000755000175000017500000000000013131663306011162 500000000000000torrus-3.00/init.d/torrus.in0000644000175000017500000000373713131655331013001 00000000000000#!@SHELL@ # # init.d script for Torrus # Install it as /etc/init.d/torrus (most UNIXes), # or as /usr/local/etc/rc.d/torrus.sh (FreeBSD), or probably somewhere else. # # Stanislav Sinyagin # # ### chkconfig info # chkconfig: 2345 90 10 # description: Starts/Stops Torrus collectors and monitors ### # ### BEGIN INIT INFO # Provides: torrus-collector torrus-monitor # Required-Start: $local_fs $remote_fs $syslog $named $network $time # Required-Stop: $local_fs $remote_fs $syslog $named $network # Should-Start: # Should-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Torrus collectors and monitors # Description: Start/stop Torrus collectors and monitors ### END INIT INFO prefix=@prefix@ sysconfdir=@sysconfdir@ pkghome=@pkghome@ cmddir=@pkgbindir@ piddir=@piddir@ sitedir=@sitedir@ . @cfgdefdir@/initscript.conf if test -f @siteconfdir@/initscript.siteconf; then . @siteconfdir@/initscript.siteconf fi START_ARGS="--cmd=start" STOP_ARGS="--cmd=stop" if test x"${TORRUS_USER}" != x; then START_ARGS=${START_ARGS}' --user='${TORRUS_USER} STOP_ARGS=${STOP_ARGS}' --user='${TORRUS_USER} fi start_daemons () { ${cmddir}/launcher ${START_ARGS} 2>&1 | tee -a @logdir@/launcher_start.log # RHEL based systems (RHEL, CentOS, Fedora) ignore the KXXtorrus script # unless the corresponding lock is present if test -d /var/lock/subsys; then touch /var/lock/subsys/torrus fi } stop_daemons () { ${cmddir}/launcher ${STOP_ARGS} 2>&1 | tee -a @logdir@/launcher_stop.log # RHEL specifics if test -d /var/lock/subsys; then rm -f /var/lock/subsys/torrus fi } case "$1" in 'start') start_daemons ;; 'stop') stop_daemons ;; 'restart') stop_daemons; start_daemons ;; 'status') ${cmddir}/launcher --cmd=status ;; *) echo "Usage: $0 [start|stop|restart]" ;; esac # Local Variables: # mode: shell-script # sh-shell: sh # indent-tabs-mode: nil # sh-basic-offset: 2 # End: torrus-3.00/Makefile.in0000644000175000017500000010375113131663305011770 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(top_srcdir)/setup_tools/substvars.sh.in \ $(top_srcdir)/setup_tools/mkvardir.sh.in \ $(top_srcdir)/init.d/torrus.in $(dist_discovery_DATA) \ $(dist_scripts_DATA) $(dist_tmpl_DATA) $(dist_xmlscripts_DATA) \ COPYING TODO conftools/config.guess conftools/config.sub \ conftools/install-sh conftools/missing \ $(top_srcdir)/conftools/config.guess \ $(top_srcdir)/conftools/config.sub \ $(top_srcdir)/conftools/install-sh \ $(top_srcdir)/conftools/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = setup_tools/substvars.sh setup_tools/mkvardir.sh \ init.d/torrus CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(discoverydir)" \ "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(tmpldir)" \ "$(DESTDIR)$(xmlscriptsdir)" DATA = $(dist_discovery_DATA) $(dist_scripts_DATA) $(dist_tmpl_DATA) \ $(dist_xmlscripts_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ FIND = @FIND@ GIT = @GIT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KILL = @KILL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERLCRITIC = @PERLCRITIC@ PERLINC = @PERLINC@ POD2MAN = @POD2MAN@ POD2TEXT = @POD2TEXT@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLEEP = @SLEEP@ STRIP = @STRIP@ SU = @SU@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cfgdefdir = @cfgdefdir@ datadir = @datadir@ datarootdir = @datarootdir@ defrrddir = @defrrddir@ distxmldir = @distxmldir@ docdir = @docdir@ dvidir = @dvidir@ enable_pkgonly = @enable_pkgonly@ enable_varperm = @enable_varperm@ exec_prefix = @exec_prefix@ exmpdir = @exmpdir@ gitrepodir = @gitrepodir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mansec_misc = @mansec_misc@ mansec_usercmd = @mansec_usercmd@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perllibdir = @perllibdir@ perllibdirs = @perllibdirs@ piddir = @piddir@ pkgbindir = @pkgbindir@ pkgdocdir = @pkgdocdir@ pkghome = @pkghome@ plugdevdisccfgdir = @plugdevdisccfgdir@ pluginsdir = @pluginsdir@ plugtorruscfgdir = @plugtorruscfgdir@ plugwrapperdir = @plugwrapperdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ reportsdir = @reportsdir@ sbindir = @sbindir@ scriptsdir = @scriptsdir@ seslockdir = @seslockdir@ sesstordir = @sesstordir@ sharedstatedir = @sharedstatedir@ siteconfdir = @siteconfdir@ sitedir = @sitedir@ sitexmldir = @sitexmldir@ srcdir = @srcdir@ supdir = @supdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tmpldir = @tmpldir@ tmpluserdir = @tmpluserdir@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ torrus_user = @torrus_user@ var_group = @var_group@ var_mode = @var_mode@ var_user = @var_user@ varprefix = @varprefix@ webplaindir = @webplaindir@ webscriptsdir = @webscriptsdir@ wrapperdir = @wrapperdir@ SUBDIRS = . bin configs doc examples lib sup xmlconfig SUBST = @abs_top_builddir@/setup_tools/substvars.sh EXTRA_DIST = \ setup_tools/cpanm_install_modules.sh \ setup_tools/configure_fhs \ setup_tools/check_perlthreading.pl \ systemd/torrus.service.in \ systemd/torrus.tmpfile.in noinst_SCRIPTS = \ setup_tools/substvars.sh \ setup_tools/mkvardir.sh \ init.d/torrus \ systemd/torrus.service \ systemd/torrus.tmpfile dist_tmpl_DATA = \ templates/aclexport.xml \ templates/adminfo.html \ templates/default-chooser.html \ templates/default-dir.html \ templates/default-helptext.html \ templates/default-login.html \ templates/default-recursivedir.html \ templates/default-rrd.html \ templates/default-tset.html \ templates/expanded-dir.html \ templates/globalsearch.html \ templates/overview-subleaves.html \ templates/report-index.html \ templates/report-monthly.html \ templates/report-serviceid.html \ templates/report-yearly.html \ templates/search.html \ templates/html-incblocks.txt \ templates/iframe-rrd.html \ templates/tset-list.html \ templates/email-alarm.txt CLEANFILES = \ systemd/torrus.service \ systemd/torrus.tmpfile dist_scripts_DATA = scripts/rrdup_notify.sh xmlscriptsdir = @scriptsdir@/xml dist_xmlscripts_DATA = scripts/xml/extract-skeleton.xsl discoverydir = @sitedir@/discovery dist_discovery_DATA = discovery/README mkvardir = @abs_top_builddir@/setup_tools/mkvardir.sh HTMLDIR = @abs_top_builddir@/../htdocs UPLOADPATH = \ ssinyagin,torrus@web.sourceforge.net:/home/groups/t/to/torrus/htdocs/devel PERLCRITIC_CMD = ${PERLCRITIC} --profile=critic.profile all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): setup_tools/substvars.sh: $(top_builddir)/config.status $(top_srcdir)/setup_tools/substvars.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ setup_tools/mkvardir.sh: $(top_builddir)/config.status $(top_srcdir)/setup_tools/mkvardir.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ init.d/torrus: $(top_builddir)/config.status $(top_srcdir)/init.d/torrus.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-dist_discoveryDATA: $(dist_discovery_DATA) @$(NORMAL_INSTALL) @list='$(dist_discovery_DATA)'; test -n "$(discoverydir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(discoverydir)'"; \ $(MKDIR_P) "$(DESTDIR)$(discoverydir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(discoverydir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(discoverydir)" || exit $$?; \ done uninstall-dist_discoveryDATA: @$(NORMAL_UNINSTALL) @list='$(dist_discovery_DATA)'; test -n "$(discoverydir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(discoverydir)'; $(am__uninstall_files_from_dir) install-dist_scriptsDATA: $(dist_scripts_DATA) @$(NORMAL_INSTALL) @list='$(dist_scripts_DATA)'; test -n "$(scriptsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(scriptsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(scriptsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(scriptsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(scriptsdir)" || exit $$?; \ done uninstall-dist_scriptsDATA: @$(NORMAL_UNINSTALL) @list='$(dist_scripts_DATA)'; test -n "$(scriptsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(scriptsdir)'; $(am__uninstall_files_from_dir) install-dist_tmplDATA: $(dist_tmpl_DATA) @$(NORMAL_INSTALL) @list='$(dist_tmpl_DATA)'; test -n "$(tmpldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(tmpldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(tmpldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(tmpldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(tmpldir)" || exit $$?; \ done uninstall-dist_tmplDATA: @$(NORMAL_UNINSTALL) @list='$(dist_tmpl_DATA)'; test -n "$(tmpldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(tmpldir)'; $(am__uninstall_files_from_dir) install-dist_xmlscriptsDATA: $(dist_xmlscripts_DATA) @$(NORMAL_INSTALL) @list='$(dist_xmlscripts_DATA)'; test -n "$(xmlscriptsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xmlscriptsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xmlscriptsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xmlscriptsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(xmlscriptsdir)" || exit $$?; \ done uninstall-dist_xmlscriptsDATA: @$(NORMAL_UNINSTALL) @list='$(dist_xmlscripts_DATA)'; test -n "$(xmlscriptsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xmlscriptsdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(discoverydir)" "$(DESTDIR)$(scriptsdir)" "$(DESTDIR)$(tmpldir)" "$(DESTDIR)$(xmlscriptsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-data-local install-dist_discoveryDATA \ install-dist_scriptsDATA install-dist_tmplDATA \ install-dist_xmlscriptsDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_discoveryDATA uninstall-dist_scriptsDATA \ uninstall-dist_tmplDATA uninstall-dist_xmlscriptsDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-dist_discoveryDATA \ install-dist_scriptsDATA install-dist_tmplDATA \ install-dist_xmlscriptsDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-dist_discoveryDATA \ uninstall-dist_scriptsDATA uninstall-dist_tmplDATA \ uninstall-dist_xmlscriptsDATA systemd/torrus.service: systemd/torrus.service.in $(SUBST) systemd/torrus.service.in > systemd/torrus.service systemd/torrus.tmpfile: systemd/torrus.tmpfile.in $(SUBST) systemd/torrus.tmpfile.in > systemd/torrus.tmpfile install-data-local: @echo Testing if prefix has changed during make test "$(prefix)" = "@prefix@" $(mkvardir) $(DESTDIR)$(gitrepodir) $(mkvardir) $(DESTDIR)$(piddir) $(mkvardir) $(DESTDIR)$(reportsdir) $(mkvardir) $(DESTDIR)$(logdir) $(mkvardir) $(DESTDIR)$(sesstordir) $(mkvardir) $(DESTDIR)$(seslockdir) $(mkinstalldirs) $(DESTDIR)$(tmpluserdir) $(mkinstalldirs) $(DESTDIR)$(plugtorruscfgdir) $(mkinstalldirs) $(DESTDIR)$(plugdevdisccfgdir) $(mkinstalldirs) $(DESTDIR)$(plugwrapperdir) htdocs: cd doc; make htdocs @for f in $(dist_mibs_DATA); do \ f2=$(HTMLDIR)/`basename $$f`; \ if test ! -f $$f2 -o $$f -nt $$f2; then \ echo "cp $$f $$f2"; \ cp $$f $$f2; \ fi; \ done upload: dist scp $(distdir).tar.gz TODO $(UPLOADPATH) todoup: scp TODO $(UPLOADPATH) dist-hook: date >DIST_REVISION git branch -vv >>DIST_REVISION cp DIST_REVISION $(distdir)/ critic: @if test ${PERLCRITIC} != no; then \ ${PERLCRITIC_CMD} `egrep -l '^\#..PERL' bin/*.in`; \ ${PERLCRITIC_CMD} lib/Torrus/; \ else \ echo 'perlcritic command not found'; \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torrus-3.00/discovery/0000755000175000017500000000000013131663306012004 500000000000000torrus-3.00/discovery/README0000644000175000017500000000031411545711242012602 00000000000000This directory is a typical place for SNMP device discovery instruction files. The discovery instruction files may be generated by "genddx" utility. They are used as the input for "devdiscover" utility. torrus-3.00/conftools/0000755000175000017500000000000013131663306012003 500000000000000torrus-3.00/conftools/install-sh0000755000175000017500000003413713131655331013736 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # $RANDOM is not portable (e.g. dash); use it when possible to # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so # create the $tmpdir first (and fail if unsuccessful) to make sure # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: torrus-3.00/conftools/config.sub0000755000175000017500000010577513131655331013724 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-09-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: torrus-3.00/conftools/config.guess0000755000175000017500000012355013131655331014250 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-03-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: torrus-3.00/conftools/missing0000755000175000017500000001533013131655331013323 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: torrus-3.00/examples/0000755000175000017500000000000013131663306011613 500000000000000torrus-3.00/examples/Makefile.am0000644000175000017500000000167612661115746013610 00000000000000 # Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # examplesdir = $(exmpdir) dist_examples_DATA = \ README \ onms.tmpl \ onmsInterfaces.sh \ torrus-siteconfig.powerbook.pl \ setmonitor.xupdate.xml torrus-3.00/examples/onms.tmpl0000644000175000017500000000341612661115746013420 00000000000000[%# Template-Toolkit template for OpenNMS Torrus config generation. Author: Gustavo Torres $Id$ %] [% PROCESS $data %] [% FOREACH interface = ifs %] [% FOREACH svc = interface.services; IF svc.name == 'icmp' %] [% ELSE %] [% END; END %] [% END %] torrus-3.00/examples/README0000644000175000017500000000066111545711243012417 00000000000000Some useful exmples of Torrus configuration and usage. XML configuration examples reside in xmlconfig/examples. *.xupdate.xml files are examples of XUpdate usage to modify the XML files generated by devdiscover. See also: Torrus User Guide XUpdate specification: http://www.xmldb.org/xupdate/ XUpdate implementation in Perl by Petr Pajas: XML::XUpdate::LibXML XML Editing shell by Petr Pajas: http://xsh.sourceforge.net/ torrus-3.00/examples/torrus-siteconfig.powerbook.pl0000644000175000017500000000262111661302716017566 00000000000000# Torrus Site config. Put all your site specifics here. # You need to stop and start Apache server every time you change this file. # # An example using the rainbow-schema overlay. # Shawn Ferry # # (ssinyagin) You can use statements like these from inside your # XML configurations: # # Besides, "devdiscover" discovery tool will soon support most # of these vendor definitions. # @(#) 10/18/03 torrus-siteconfig.pl 1.3 (10/18/03 18:44:31) sferry @Torrus::Global::xmlAlwaysIncludeFirst = qw( defaults.xml snmp-defs.xml collector-periods.xml vendor/cisco.ios.xml generic/rfc2790.host-resources.xml generic/rfc1213.xml vendor/ucd-snmp.xml ); %Torrus::Global::treeConfig = ( 'powerbook' => { 'description' => 'Powerbook Laptop Tree', 'xmlfiles' => [qw( powerbook/powerbook-defaults.xml powerbook/powerbook-ti.xml )], 'run' => { 'collector' => 1, } }, ); # CLOSE %Torrus::Global::treeConfig # Override values in the current schema with those in # rainbow schema, schema changes require an apache restart $Torrus::Renderer::stylingProfileOverlay = "rainbow-schema"; 1; torrus-3.00/examples/Makefile.in0000644000175000017500000003547513131655451013620 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = examples DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(dist_examples_DATA) README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(examplesdir)" DATA = $(dist_examples_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ FIND = @FIND@ GIT = @GIT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KILL = @KILL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERLCRITIC = @PERLCRITIC@ PERLINC = @PERLINC@ POD2MAN = @POD2MAN@ POD2TEXT = @POD2TEXT@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLEEP = @SLEEP@ STRIP = @STRIP@ SU = @SU@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cfgdefdir = @cfgdefdir@ datadir = @datadir@ datarootdir = @datarootdir@ defrrddir = @defrrddir@ distxmldir = @distxmldir@ docdir = @docdir@ dvidir = @dvidir@ enable_pkgonly = @enable_pkgonly@ enable_varperm = @enable_varperm@ exec_prefix = @exec_prefix@ exmpdir = @exmpdir@ gitrepodir = @gitrepodir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ logdir = @logdir@ mandir = @mandir@ mansec_misc = @mansec_misc@ mansec_usercmd = @mansec_usercmd@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ perllibdir = @perllibdir@ perllibdirs = @perllibdirs@ piddir = @piddir@ pkgbindir = @pkgbindir@ pkgdocdir = @pkgdocdir@ pkghome = @pkghome@ plugdevdisccfgdir = @plugdevdisccfgdir@ pluginsdir = @pluginsdir@ plugtorruscfgdir = @plugtorruscfgdir@ plugwrapperdir = @plugwrapperdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ reportsdir = @reportsdir@ sbindir = @sbindir@ scriptsdir = @scriptsdir@ seslockdir = @seslockdir@ sesstordir = @sesstordir@ sharedstatedir = @sharedstatedir@ siteconfdir = @siteconfdir@ sitedir = @sitedir@ sitexmldir = @sitexmldir@ srcdir = @srcdir@ supdir = @supdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tmpldir = @tmpldir@ tmpluserdir = @tmpluserdir@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ torrus_user = @torrus_user@ var_group = @var_group@ var_mode = @var_mode@ var_user = @var_user@ varprefix = @varprefix@ webplaindir = @webplaindir@ webscriptsdir = @webscriptsdir@ wrapperdir = @wrapperdir@ examplesdir = $(exmpdir) dist_examples_DATA = \ README \ onms.tmpl \ onmsInterfaces.sh \ torrus-siteconfig.powerbook.pl \ setmonitor.xupdate.xml all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-dist_examplesDATA: $(dist_examples_DATA) @$(NORMAL_INSTALL) @list='$(dist_examples_DATA)'; test -n "$(examplesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(examplesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(examplesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(examplesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(examplesdir)" || exit $$?; \ done uninstall-dist_examplesDATA: @$(NORMAL_UNINSTALL) @list='$(dist_examples_DATA)'; test -n "$(examplesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(examplesdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(examplesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_examplesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_examplesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_examplesDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_examplesDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: torrus-3.00/examples/setmonitor.xupdate.xml0000644000175000017500000000316412661115746016144 00000000000000 This file was modified with XUpdate script setmonitor.xupdate.xml ifErrors torrus-3.00/examples/onmsInterfaces.sh0000755000175000017500000000361012661115746015061 00000000000000#!/bin/sh # Copyright (C) 2004 Gustavo Torres # Copyright (C) 2004 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Gustavo Torres # Stanislav Sinyagin # # This shell script extracts OpenNMS information about interfaces # and builds the data file which you can use with onms.tmpl to generate # Torrus XML configuration. # Usage (RESPONSEDIR setting may be skipped if it's in the default path) # # RESPONSEDIR=/var/opennms/rrd/response # export RESPONSEDIR # cd /usr/local/torrus-0.1/share/torrus/ # ./examples/onmsInterfaces.sh > onms.data # tpage --define data=onms.data examples/onms.tmpl > xmlconfig/onms.xml if test x"$RESPONSEDIR" = x""; then RESPONSEDIR=/var/opennms/rrd/response fi echo '[% responsedir = "'$RESPONSEDIR'" %]' echo '[% ifs = [' for ipaddr in `ls ${RESPONSEDIR}`; do echo " { addr => '$i',"; echo " services => ["; for service in `ls ${RESPONSEDIR}/$i | awk -F. '{print $1}'`; do echo -n " {name => '${service}', " legend=`echo $j | awk '{print toupper($1)}'` echo "legend => '${legend}'}" done echo ' ]'; echo ' }'; done echo '] %]' # Local Variables: # mode: shell-script # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/0000755000175000017500000000000013131663306010543 500000000000000torrus-3.00/lib/Torrus/0000755000175000017500000000000013131663307012042 500000000000000torrus-3.00/lib/Torrus/ACL.pm0000644000175000017500000000645113131663306012724 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::ACL; use strict; use warnings; use Torrus::Redis; use Torrus::Log; BEGIN { if( not eval('require ' . $Torrus::ACL::userAuthModule) or $@ ) { die($@); } } sub new { my $self = {}; my $class = shift; my %options = @_; bless $self, $class; if( not eval('$self->{"auth"} = new ' . $Torrus::ACL::userAuthModule) or $@ ) { die($@); } $self->{'redis'} = Torrus::Redis->new(server => $Torrus::Global::redisServer); $self->{'users_hname'} = $Torrus::Global::redisPrefix . 'users'; $self->{'acl_hname'} = $Torrus::Global::redisPrefix . 'acl'; return $self; } sub _users_get { my $self = shift; my $key = shift; return $self->{'redis'}->hget($self->{'users_hname'}, $key); } sub hasPrivilege { my $self = shift; my $uid = shift; my $object = shift; my $privilege = shift; foreach my $group ( $self->memberOf( $uid ) ) { if( $self->{'redis'}->hget($self->{'acl_hname'}, $group.':'.$object.':'.$privilege ) ) { Debug('User ' . $uid . ' has privilege ' . $privilege . ' for ' . $object); return 1; } } if( $object ne '*' ) { return $self->hasPrivilege( $uid, '*', $privilege ); } Debug('User ' . $uid . ' has NO privilege ' . $privilege . ' for ' . $object); return undef; } sub memberOf { my $self = shift; my $uid = shift; my $glist = $self->_users_get('gm:' . $uid); return( defined( $glist ) ? split(',', $glist) : () ); } sub authenticateUser { my $self = shift; my $uid = shift; my $password = shift; my @attrList = $self->{'auth'}->getUserAttrList(); my $attrValues = {}; foreach my $attr ( @attrList ) { $attrValues->{$attr} = $self->userAttribute( $uid, $attr ); } my $ret = $self->{'auth'}->authenticateUser( $uid, $password, $attrValues ); Debug('User authentication: uid=' . $uid . ', result=' . ($ret ? 'true':'false')); return $ret; } sub userAttribute { my $self = shift; my $uid = shift; my $attr = shift; return $self->_users_get('ua:' . $uid . ':' . $attr); } sub groupAttribute { my $self = shift; my $group = shift; my $attr = shift; return $self->_users_get('ga:' . $group . ':' . $attr); } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/ConfigTree/0000755000175000017500000000000013131663307014067 500000000000000torrus-3.00/lib/Torrus/ConfigTree/Validator.pm0000644000175000017500000007414713131663306016306 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::ConfigTree::Validator; use strict; use warnings; use Torrus::ConfigTree; use Torrus::Log; use Torrus::RPN; use Torrus::SiteConfig; Torrus::SiteConfig::loadStyling(); %Torrus::ConfigTree::Validator::reportedErrors = (); my %rrd_params = ( 'leaf-type' => {'rrd-def' => {'rrd-ds' => undef, 'rrd-cf' => {'AVERAGE' => undef, 'MIN' => undef, 'MAX' => undef, 'LAST' => undef}, 'data-file' => undef, 'data-dir' => undef}, 'rrd-cdef' => {'rpn-expr' => undef}}, ); my %rrdmulti_params = ( 'ds-names' => undef ); # Plugins might need to add a new storage type our %collector_params = ( 'collector-type' => undef, '@storage-type' => { 'rrd' => { 'data-file' => undef, 'data-dir' => undef, 'leaf-type' => { 'rrd-def' => {'rrd-ds' => undef, 'rrd-cf' => {'AVERAGE' => undef, 'MIN' => undef, 'MAX' => undef, 'LAST' => undef}, 'rrd-create-dstype' => {'GAUGE' => undef, 'COUNTER' => undef, 'DERIVE' => undef, 'ABSOLUTE' => undef }, 'rrd-create-rra' => undef, 'rrd-create-heartbeat' => undef, 'rrd-create-min' => undef, 'rrd-create-max' => undef, '+rrd-hwpredict' => { 'enabled' => { 'rrd-create-hw-alpha' => undef, 'rrd-create-hw-beta' => undef, 'rrd-create-hw-gamma' => undef, 'rrd-create-hw-winlen' => undef, 'rrd-create-hw-failth' => undef, 'rrd-create-hw-season' => undef, 'rrd-create-hw-rralen' => undef}, 'disabled' => undef, }}}}, 'ext' => { 'ext-dstype' => { 'GAUGE' => undef, 'COUNTER32' => { '+ext-counter-max' => undef, }, 'COUNTER64' => { '+ext-counter-max' => undef, }, }, 'ext-service-id' => undef, '+ext-service-units' => { 'bytes' => undef }}}, 'collector-period' => undef, 'collector-timeoffset' => undef, '+collector-dispersed-timeoffset' => { 'no' => undef, 'yes' => undef } # collector-timeoffset-min, max, step, and hashstring are validated # during post-processing ); # Plugins might in theory create new datasource types our %leaf_params = ('ds-type' => {'rrd-file' => \%rrd_params, 'rrd-multigraph' => \%rrdmulti_params, 'collector' => \%collector_params}, 'rrgraph-views' => undef, '+rrd-scaling-base' => {'1000' => undef, '1024' => undef}, '+graph-logarithmic' => {'yes' => undef, 'no' => undef}, '+graph-rigid-boundaries' => {'yes' => undef, 'no' => undef}, '+graph-ignore-decorations' => {'yes' => undef, 'no' => undef}); my %monitor_params = ('monitor-type' => {'expression' => {'rpn-expr' => undef}, 'failures' => undef}, 'action' => undef, 'expires' => undef ); my %action_params = ('action-type' => {'tset' => {'tset-name' => undef}, 'exec' => {'command' => undef} } ); my %view_params = ('expires' => undef, 'view-type' => {'rrgraph' => {'width' => undef, 'height' => undef, 'start' => undef, 'line-style' => undef, 'line-color' => undef, '+ignore-limits' => { 'yes'=>undef, 'no'=>undef }, '+ignore-lower-limit' => { 'yes'=>undef, 'no'=>undef }, '+ignore-upper-limit' => { 'yes'=>undef, 'no'=>undef }}, 'rrprint' => {'start' => undef, 'print-cf' => undef}, 'html' => {'html-template' => undef}, 'adminfo' => undef, 'rpc' => undef, 'health' => {'good-img' => undef, 'warning-img' => undef, 'critical-img' => undef, 'mime-type' => undef}} ); # Load additional validation, configurable from # torrus-config.pl and torrus-siteconfig.pl foreach my $mod ( @Torrus::Validator::loadLeafValidators ) { if( not eval('require ' . $mod) or $@ ) { die($@); } if( not eval('&' . $mod . '::initValidatorLeafParams(\%leaf_params); 1;') or $@ ) { die($@); } } sub validateNodes { my $config_tree = shift; my $ok = 1; $config_tree->{'n_validated_nodes'} = 0; $config_tree->{'validated_tokens'} = {}; foreach my $token (keys %{$config_tree->{'updated_tokens'}}) { $ok = validateNode($config_tree, $token) ? $ok:0; } Verbose('Finished validation on ' . $config_tree->{'n_validated_nodes'} . ' leaves'); return $ok; } sub validateNode { my $config_tree = shift; my $token = shift; my $ok = 1; if( $config_tree->{'validated_tokens'}{$token} ) { return 1; } $config_tree->{'validated_tokens'}{$token} = 1; if( $config_tree->isLeaf($token) ) { $config_tree->{'n_validated_nodes'}++; # Verify the default view my $view = $config_tree->getNodeParam( $token, 'default-leaf-view' ); if( not defined( $view ) ) { my $path = $config_tree->path( $token ); Error("Default view is not defined for leaf $path"); $ok = 0; } elsif( not $config_tree->{'validator'}{'viewExists'}{$view} and not $config_tree->viewExists( $view ) ) { my $path = $config_tree->path( $token ); Error("Non-existent view is defined as default for leaf $path"); $ok = 0; } else { # Cache the view name $config_tree->{'validator'}{'viewExists'}{$view} = 1; } # Verify parameters $ok = defined($config_tree->getInstanceParamsByMap( $token, 'node', \%leaf_params)); if( $ok ) { my $rrviewslist = $config_tree->getNodeParam( $token, 'rrgraph-views' ); # Check the cache first if( not $config_tree->{'validator'}{'graphviews'}{$rrviewslist} ) { my @rrviews = split( ',', $rrviewslist ); if( scalar(@rrviews) != 5 ) { my $path = $config_tree->path( $token ); Error('rrgraph-views sould refer 5 views in' . $path); $ok = 0; } else { foreach my $view ( @rrviews ) { if( not $config_tree->viewExists( $view ) ) { my $path = $config_tree->path( $token ); Error("Non-existent view ($view) is defined in " . "rrgraph-views for $path"); $ok = 0; } elsif( $config_tree->getOtherParam($view, 'view-type') ne 'rrgraph' ) { my $path = $config_tree->path( $token ); Error("View $view is not of type rrgraph in " . "rrgraph-views for $path"); $ok = 0; } } } if( $ok ) { # Store the cache $config_tree->{'validator'}{'graphviews'}{$rrviewslist}=1; } } } # Verify monitor references my $mlist = $config_tree->getNodeParam( $token, 'monitor' ); if( defined $mlist ) { foreach my $param ( 'monitor-period', 'monitor-timeoffset' ) { if( not defined( $config_tree->getNodeParam( $token, $param ) ) ) { my $path = $config_tree->path( $token ); Error('Mandatory parameter ' . $param . ' is not defined in ' . $path); $ok = 0; } } foreach my $monitor ( split(',', $mlist) ) { if( not $config_tree->{'validator'}{'monitorExists'}{$monitor} and not $config_tree->monitorExists( $monitor ) ) { my $path = $config_tree->path( $token ); Error("Non-existent monitor: $monitor in $path"); $ok = 0; } else { $config_tree->{'validator'}{'monitorExists'}{$monitor} = 1; } } my $varstring = $config_tree->getNodeParam( $token, 'monitor-vars' ); if( defined $varstring ) { foreach my $pair ( split( '\s*;\s*', $varstring ) ) { if( $pair !~ /^\w+\s*\=\s*[0-9\-+.eU]+$/o ) { Error("Syntax error in monitor variables: $pair"); $ok = 0; } } } my $action_target = $config_tree->getNodeParam($token, 'monitor-action-target'); if( defined( $action_target ) ) { my $target = $config_tree->getRelative($token, $action_target); if( not defined( $target ) ) { my $path = $config_tree->path( $token ); Error('monitor-action-target points to an invalid path: ' . $action_target . ' in ' . $path); $ok = 0; } elsif( not $config_tree->isLeaf( $target ) ) { my $path = $config_tree->path( $token ); Error('monitor-action-target must point to a leaf: ' . $action_target . ' in ' . $path); $ok = 0; } } } # Verify if the data-dir exists my $datadir = $config_tree->getNodeParam( $token, 'data-dir' ); if( defined $datadir ) { if( not $config_tree->{'validator'}{'dirExists'}{$datadir} and not ( -d $datadir ) and not $Torrus::ConfigTree::Validator::reportedErrors{$datadir} ) { my $path = $config_tree->path( $token ); Error("Directory does not exist: $datadir in $path"); $ok = 0; $Torrus::ConfigTree::Validator::reportedErrors{$datadir} = 1; } else { # Store the cache $config_tree->{'validator'}{'dirExists'}{$datadir} = 1; } } # Verify type-specific parameters my $dsType = $config_tree->getNodeParam( $token, 'ds-type' ); if( not defined( $dsType ) ) { # Writer has already complained return 0; } if( $dsType eq 'rrd-multigraph' ) { my @dsNames = split(',', $config_tree->getNodeParam( $token, 'ds-names' ) ); if( scalar(@dsNames) == 0 ) { my $path = $config_tree->path( $token ); Error("ds-names list is empty in $path"); $ok = 0; } foreach my $dname ( @dsNames ) { { my $param = 'ds-expr-' . $dname; my $expr = $config_tree->getNodeParam( $token, $param ); if( not defined( $expr ) ) { my $path = $config_tree->path( $token ); Error("Parameter $param is not defined in $path"); $ok = 0; } else { $ok = validateRPN( $token, $expr, $config_tree ) ? $ok : 0; } } foreach my $paramprefix ( 'graph-legend-', 'line-style-', 'line-color-', 'line-order-' ) { my $param = $paramprefix.$dname; my $value = $config_tree->getNodeParam($token, $param); if( not defined( $value ) ) { my $path = $config_tree->path( $token ); Error('Parameter ' . $param . ' is not defined in ' . $path); $ok = 0; } elsif( $param eq 'line-style-' and not validateLine( $value ) ) { my $path = $config_tree->path( $token ); Error('Parameter ' . $param . ' is defined incorrectly in ' . $path); $ok = 0; } elsif( $param eq 'line-color-' and not validateColor( $value ) ) { my $path = $config_tree->path( $token ); Error('Parameter ' . $param . ' is defined incorrectly in ' . $path); $ok = 0; } } } } elsif( $dsType eq 'rrd-file' and $config_tree->getNodeParam( $token, 'leaf-type' ) eq 'rrd-cdef') { my $expr = $config_tree->getNodeParam( $token, 'rpn-expr' ); if( defined( $expr ) ) { $ok = validateRPN( $token, $expr, $config_tree ) ? $ok : 0; } # Otherwise already reported by getInstanceParamsByMap() } elsif($dsType eq 'collector' and $config_tree->getNodeParam( $token, 'collector-type' ) eq 'snmp') { # Check the OID syntax my $oid = $config_tree->getNodeParam( $token, 'snmp-object' ); if( defined($oid) and $oid =~ /^\./o ) { my $path = $config_tree->path( $token ); Error("Invalid syntax for snmp-object in " . $path . ": OID must not start with dot"); $ok = 0; } } } else { # This is subtree my $view = $config_tree->getNodeParam( $token, 'default-subtree-view' ); if( not defined( $view ) ) { my $path = $config_tree->path( $token ); Error("Default view is not defined for subtree $path"); $ok = 0; } elsif( not $config_tree->{'validator'}{'viewExists'}{$view} and not $config_tree->viewExists( $view ) ) { my $path = $config_tree->path( $token ); Error("Non-existent view is defined as default for subtree $path"); $ok = 0; } else { # Store the cache $config_tree->{'validator'}{'viewExists'}{$view} = 1; } foreach my $ctoken ( $config_tree->getChildren($token) ) { $ok = validateNode($config_tree, $ctoken) ? $ok:0; } } return $ok; } my %validFuntcionNames = ( 'AVERAGE' => 1, 'MIN' => 1, 'MAX' => 1, 'LAST' => 1, 'T' => 1 ); sub validateRPN { my $token = shift; my $expr = shift; my $config_tree = shift; my $timeoffset_supported = shift; my $ok = 1; # There must be at least one DS reference my $ds_couter = 0; my $rpn = new Torrus::RPN; # The callback for RPN translation my $callback = sub { my ($noderef, $timeoffset) = @_; my $function; if( $noderef =~ s/^(.+)\@//o ) { $function = $1; } if( defined( $function ) and not $validFuntcionNames{$function} ) { my $path = $config_tree->path($token); Error('Invalid function name ' . $function . ' in node reference at ' . $path); $ok = 0; return undef; } my $leaf = length($noderef) > 0 ? $config_tree->getRelative($token, $noderef) : $token; if( not defined $leaf ) { my $path = $config_tree->path($token); Error("Cannot find relative reference $noderef at $path"); $ok = 0; return undef; } if( not $config_tree->isLeaf( $leaf ) ) { my $path = $config_tree->path($token); Error("Relative reference $noderef at $path is not a leaf"); $ok = 0; return undef; } if( $config_tree->getNodeParam($leaf, 'leaf-type') ne 'rrd-def' ) { my $path = $config_tree->path($token); Error("Relative reference $noderef at $path must point to a ". "leaf of type rrd-def"); $ok = 0; return undef; } if( defined( $timeoffset ) and not $timeoffset_supported ) { my $path = $config_tree->path($token); Error("Time offsets are not supported at $path"); $ok = 0; return undef; } $ds_couter++; return 'TESTED'; }; $rpn->translate( $expr, $callback ); if( $ok and $ds_couter == 0 ) { my $path = $config_tree->path($token); Error("RPN must contain at least one DS reference at $path"); $ok = 0; } return $ok; } sub validateViews { my $config_tree = shift; my $ok = 1; foreach my $view ($config_tree->getViewNames()) { $ok = defined($config_tree->getInstanceParamsByMap( $view, 'view', \%view_params)) ? $ok:0; if( $ok and $config_tree->getOtherParam($view, 'view-type') eq 'rrgraph' ) { my $hrulesList = $config_tree->getOtherParam($view, 'hrules'); if( defined( $hrulesList ) ) { foreach my $hrule ( split(',', $hrulesList ) ) { my $valueParam = $config_tree->getOtherParam($view, 'hrule-value-' . $hrule); if( not defined( $valueParam ) or $valueParam !~ /^\S+$/o ) { Error('Mandatory parameter hrule-value-' . $hrule . ' is not defined or incorrect for view ' . $view); $ok = 0; } my $color = $config_tree->getOtherParam($view, 'hrule-color-'.$hrule); if( not defined( $color ) ) { Error('Mandatory parameter hrule-color-' . $hrule . ' is not defined for view ' . $view); $ok = 0; } else { $ok = validateColor( $color ) ? $ok:0; } } } my $decorList = $config_tree->getOtherParam($view, 'decorations'); if( defined( $decorList ) ) { foreach my $decorName ( split(',', $decorList ) ) { foreach my $paramName ( qw(order style color expr) ) { my $param = 'dec-' . $paramName . '-' . $decorName; if( not defined( $config_tree-> getOtherParam($view, $param) ) ) { Error('Missing parameter: ' . $param . ' in view ' . $view); $ok = 0; } } $ok = validateLine ( $config_tree->getOtherParam ($view, 'dec-style-' . $decorName) ) ? $ok:0; $ok = validateColor ( $config_tree-> getOtherParam($view, 'dec-color-' . $decorName) ) ? $ok:0; } } $ok = validateColor( $config_tree->getOtherParam($view, 'line-color') ) ? $ok:0; $ok = validateLine( $config_tree->getOtherParam($view, 'line-style') ) ? $ok:0; my $gprintValues = $config_tree->getOtherParam($view, 'gprint-values'); if( defined( $gprintValues ) and length( $gprintValues ) > 0 ) { foreach my $gprintVal ( split(',', $gprintValues ) ) { my $format = $config_tree->getOtherParam ($view, 'gprint-format-' . $gprintVal); if( not defined( $format ) or length( $format ) == 0 ) { Error('GPRINT format for ' . $gprintVal . ' is not defined for view ' . $view); $ok = 0; } } } } } return $ok; } sub validateColor { my $color = shift; my $ok = 1; if( $color !~ /^\#[0-9a-fA-F]{6}$/o ) { if( $color =~ /^\#\#(\S+)$/o ) { if( not $Torrus::Renderer::graphStyles{$1}{'color'} ) { Error('Incorrect color reference: ' . $color); $ok = 0; } } else { Error('Incorrect color syntax: ' . $color); $ok = 0; } } return $ok; } sub validateLine { my $line = shift; my $ok = 1; if( $line =~ /^\#\#(\S+)$/o ) { if( not $Torrus::Renderer::graphStyles{$1}{'line'} ) { Error('Incorrect line style reference: ' . $line); $ok = 0; } } elsif( not $Torrus::SiteConfig::validLineStyles{$line} ) { Error('Incorrect line syntax: ' . $line); $ok = 0; } return $ok; } sub validateMonitors { my $config_tree = shift; my $ok = 1; foreach my $action ($config_tree->getActionNames()) { $ok = defined($config_tree->getInstanceParamsByMap( $action, 'action', \%action_params)) ? $ok:0; my $atype = $config_tree->getOtherParam($action, 'action-type'); if( $atype eq 'tset' ) { my $tset = $config_tree->getOtherParam($action, 'tset-name'); if( defined $tset ) { $tset = 'S'.$tset; if( not $config_tree->tsetExists( $tset ) ) { Error("Token-set does not exist: $tset in action $action"); $ok = 0; } } # Otherwise the error is already reported by getInstanceParamsByMap } elsif( $atype eq 'exec' ) { my $launch_when = $config_tree->getOtherParam($action, 'launch-when'); if( defined $launch_when ) { foreach my $when ( split(',', $launch_when) ) { my $matched = 0; foreach my $event ('set', 'repeat', 'escalate', 'clear', 'clear_escalation', 'forget') { if( $when eq $event ) { $matched = 1; } } if( not $matched ) { Error("Invalid value in parameter launch-when " . "in action $action: $when"); $ok = 0; } } } my $setenv_dataexpr = $config_tree->getOtherParam( $action, 'setenv-dataexpr' ); if( defined( $setenv_dataexpr ) ) { # foreach my $pair ( split( ',', $setenv_dataexpr ) ) { my ($env, $param) = split( '=', $pair ); if( not $param ) { Error("Syntax error in setenv-dataexpr in action " . $action . ": \"" . $pair . "\""); $ok = 0; } elsif( $env =~ /\W/o ) { Error("Illegal characters in environment variable ". "name in setenv-dataexpr in action " . $action . ": \"" . $env . "\""); $ok = 0; } elsif( not defined ($config_tree->getOtherParam ($action, $param) ) ) { Error("Parameter referenced in setenv-dataexpr is " . "not defined in action " . $action . ": " . $param); $ok = 0; } } } } } foreach my $monitor ($config_tree->getMonitorNames()) { $ok = defined($config_tree->getInstanceParamsByMap( $monitor, 'monitor', \%monitor_params)) ? $ok:0; my $alist = $config_tree->getOtherParam( $monitor, 'action' ); foreach my $action ( split(',', $alist ) ) { if( not $config_tree->actionExists( $action ) ) { Error("Non-existent action: $action in monitor $monitor"); $ok = 0; } } my $esc = $config_tree->getOtherParam($monitor, 'escalations'); if( defined($esc) ) { my @escalation_times = split(',', $esc); if( scalar(@escalation_times) == 0 ) { Error("\"escalations\" is empty in $monitor"); $ok = 0; } foreach my $esc_time (@escalation_times) { if( $esc_time !~ /^\d+$/ or $esc_time == 0 ) { Error("$esc_time is not a positive integer in " . "\"escalations\" in $monitor"); $ok = 0; } } } } return $ok; } sub validateTokensets { my $config_tree = shift; my $ok = 1; my $view = $config_tree->getOtherParam( 'SS', 'default-tsetlist-view' ); if( not defined( $view ) ) { Error("View is not defined for tokensets list"); $ok = 0; } elsif( not $config_tree->viewExists( $view ) ) { Error("Non-existent view is defined for tokensets list"); $ok = 0; } foreach my $tset ($config_tree->getTsets()) { $view = $config_tree->getOtherParam($tset, 'default-tset-view'); if( not defined( $view ) ) { $view = $config_tree->getOtherParam('SS', 'default-tset-view'); } if( not defined( $view ) ) { Error("Default view is not defined for tokenset $tset"); $ok = 0; } elsif( not $config_tree->viewExists( $view ) ) { Error("Non-existent view is defined for tokenset $tset"); $ok = 0; } } return $ok; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/ConfigTree/Writer.pm0000644000175000017500000013441113131663307015625 00000000000000# Copyright (C) 2002-2007 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # # Write access for ConfigTree # package Torrus::ConfigTree::Writer; use strict; use warnings; use base 'Torrus::ConfigTree'; use Torrus::Log; use Torrus::SiteConfig; use Torrus::ServiceID; use Torrus::ConfigTree::Validator; use Git::ObjectStore; use Git::Raw; use Digest::MD5 qw(md5); # needed as hash function use POSIX; # we use ceil() from here use Digest::SHA qw(sha1_hex); $Carp::Verbose = 1; our %multigraph_remove_space = ('ds-expr-' => 1, 'graph-legend-' => 0); my $srvIdParams = new Torrus::ServiceID; sub new { my $proto = shift; my %options = @_; my $class = ref($proto) || $proto; $options{'-WriteAccess'} = 1; my $self = $class->SUPER::new( %options ); if( not defined( $self ) ) { return undef; } bless $self, $class; if( $self->{'store'}->created_init_commit() ) { # The configtree branch is newly created. Cleanup Redis information. $self->_remove_githead(); } if( $options{'-ForceRebuild'} or not defined($self->currentCommit()) ) { $self->{'force_rebuild'} = 1; } # set up the srcfiles branch $self->{'srcstore'} = new Git::ObjectStore( 'repodir' => $self->{'repodir'}, 'branchname' => $self->treeName() . '_srcfiles', 'writer' => 1, %{$self->{'store_author'}}); $self->{'viewparent'} = {}; $self->{'collectorInstances'} = Torrus::SiteConfig::agentInstances( $self->treeName(), 'collector' ); $self->{'is_writing'} = 1; $self->{'srcfiles_processing_now'} = {}; $self->{'srcfiles_processed'} = {}; $self->{'srcfiles_updated'} = {}; $self->{'srcrefs'} = $self->_read_json('srcrefs'); $self->{'srcrefs'} = {} unless defined $self->{'srcrefs'}; $self->{'srcglobaldeps'} = $self->_read_json('srcglobaldeps'); $self->{'srcglobaldeps'} = {} unless defined $self->{'srcglobaldeps'}; $self->{'srcincludes'} = $self->_read_json('srcincludes'); $self->{'srcincludes'} = {} unless defined $self->{'srcincludes'}; $self->{'serviceid_tokens'} = $srvIdParams->getAllTokens(); $self->{'writerpidhash'} = $self->{'redis_prefix'} . 'writer:' . $self->{'repodir'}; $self->{'writerpid'} = $$; $self->{'redis'}->hset($self->{'writerpidhash'}, $self->{'writerpid'}, time()); return $self; } sub DESTROY { my $self = shift; $self->{'redis'}->hdel($self->{'writerpidhash'}, $self->{'writerpid'}); } sub _agents_ref_name { my $self = shift; return 'refs/heads/' . $self->treeName() . '_agents_ref'; } sub _node_read { my $self = shift; my $token = shift; my $ret; if( defined($self->{'editing_node'}) and $token eq $self->{'editing_node'} ) { $ret = $self->{'editing'}; } else { $ret = $self->SUPER::_node_read($token); } if( defined($ret) ) { foreach my $name (keys %{$ret->{'vars'}}) { $self->{'setvar'}{$token}{$name} = $ret->{'vars'}{$name}; } } return $ret; } sub _agent_instance_name { my $self = shift; my $agent = shift; my $instance = shift; return sprintf('%s_%.4x', $agent, $instance); } sub _agent_branch_name { my $self = shift; my $agent = shift; my $instance = shift; return $self->{'treename'} . '_' . $self->_agent_instance_name($agent, $instance); } sub _write_json { my $self = shift; my $filename = shift; my $data = shift; $self->{'store'}->write_file($filename, $self->{'json'}->encode($data)); return; } sub startEditingOthers { my $self = shift; my $filename = shift; $self->{'others_list_file'} = 'other/' . $filename; my $old_list = $self->_read_json($self->{'others_list_file'}); $old_list = {} unless defined($old_list); $self->{'others_list'} = $old_list; } sub addOtherObject { my $self = shift; my $name = shift; if( not defined($self->{'others_list_file'}) ) { die('startEditingOthers() was not called'); } $self->{'others_list'}{$name} = 1; $self->editOther($name); return; } sub endEditingOthers { my $self = shift; $self->_write_json($self->{'others_list_file'}, $self->{'others_list'}); delete $self->{'others_list_file'}; delete $self->{'others_list'}; return; } sub editOther { my $self = shift; my $name = shift; if( defined($self->{'editing'}) ) { die('another object is being edited'); } my $obj = $self->_other_read($name); if( not defined($obj) ) { $obj = {'params' => {}}; } $self->{'editing'} = $obj; $self->{'editing_name'} = $name; return; } sub setOtherParam { my $self = shift; my $param = shift; my $value = shift; if( $self->getParamProperty( $param, 'remspace' ) ) { $value =~ s/\s+//sgo; } elsif( $self->getParamProperty( $param, 'squashspace' ) ) { $value =~ s/\s+/ /sgo; } my $oldval = $self->{'editing'}{'params'}{$param}; if( not defined($oldval) or $oldval ne $value ) { $self->{'editing'}{'params'}{$param} = $value; $self->{'editing_dirty'} = 1; } return; } sub commitOther { my $self = shift; if( not defined($self->{'editing'}) ) { die('setOtherParam() called before editOther()'); } if( not defined($self->{'editing_name'}) ) { die('a node object is being edited'); } if( $self->{'editing_dirty'} ) { $self->_write_json('other/' . $self->{'editing_name'}, $self->{'editing'}); } delete $self->{'editing'}; delete $self->{'editing_name'}; delete $self->{'editing_dirty'}; } # editNode can be called more than once on the same node, so we do # nothing in this case. # If it's called for a different node, we commit the previous one. sub editNode { my $self = shift; my $path = shift; my $token = $self->token($path, 1); if( defined($self->{'editing'}) ) { if( $self->{'editing_node'} eq $token ) { return $token; } else { $self->commitNode(); } } my $node = $self->_node_read($token); if( not defined($node) ) { my $is_subtree = ($path =~ /\/$/) ? 1:0; my $parent_token; if( $path eq '/' ) { $parent_token = ''; } else { my $slashpos = rindex($path, '/', length($path) - ($is_subtree?2:0)); my $parent_path = substr($path, 0, $slashpos+1); $parent_token = $self->token($parent_path, 1); my $parent_node = $self->_node_read($parent_token); if( not defined($parent_node) or not $parent_node->{'children'}->{$token} ) { # add a child token $self->editNode($parent_path); $self->{'editing'}{'children'}{$token} = 1; $self->{'editing_dirty_children'} = 1; $self->commitNode(); } } $node = { 'is_subtree' => $is_subtree, 'parent' => $parent_token, 'path' => $path, 'params' => {}, 'vars' => {}, }; if( $is_subtree ) { $node->{'children'} = {}; $self->{'editing_dirty_children'} = 1; } $self->{'editing_dirty'} = 1; $self->{'objcache'}->set($token => $node); } else { $self->{'updating_node'} = 1; } $self->{'editing'} = $node; $self->{'editing_node'} = $token; return $token; } sub setNodeParam { my $self = shift; my $param = shift; my $value = shift; if( $self->getParamProperty( $param, 'remspace' ) ) { $value =~ s/\s+//go; } elsif( $self->getParamProperty( $param, 'squashspace' ) ) { $value =~ s/\s+/ /sgo; } my $oldval = $self->{'editing'}{'params'}{$param}; if( not defined($oldval) or $oldval ne $value ) { $self->{'editing'}{'params'}{$param} = $value; $self->{'editing_dirty'} = 1; $self->{'editing_dirty_params'} = 1; } return; } sub setVar { my $self = shift; my $token = shift; my $name = shift; my $value = shift; $self->{'setvar'}{$token}{$name} = $value; my $oldval = $self->{'editing'}{'vars'}{$name}; if( not defined($oldval) or $oldval ne $value ) { $self->{'editing'}{'vars'}{$name} = $value; $self->{'editing_dirty'} = 1; $self->{'editing_dirty_params'} = 1; } return; } sub commitNode { my $self = shift; if( not defined($self->{'editing'}) ) { die('setOtherParam() called before editOther()'); } if( not defined($self->{'editing_node'}) ) { die('an object being edited is not a node'); } if( $self->{'editing_dirty'} or $self->{'editing_dirty_children'} ) { my $sha_file = $self->_sha_file($self->{'editing_node'}); if( $self->{'editing_dirty'} ) { my $data = { 'is_subtree' => $self->{'editing'}{'is_subtree'}, 'parent' => $self->{'editing'}{'parent'}, 'path' => $self->{'editing'}{'path'}, 'params' => $self->{'editing'}{'params'}, 'vars' => $self->{'editing'}{'vars'}, }; if( $self->{'editing_dirty_params'} ) { # find the topmost ancestor that is affected by each source file if( defined($self->{'editing'}{'src'}) ) { $data->{'src'} = $self->{'editing'}{'src'}; } foreach my $srcfile (keys %{$self->{'srcfiles_processing_now'}}) { my $src_found; if( defined($data->{'src'}) and $data->{'src'}{$srcfile} ) { $src_found = 1; } my $ancestor; if( not $src_found ) { $ancestor = $data->{'parent'}; } while( not $src_found and $ancestor ne '' ) { my $node = $self->_node_read($ancestor); if( defined($node->{'src'}) and $node->{'src'}{$srcfile} ) { $src_found = 1; } $ancestor = $node->{'parent'}; } if( not $src_found ) { my $had_src_before = defined($data->{'src'}); $data->{'src'}{$srcfile} = 1; $self->{'srcrefs'}{$srcfile}{ $self->{'editing_node'}} = 1; if( not $had_src_before ) { # this is for the object cache $self->{'editing'}{'src'}{$srcfile} = 1; } if( $self->{'updating_node'} ) { # this srcfile is updating a previously # defined node. Now we find a nearest parent # with source references and copy them here. if( not $had_src_before ) { $ancestor = $data->{'parent'}; my $found_ancestor_with_src; while( not defined($found_ancestor_with_src) and $ancestor ne '' ) { my $node = $self->_node_read($ancestor); if( defined($node->{'src'}) ) { $found_ancestor_with_src = $node; } $ancestor = $node->{'parent'}; } if( defined($found_ancestor_with_src) ) { foreach my $ancsrc (keys %{$found_ancestor_with_src-> {'src'}}) { $data->{'src'}{$ancsrc} = 1; $self->{'srcrefs'}{$ancsrc}{ $self->{'editing_node'}} = 1; $self->{'editing'}{'src'}{$ancsrc} = 1; } } } } } } } $self->_write_json('nodes/' . $sha_file, $data); } if( $self->{'editing_dirty_children'} ) { $self->_write_json('children/' . $sha_file, $self->{'editing'}{'children'}); } } delete $self->{'editing'}; delete $self->{'editing_node'}; delete $self->{'editing_dirty'}; delete $self->{'editing_dirty_params'}; delete $self->{'editing_dirty_children'}; delete $self->{'updating_node'}; return; } sub setParamProperty { my $self = shift; my $param = shift; my $prop = shift; my $value = shift; $self->{'paramprop'}{$prop}{$param} = $value; return; } sub addView { my $self = shift; my $vname = shift; my $parent = shift; if( defined( $parent ) ) { $self->{'viewparent'}{$vname} = $parent; } $self->addOtherObject($vname); return; } sub addDefinition { my $self = shift; my $name = shift; my $value = shift; $self->_write_json('definitions/' . $name, $value); return; } sub isTrueVar { my $self = shift; my $token = shift; my $name = shift; my $ret = 0; while( $token ne '' and not defined($self->{'setvar'}{$token}{$name}) ) { my $node = $self->_node_read($token); $token = $node->{'parent'}; } if( $token ne '' ) { my $value = $self->{'setvar'}{$token}{$name}; if( defined($value) ) { if( $value eq 'true' or $value =~ /^\d+$/o and $value ) { $ret = 1; } } } return $ret; } sub commitConfig { my $self = shift; $self->editNode('/'); $self->setNodeParam('tree-name', $self->treeName()); $self->commitNode(); $self->_write_json('srcrefs', $self->{'srcrefs'}); $self->_write_json('srcglobaldeps', $self->{'srcglobaldeps'}); $self->_write_json('srcincludes', $self->{'srcincludes'}); $self->_write_json('paramprops', $self->{'paramprop'}); $self->{'n_postprocessed_nodes'} = 0; $self->{'postprocessed_tokens'} = {}; $self->{'updated_tokens'} = {}; foreach my $srcfile (@{$self->{'srcfiles_rebuild_list'}}) { if( defined($self->{'srcrefs'}{$srcfile}) ) { foreach my $token (keys %{$self->{'srcrefs'}{$srcfile}}) { $self->{'updated_tokens'}{$token} = 1; } } } foreach my $token (keys %{$self->{'updated_tokens'}}) { if( not $self->_post_process_nodes($token) ) { return 0; } } Verbose('Finished post-processing of ' . $self->{'n_postprocessed_nodes'} . ' nodes'); # Propagate view inherited parameters $self->{'viewParamsProcessed'} = {}; foreach my $vname ( $self->getViewNames() ) { $self->_propagate_view_params( $vname ); } my $src_changed = $self->{'srcstore'}->create_commit_and_packfile(); if( $src_changed or $self->{'force_rebuild'} ) { my $src_commit_id = $self->{'srcstore'}->current_commit_id(); Debug('Wrote ' . $src_commit_id . ' in ' . $self->treeName() . '_srcfiles'); Debug("Something is changed in source files"); $self->_write_json('srcrev', $self->{'srcstore'}->current_commit_id()); $self->{'config_updated'} = $self->{'store'}->create_commit_and_packfile(); } if( $self->{'config_updated'} or $self->{'force_rebuild'} ) { $self->{'new_commit'} = $self->{'store'}->current_commit_id(); } if( $self->{'config_updated'} ) { Debug('Wrote ' . $self->{'new_commit'} . ' in ' . $self->{'branch'}); } # release memory delete $self->{'srcstore'}; # replace the writer store object with reader and release the index memory delete $self->{'store'}; $self->{'store'} = new Git::ObjectStore( 'repodir' => $self->{'repodir'}, 'branchname' => $self->{'branch'}, %{$self->{'store_author'}}); $self->{'is_writing'} = undef; if( $self->{'config_updated'} ) { # clean up tokenset members if their nodes were removed foreach my $ts ( $self->getTsets() ) { foreach my $member ( $self->tsetMembers($ts) ) { if( not $self->tokenExists($member) ) { $self->tsetDelMember($ts, $member); } } } } return 1; } sub _post_process_nodes { my $self = shift; my $token = shift; if( $self->{'postprocessed_tokens'}{$token} ) { return 1; } $self->{'postprocessed_tokens'}{$token} = 1; $self->{'n_postprocessed_nodes'}++; my $ok = 1; my $path = $self->path($token); my $nodeid = $self->getNodeParam( $token, 'nodeid', 1 ); if( defined( $nodeid ) ) { # verify the uniqueness of nodeid my $nodeid_sha = sha1_hex($nodeid); my $sha_file = 'nodeid/' . $self->_sha_file($nodeid_sha); my $old_entry = $self->_read_json($sha_file); if( defined($old_entry) ) { if( $old_entry->[1] ne $token ) { Error('Non-unique nodeid ' . $nodeid . ' in ' . $path . ' and ' . $self->path($old_entry->[1])); $ok = 0; } } else { $self->_write_json($sha_file, [$nodeid, $token]); # write the nodeid prefix search index my $pos = 0; while( ($pos = index($nodeid, '//', $pos)) >= 0 ) { my $prefix = substr($nodeid, 0, $pos); my $dir = $self->_nodeidpx_sha_dir($prefix); $self->{'store'}->write_file($dir . '/' . $nodeid_sha, ''); $pos+=2; } } } if( $self->isLeaf($token) ) { # Process static tokenset members my $tsets = $self->getNodeParam($token, 'tokenset-member'); if( defined( $tsets ) ) { foreach my $tset ( split(/,/o, $tsets) ) { my $tsetName = 'S'.$tset; if( not $self->tsetExists($tsetName) ) { Error("Referenced undefined tokenset $tset in $path"); $ok = 0; } else { $self->tsetAddMember( $tsetName, $token, 'static' ); } } } my $dsType = $self->getNodeParam( $token, 'ds-type' ); if( defined( $dsType ) ) { if( $dsType eq 'rrd-multigraph' ) { # Expand parameter substitutions in multigraph leaves $self->editNode($path); my @dsNames = split(/,/o, $self->getNodeParam($token, 'ds-names') ); foreach my $dname ( @dsNames ) { foreach my $param ( 'ds-expr-', 'graph-legend-' ) { my $dsParam = $param . $dname; my $value = $self->getNodeParam( $token, $dsParam ); if( defined( $value ) ) { my $newValue = $value; if( $multigraph_remove_space{$param} ) { $newValue =~ s/\s+//go; } $newValue = $self->_expand_substitutions ( $token, $dsParam, $newValue ); if( $newValue ne $value ) { $self->setNodeParam( $dsParam, $newValue ); } } } } $self->commitNode(); } elsif( $dsType eq 'collector' and $self->{'collectorInstances'} > 0 ) { $self->editNode($path); # Split the collecting job between collector instances my $instance = 0; my $nInstances = $self->{'collectorInstances'}; my $oldOffset = $self->getNodeParam($token, 'collector-timeoffset'); my $newOffset = $oldOffset; my $period = $self->getNodeParam($token, 'collector-period'); if( $nInstances > 1 ) { my $hashString = $self->getNodeParam($token, 'collector-instance-hashstring'); if( not defined( $hashString ) ) { Error('collector-instance-hashstring is not defined ' . 'in ' . $path); $hashString = ''; } $instance = unpack( 'N', md5( $hashString ) ) % $nInstances; } $self->setNodeParam( 'collector-instance', $instance ); my $dispersed = $self->getNodeParam($token, 'collector-dispersed-timeoffset'); if( defined( $dispersed ) and $dispersed eq 'yes' ) { # Process dispersed collector offsets my %p; foreach my $param ( 'collector-timeoffset-min', 'collector-timeoffset-max', 'collector-timeoffset-step', 'collector-timeoffset-hashstring' ) { my $val = $self->getNodeParam( $token, $param ); if( not defined( $val ) ) { Error('Mandatory parameter ' . $param . ' is not '. ' defined in ' . $path); $ok = 0; } else { $p{$param} = $val; } } if( $ok ) { my $min = $p{'collector-timeoffset-min'}; my $max = $p{'collector-timeoffset-max'}; if( $max < $min ) { Error('collector-timeoffset-max is less than ' . 'collector-timeoffset-min in ' . $path); $ok = 0; } else { my $step = $p{'collector-timeoffset-step'}; my $hashString = $p{'collector-timeoffset-hashstring'}; my $bucketSize = ceil(($max-$min)/$step); $newOffset = $min + $step * ( unpack('N', md5($hashString)) % $bucketSize ) + $instance * ceil($step/$nInstances); } } } else { $newOffset += $instance * ceil($period/$nInstances); } $newOffset %= $period; if( $newOffset != $oldOffset ) { $self->setNodeParam('collector-timeoffset', $newOffset ); } my $storagetypes = $self->getNodeParam( $token, 'storage-type' ); foreach my $stype ( split(/,/o, $storagetypes) ) { if( $stype eq 'ext' ) { my $srvTrees = $self->getNodeParam($token, 'ext-service-trees'); if( not defined($srvTrees) or $srvTrees eq '' ) { $srvTrees = $self->treeName(); } my $serviceid = $self->getNodeParam($token, 'ext-service-id'); foreach my $srvTree (split(/\s*,\s*/o, $srvTrees)) { if( not Torrus::SiteConfig::treeExists($srvTree) ) { Error ('Error processing ext-service-trees ' . 'for ' . $path . ': tree ' . $srvTree . ' does not exist'); $ok = 0; } } if( $ok ) { my $dstype = $self->getNodeParam($token, 'ext-dstype'); my $units = $self->getNodeParam($token, 'ext-service-units'); my $params = { 'trees' => $srvTrees, 'token' => $token, 'dstype' => $dstype, 'units' => $units, }; $ok = $srvIdParams->set( $serviceid, $params ); } } } $self->commitNode(); } } else { Error("Mandatory parameter 'ds-type' is not defined for $path"); $ok = 0; } } else { foreach my $ctoken ( $self->getChildren($token) ) { $ok = $self->_post_process_nodes( $ctoken ) ? $ok:0; } } return $ok; } sub _propagate_view_params { my $self = shift; my $vname = shift; # Avoid processing the same view twice if( $self->{'viewParamsProcessed'}{$vname} ) { return; } # First we do the same for parent my $parent = $self->{'viewparent'}{$vname}; if( defined( $parent ) ) { $self->_propagate_view_params( $parent ); $self->editOther($vname); my $parentParams = $self->getOtherParams($parent); foreach my $param ( keys %{$parentParams} ) { if( not defined( $self->getOtherParam( $vname, $param ) ) ) { $self->setOtherParam($param, $parentParams->{$param}); } } $self->commitOther(); } # mark this view as processed $self->{'viewParamsProcessed'}{$vname} = 1; return; } sub startSrcFileProcessing { my $self = shift; my $filename = shift; $self->{'srcfiles_processing_now'}{$filename} = 1; return; } sub endSrcFileProcessing { my $self = shift; my $filename = shift; delete $self->{'srcfiles_processing_now'}{$filename}; return; } sub addSrcFile { my $self = shift; my $filename = shift; my $blobref = shift; my $file_changed = $self->{'srcstore'}->write_and_check($filename, $blobref); if( $file_changed ) { $self->{'srcfiles_updated'}{$filename} = 1; } if( not defined($self->{'srcincludes'}{$filename}) ) { $self->{'srcincludes'}{$filename} = []; } $self->{'srcfiles_processed'}{$filename} = 1; return $file_changed; } sub setSrcGlobalDep { my $self = shift; my $filename = shift; $self->{'srcglobaldeps'}{$filename} = 1; return; } sub readSrcFile { my $self = shift; my $filename = shift; return $self->{'srcstore'}->read_file($filename); } sub clearSrcIncludes { my $self = shift; my $filename = shift; $self->{'srcincludes'}{$filename} = []; return; } sub addSrcInclude { my $self = shift; my $filename = shift; my $include = shift; push(@{$self->{'srcincludes'}{$filename}}, $include); return; } sub analyzeSrcUpdates { my $self = shift; $self->{'srcfiles_rebuild'} = {}; # Detect source files which were removed foreach my $filename (sort keys %{$self->{'srcincludes'}}) { if( $filename ne '__ROOT__' and not $self->{'srcfiles_processed'}{$filename} ) { Verbose("$filename was removed from source configuration"); $self->_mark_related_srcfiles_dirty($filename); $self->_delete_dependent_nodes($filename); $self->{'srcstore'}->delete_file($filename); delete $self->{'srcincludes'}{$filename}; } } # step 1: find additional files that need to be re-compiled $self->_analyze_updates('__ROOT__'); # step 2: build an ordered list of files to recompile my $rebuild_list = []; push( @{$rebuild_list}, $self->_compose_rebuild_list('__ROOT__') ); foreach my $filename (@{$rebuild_list}) { $self->_delete_dependent_nodes($filename); } # _delete_dependent_nodes may mark additional files dirty, so # compose the list once again $rebuild_list = []; push( @{$rebuild_list}, $self->_compose_rebuild_list('__ROOT__') ); $self->{'srcfiles_rebuild_list'} = $rebuild_list; return $rebuild_list; } sub _delete_dependent_nodes { my $self = shift; my $filename = shift; return unless defined($self->{'srcrefs'}{$filename}); Debug("Deleting dependencies of $filename"); foreach my $token (sort keys %{$self->{'srcrefs'}{$filename}}) { # we might have deleted this node already if( $self->tokenExists($token) ) { Debug('Deleting recursively: ' . $self->path($token)); $self->_delete_node($token); } } delete $self->{'srcrefs'}{$filename}; return; } sub _analyze_updates { my $self = shift; my $filename = shift; if( ($self->{'srcfiles_updated'}{$filename} or $self->{'force_rebuild'}) and not $self->{'srcfiles_rebuild'}{$filename} ) { $self->{'srcfiles_rebuild'}{$filename} = 1; $self->_mark_related_srcfiles_dirty($filename); if( $self->{'srcglobaldeps'}{$filename} ) { Debug("A global dependency file updated: $filename"); # this file contains global definitions and templates. # Mark dirty all the files which include this one foreach my $xfile (keys %{$self->{'srcincludes'}}) { foreach my $yfile (@{$self->{'srcincludes'}{$xfile}}) { if( $yfile eq $filename ) { $self->{'srcfiles_rebuild'}{$xfile} = 1; Debug("$xfile is dependent on $filename"); } } } } } if( defined($self->{'srcincludes'}{$filename}) ) { foreach my $incfile (@{$self->{'srcincludes'}{$filename}}) { $self->_analyze_updates($incfile); } } return; } sub _mark_related_srcfiles_dirty { my $self = shift; my $filename = shift; # find dependent tokens and mark their src files as dirty if( defined($self->{'srcrefs'}{$filename}) ) { foreach my $token (keys %{$self->{'srcrefs'}{$filename}}) { foreach my $srcfile ($self->getSrcFiles($token)) { # only those that were pre-processed if( $self->{'srcfiles_processed'}{$srcfile} and not $self->{'srcfiles_rebuild'}{$srcfile} ) { Debug('Marking file dirty: ' . $srcfile); $self->{'srcfiles_rebuild'}{$srcfile} = 1; } } } } return; } sub _compose_rebuild_list { my $self = shift; my $filename = shift; my @ret; if( defined($self->{'srcincludes'}{$filename}) ) { foreach my $incfile (@{$self->{'srcincludes'}{$filename}}) { push(@ret, $self->_compose_rebuild_list($incfile)); } } if( $self->{'srcfiles_rebuild'}{$filename} ) { # add all templates and definitions in the rebuild list my @includes = $self->_get_all_includes($filename); foreach my $incfile (@includes) { if( $self->{'srcglobaldeps'}{$incfile} ) { push(@ret, $incfile); } } if( $filename ne '__ROOT__' ) { push(@ret, $filename); } } return @ret; } sub _get_all_includes { my $self = shift; my $filename = shift; my @ret; if( defined($self->{'srcincludes'}{$filename}) ) { foreach my $incfile (@{$self->{'srcincludes'}{$filename}}) { push(@ret, $self->_get_all_includes($incfile)); push(@ret, $incfile); } } return @ret; } sub getSrcIncludes { my $self = shift; my $filename = shift; if( defined($self->{'srcincludes'}{$filename}) ) { return @{$self->{'srcincludes'}{$filename}}; } else { return (); } } sub _delete_node { my $self = shift; my $token = shift; my $node = $self->_node_read($token); my $nodeid = $self->getNodeParam( $token, 'nodeid', 1 ); if( defined($nodeid) ) { my $nodeid_sha = sha1_hex($nodeid); $self->{'store'}->delete_file( 'nodeid/' . $self->_sha_file($nodeid_sha)); my $pos = 0; while( ($pos = index($nodeid, '//', $pos)) >= 0 ) { my $prefix = substr($nodeid, 0, $pos); my $dir = $self->_nodeidpx_sha_dir($prefix); $self->{'store'}->delete_file($dir . '/' . $nodeid_sha); $pos+=2; } } my $parent = $node->{'parent'}; my $iamsubtree = $node->{'is_subtree'}; if( $iamsubtree ) { foreach my $ctoken ( $self->getChildren($token) ) { $self->_delete_node($ctoken); } } if( defined($node->{'src'}) ) { foreach my $srcfile (keys %{$node->{'src'}}) { delete $self->{'srcrefs'}{$srcfile}{$token}; if( not $self->{'srcfiles_rebuild'}{$srcfile} and $self->{'srcfiles_processed'}{$srcfile} ) { Debug('Adding to srcfiles_rebuild: ' . $srcfile); $self->{'srcfiles_rebuild'}{$srcfile} = 1; } } } my $sha_file = $self->_sha_file($token); $self->{'store'}->delete_file('nodes/' . $sha_file); $self->{'objcache'}->remove($token); if( $iamsubtree ) { $self->{'store'}->delete_file('children/' . $sha_file); } # remove ourselves from parent's list of children if( $parent ne '' ) { $self->editNode($self->path($parent)); delete $self->{'editing'}{'children'}{$token}; $self->{'editing_dirty_children'} = 1; $self->commitNode(); } if( defined($self->{'serviceid_tokens'}{$token}) ) { $srvIdParams->tokenDeleted($token); } return; } sub validate { my $self = shift; my $prev_commit = $self->currentCommit(); if( defined($prev_commit) and not $self->{'config_updated'} and not $self->{'force_rebuild'} ) { Debug('Nothing is changed and configuration was validated ' . 'previously. Skipping the validation'); return 1; } my $ok = 1; $ok = Torrus::ConfigTree::Validator::validateNodes($self); $ok = Torrus::ConfigTree::Validator::validateViews($self) ? $ok:0; $ok = Torrus::ConfigTree::Validator::validateMonitors($self) ? $ok:0; $ok = Torrus::ConfigTree::Validator::validateTokensets($self) ? $ok:0; return $ok; } sub finalize { my $self = shift; my $status = shift; if( $status ) { if( $self->{'config_updated'} or $self->{'force_rebuild'} ) { $self->{'redis'}->hset ($self->{'redis_prefix'} . 'githeads', $self->{'branch'}, $self->{'new_commit'}); $self->{'redis'}->publish ($self->{'redis_prefix'} . 'treecommits:' . $self->treeName(), $self->{'new_commit'}); Verbose('Configuration has compiled successfully'); } } else { my $prev_commit = $self->currentCommit(); if( defined($prev_commit) and $prev_commit eq $self->{'new_commit'} ) { Error('This configuration was previously successfully validated, ' . 'but now it is invalid. As a result, there is no valid ' . 'configuration at all, and some processes may need a ' . 'restart.'); $self->_remove_githead(); } } return; } sub _remove_githead { my $self = shift; $self->{'redis'}->hdel ($self->{'redis_prefix'} . 'githeads', $self->{'branch'}); return; } sub updateAgentConfigs { my $self = shift; my $stores = {}; my @branchnames; for( my $inst = 0; $inst < $self->{'collectorInstances'}; $inst++ ) { push(@branchnames, $self->_agent_branch_name('collector', $inst)); } if( Torrus::SiteConfig::mayRunMonitor($self->treeName()) ) { push(@branchnames, $self->_agent_branch_name('monitor', 0)); } if( scalar(@branchnames) == 0 ) { Debug('This tree does not run any agents'); return; } # open ObjectStore writer objects for every agent branch foreach my $branchname (@branchnames) { $stores->{$branchname} = new Git::ObjectStore( 'repodir' => $self->{'repodir'}, 'branchname' => $branchname, 'writer' => 1, %{$self->{'store_author'}}); } my $agent_tokens_branch = $self->treeName() . '_agent_tokens'; $self->{'agent_tokens_store'} = new Git::ObjectStore( 'repodir' => $self->{'repodir'}, 'branchname' => $agent_tokens_branch, 'writer' => 1, %{$self->{'store_author'}}); my $refname = $self->_agents_ref_name(); my $ref = Git::Raw::Reference->lookup($refname, $self->{'store'}->repo()); my $old_commit_id = ''; if( defined($ref) and not $self->{'force_rebuild'} ) { $old_commit_id = $ref->peel('commit')->id(); } # Debug('Old commit in ' . $self->{'branch'} . ': ' . $old_commit_id); my $new_commit_id = $self->currentCommit(); # Debug('New commit: ' . $new_commit_id); if( $new_commit_id eq $old_commit_id ) { Verbose('Nothing is changed in configtree, skipping the agents update'); # Make sure that Redis has up to date commit ID. foreach my $branchname (@branchnames) { $self->{'redis'}->hset ($self->{'redis_prefix'} . 'githeads', $branchname, $stores->{$branchname}->current_commit_id()); } return 0; } $self->{'token_updated'} = {}; my $n_updated = 0; my $n_deleted = 0; my $cb_updated = sub { $n_updated += $self->_write_agent_configs($stores, $_[0]); }; my $cb_deleted = sub { my $sha_file = $self->_sha_file($_[0]); my $ab_content = $self->{'agent_tokens_store'}->read_file($sha_file); if( defined($ab_content) ) { $n_deleted++; my $agent_branches = $self->{'json'}->decode($ab_content); foreach my $branchname (@{$agent_branches}) { $stores->{$branchname}->delete_file($sha_file); } $self->{'agent_tokens_store'}->delete_file($sha_file); } }; $self->getUpdates($old_commit_id, $cb_updated, $cb_deleted); Verbose("Updated: $n_updated, Deleted: $n_deleted leaf nodes"); foreach my $branchname (@branchnames) { if( $stores->{$branchname}->create_commit_and_packfile() ) { my $commit_id = $stores->{$branchname}->current_commit_id(); Debug('Wrote ' . $commit_id . ' in ' . $branchname); $self->{'redis'}->hset ($self->{'redis_prefix'} . 'githeads', $branchname, $commit_id); } else { Debug('Nothing changed in ' . $branchname); } } if( $self->{'agent_tokens_store'}->create_commit_and_packfile() ) { my $commit_id = $self->{'agent_tokens_store'}->current_commit_id(); Debug('Wrote ' . $commit_id . ' in ' . $agent_tokens_branch); } else { Debug('Nothing changed in ' . $agent_tokens_branch); } my $repo = $self->{'store'}->repo(); my $new_commit = Git::Raw::Commit->lookup($repo, $new_commit_id); Git::Raw::Reference->create( $self->_agents_ref_name(), $repo, $new_commit, 1); Debug('Updated reference: ' . $self->_agents_ref_name()); return; } sub _write_agent_configs { my $self = shift; my $stores = shift; my $token = shift; if( $self->{'token_updated'}{$token} ) { return 0; } if( not $self->isLeaf($token) ) { my $count = 0; foreach my $ctoken ( $self->getChildren($token) ) { $count += $self->_write_agent_configs($stores, $ctoken); } $self->{'token_updated'}{$token} = 1; return $count; } my $sha_file = $self->_sha_file($token); my @branches; my $dsType = $self->getNodeParam($token, 'ds-type'); if( $dsType eq 'collector' ) { my $instance = $self->getNodeParam($token, 'collector-instance'); my $params = {'path' => $self->path($token)}; foreach my $param ( 'collector-timeoffset', 'collector-period', 'collector-type', 'storage-type', 'transform-value', 'collector-scale', 'value-map') { my $val = $self->getNodeParam($token, $param); if( defined($val) ) { $params->{$param} = $val; } } $self->_fetch_collector_params($token, $params); my $branchname = $self->_agent_branch_name('collector', $instance); $stores->{$branchname}->write_file( $sha_file, $self->{'json'}->encode($params)); push( @branches, $branchname ); } if( $dsType ne 'rrd-multigraph' and Torrus::SiteConfig::mayRunMonitor($self->treeName()) ) { # monitor my $mlist = $self->getNodeParam($token, 'monitor'); if( defined $mlist ) { my $params = {'path' => $self->path($token), 'monitor' => $mlist}; foreach my $param ('monitor-period', 'monitor-timeoffset') { $params->{$param} = $self->getNodeParam($token, $param); } my $branchname = $self->_agent_branch_name('monitor', 0); $stores->{$branchname}->write_file( $sha_file, $self->{'json'}->encode($params)); push( @branches, $branchname ); } } $self->{'token_updated'}{$token} = 1; # compare the new list of branches with the old one, and delete from # old branches if needed my @old_branches; my $ab_content = $self->{'agent_tokens_store'}->read_file($sha_file); if( defined($ab_content) ) { my $agent_branches = $self->{'json'}->decode($ab_content); @old_branches = @{$agent_branches}; } foreach my $branchname (@old_branches) { if( not grep {$_ eq $branchname} @branches ) { $stores->{$branchname}->delete_file($sha_file); } } if( scalar(@branches) > 0 ) { $self->{'agent_tokens_store'}->write_file( $sha_file, $self->{'json'}->encode(\@branches)); return 1; } else { if( defined($ab_content) ) { $self->{'agent_tokens_store'}->delete_file($sha_file); } return 0; } } sub _fetch_collector_params { my $self = shift; my $token = shift; my $params = shift; my $r = $self->getInstanceParamsByMap( $token, 'node', \%Torrus::ConfigTree::Validator::collector_params); if( not defined($r) ) { die("Failure while retrieving agent configuration"); } while(my($key, $value) = each %{$r}) { $params->{$key} = $value; } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/ConfigTree/XMLCompiler.pm0000644000175000017500000004002513131663307016501 00000000000000# Copyright (C) 2002-2017 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::ConfigTree::XMLCompiler; use strict; use warnings; use base 'Torrus::ConfigTree::Writer'; use Torrus::ConfigTree; use Torrus::ConfigTree::Validator; use Torrus::SiteConfig; use Torrus::Log; use XML::LibXML; sub new { my $proto = shift; my %options = @_; my $class = ref($proto) || $proto; $options{'-Rebuild'} = 1; my $self = $class->SUPER::new( %options ); if( not defined( $self ) ) { return undef; } bless $self, $class; return $self; } sub _preprocess_file { my $self = shift; my $filename = shift; # Make sure we process each file only once if( $self->{'srcfiles_seen'}{$filename} ) { return 1; } my $fullname = Torrus::SiteConfig::findXMLFile($filename); if( not defined( $fullname ) ) { return 0; # fatal, cannot find the file } $self->{'srcfiles_seen'}{$filename} = 1; Verbose('Reading ' . $fullname); open(my $fh, '<:raw:encoding(utf8)', $fullname) or die("Cannot open $fullname: $!"); my $blob = do { local $/; <$fh> }; close($fh); my $file_changed = $self->addSrcFile($filename, \$blob); if( $file_changed ) { Debug('File changed: ' . $fullname); my $parser = new XML::LibXML; my $doc; if( not eval {$doc = $parser->parse_string(\$blob)} or $@ ) { Error("Failed to parse $fullname: $@"); return 0; } # clean up the memory $blob = undef; my $root = $doc->documentElement(); $self->clearSrcIncludes($filename); foreach my $node ( $root->getElementsByTagName('include') ) { my $incfile = $node->getAttribute('filename'); if( not $incfile ) { Error("No filename given in include statement in $fullname"); return 0; } if( not $self->_preprocess_file($incfile) ) { return 0; } $self->addSrcInclude($filename, $incfile); } # param properties and definitions are global for the whole tree if( $root->getElementsByTagName('param-properties')->size() > 0 or $root->getElementsByTagName('definitions')->size() > 0 ) { $self->setSrcGlobalDep($filename); } foreach my $node ( $root->getElementsByTagName('datasources') ) { if( $node->getChildrenByTagName('template')->size() > 0 ) { # Whenever there's a temlate, we mark the file as global # dependency $self->setSrcGlobalDep($filename); } } } else { # clean up the memory $blob = undef; foreach my $incfile ($self->getSrcIncludes($filename)) { if( not $self->_preprocess_file($incfile) ) { return 0; } } } return 1; } sub compile_files { my $self = shift; my $srcfiles = shift; # First step: process file inclusions and detect changes $self->clearSrcIncludes('__ROOT__'); foreach my $filename (@{$srcfiles}) { if( not $self->_preprocess_file($filename) ) { return 0; } $self->addSrcInclude('__ROOT__', $filename); } my $rebuild_list = $self->analyzeSrcUpdates(); my %seen; foreach my $filename (@{$rebuild_list}) { if( not $seen{$filename} ) { if( not $self->_compile_file($filename) ) { return 0; } $seen{$filename} = 1; } } return 1; } sub _compile_file { my $self = shift; my $filename = shift; Debug('Compiling file: ' . $filename); my $parser = new XML::LibXML; my $blob = $self->readSrcFile($filename); my $doc = $parser->parse_string(\$blob); my $root = $doc->documentElement(); $self->startSrcFileProcessing($filename); $self->{'current_srcfile'} = $filename; foreach my $node ( $root->getElementsByTagName('param-properties') ) { if( not $self->compile_paramprops($node) ) { return 0; } } foreach my $node ( $root->getElementsByTagName('definitions') ) { if( not $self->compile_definitions($node) ) { return 0; } } foreach my $node ( $root->getElementsByTagName('datasources') ) { if( not $self->compile_ds($node) ) { return 0; } } foreach my $node ( $root->getElementsByTagName('monitors') ) { if( not $self->compile_monitors($node) ) { return 0; } } foreach my $node ( $root->getElementsByTagName('token-sets') ) { if( not $self->compile_tokensets($node) ) { return 0; } } $self->startEditingOthers('__VIEWS__'); foreach my $node ( $root->getElementsByTagName('views') ) { if( not $self->compile_views( $node ) ) { return 0; } } $self->endEditingOthers(); $self->endSrcFileProcessing($filename); return 1; } sub compile_definitions { my $self = shift; my $node = shift; foreach my $def ( $node->getChildrenByTagName('def') ) { my $name = $def->getAttribute('name'); my $value = $def->getAttribute('value'); if( not $name ) { Error("Definition without a name"); return 0; } elsif( not $value ) { Error("Definition without value: $name"); return 0; } else { $self->addDefinition($name, $value); } } return 1; } sub compile_paramprops { my $self = shift; my $node = shift; foreach my $def ( $node->getChildrenByTagName('prop') ) { my $param = $def->getAttribute('param'); my $prop = $def->getAttribute('prop'); my $value = $def->getAttribute('value'); if( not $param or not $prop or not defined($value) ) { Error("Property definition error"); return 0; } else { $self->setParamProperty($param, $prop, $value); } } return 1; } # Process and put them into DB. # Usage: $self->compile_params($node, $name); sub compile_params { my $self = shift; my $node = shift; my $name = shift; my $isDS = shift; foreach my $p_node ( $node->getChildrenByTagName('param') ) { my $param = $p_node->getAttribute('name'); my $value = $p_node->getAttribute('value'); if( not defined($value) ) { $value = $p_node->textContent(); } if( not $param ) { Error("Parameter without name in $name"); return 0; } else { # Remove spaces in the head and tail. $value =~ s/^\s+//om; $value =~ s/\s+$//om; if( $isDS ) { $self->setNodeParam($param, $value); } else { $self->setOtherParam($param, $value); } } } return 1; } sub compile_ds { my $self = shift; my $ds_node = shift; # First, process templates. We expect them to be direct children of # foreach my $template ( $ds_node->getChildrenByTagName('template') ) { my $name = $template->getAttribute('name'); if( not $name ) { Error("Template without a name"); return 0; } elsif( defined $self->{'Templates'}->{$name} ) { Error("Duplicate template names: $name"); return 0; } else { $self->{'Templates'}{$name} = $template; } } # Recursively traverse the tree if( not $self->compile_subtrees( $ds_node, '/' ) ) { return 0; } # last compiled node needs a commit $self->commitNode(); return 1; } sub validate_nodename { my $self = shift; my $name = shift; return ( $name =~ /^[0-9A-Za-z_\-\.\:]+$/o and $name !~ /\.\./o ); } sub compile_subtrees { my $self = shift; my $node = shift; my $path = shift; my $iamLeaf = shift; my $token = $self->editNode($path); # setting of compile-time variables foreach my $setvar ( $node->getChildrenByTagName('setvar') ) { my $name = $setvar->getAttribute('name'); my $value = $setvar->getAttribute('value'); if( not defined( $name ) or not defined( $value ) ) { Error("Setvar statement without name or value in $path"); return 0; } else { $self->setVar( $token, $name, $value ); } } # Apply templates foreach my $templateapp ( $node->getChildrenByTagName('apply-template') ) { my $name = $templateapp->getAttribute('name'); if( not $name ) { Error("Template application without a name at $path"); return 0; } else { my $template = $self->{'Templates'}->{$name}; if( not defined $template ) { Error("Cannot find template named $name at $path"); return 0; } else { if( not $self->compile_subtrees($template, $path, $iamLeaf) ) { return 0; } } } } # templates might include child nodes, so we open this one again $self->editNode($path); if( not $self->compile_params($node, $token, 1) ) { return 0; } # applying compile-time variables foreach my $iftrue ( $node->getChildrenByTagName('iftrue') ) { my $var = $iftrue->getAttribute('var'); if( not defined( $var ) ) { Error("Iftrue statement without variable name in $path"); return 0; } elsif( $self->isTrueVar( $token, $var ) ) { if( not $self->compile_subtrees( $iftrue, $path, $iamLeaf ) ) { return 0; } } } foreach my $iffalse ( $node->getChildrenByTagName('iffalse') ) { my $var = $iffalse->getAttribute('var'); if( not defined( $var ) ) { Error("Iffalse statement without variable name in $path"); return 0; } elsif( not $self->isTrueVar( $token, $var ) ) { if( not $self->compile_subtrees( $iffalse, $path, $iamLeaf ) ) { return 0; } } } # Compile child nodes -- the last part of compile_subtrees() if( not $iamLeaf ) { foreach my $subtree ( $node->getChildrenByTagName('subtree') ) { my $name = $subtree->getAttribute('name'); if( not defined( $name ) or length( $name ) == 0 ) { Error("Subtree without a name at $path"); return 0; } else { if( $self->validate_nodename( $name ) ) { if( not $self->compile_subtrees($subtree, $path.$name.'/') ) { return 0; } } else { Error("Invalid subtree name: $name at $path"); return 0; } } } foreach my $leaf ( $node->getChildrenByTagName('leaf') ) { my $name = $leaf->getAttribute('name'); if( not defined( $name ) or length( $name ) == 0 ) { Error("Leaf without a name at $path"); return 0; } else { if( $self->validate_nodename( $name ) ) { if( not $self->compile_subtrees( $leaf, $path.$name, 1) ) { return 0; } } else { Error("Invalid leaf name: $name at $path"); return 0; } } } } return 1; } sub compile_monitors { my $self = shift; my $mon_node = shift; $self->startEditingOthers('__MONITORS__'); foreach my $monitor ( $mon_node->getChildrenByTagName('monitor') ) { my $mname = $monitor->getAttribute('name'); if( not $mname ) { Error("Monitor without a name"); return 0; } else { $self->addOtherObject($mname); if( not $self->compile_params($monitor, $mname) ) { return 0; } $self->commitOther(); } } $self->endEditingOthers(); $self->startEditingOthers('__ACTIONS__'); foreach my $action ( $mon_node->getChildrenByTagName('action') ) { my $aname = $action->getAttribute('name'); if( not $aname ) { Error("Action without a name"); return 0; } else { $self->addOtherObject($aname); if( not $self->compile_params($action, $aname) ) { return 0; } $self->commitOther(); } } $self->endEditingOthers(); return 1; } sub compile_tokensets { my $self = shift; my $tsets_node = shift; $self->editOther('SS'); if( not $self->compile_params($tsets_node, 'SS') ) { return 0; } $self->commitOther(); foreach my $tokenset ( $tsets_node->getChildrenByTagName('token-set') ) { my $sname = $tokenset->getAttribute('name'); if( not $sname ) { Error("Tokenset without a name"); return 0; } else { $sname = 'S'. $sname; $self->addTset( $sname ); $self->editOther($sname); if( not $self->compile_params($tokenset, $sname) ) { return 0; } $self->commitOther(); } } return 1; } sub compile_views { my $self = shift; my $vw_node = shift; my $parentname = shift; foreach my $view ( $vw_node->getChildrenByTagName('view') ) { my $vname = $view->getAttribute('name'); if( not $vname ) { Error("View without a name"); return 0; } else { $self->addView( $vname, $parentname ); if( not $self->compile_params( $view, $vname ) ) { return 0; } $self->commitOther(); # Process child views if( not $self->compile_views( $view, $vname ) ) { return 0; } } } return 1; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/CGI.pm0000644000175000017500000003221513131663307012725 00000000000000# Copyright (C) 2010 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Universal CGI handler for Apache mod_perl and FastCGI package Torrus::CGI; use strict; use warnings; use CGI; use IO::File; use JSON (); # This modue is not a part of mod_perl use Apache::Session::File; use Torrus::Log; use Torrus::Renderer; use Torrus::SiteConfig; use Torrus::ACL; ## Torrus::CGI->process($q) ## Expects a CGI object as input sub process { my($class, $q) = @_; $class->do_process($q); return; } sub do_process { my($class, $q) = @_; my $path_info = $q->url(-path => 1); # quickly give plaintext file contents { my $pos = index( $path_info, $Torrus::Renderer::plainURL ); if( $pos >= 0 ) { my $fname = $Torrus::Global::webPlainDir . '/' . substr( $path_info, $pos + length($Torrus::Renderer::plainURL) ); my $ok = 0; my $type; if( $path_info =~ /\.css$/o ) { $type = 'text/css'; } else { $type = 'text/html'; } if( -r $fname ) { my $fh = new IO::File( $fname ); if( defined( $fh ) ) { print $q->header('-type' => $type, '-expires' => '+1h'); $fh->binmode(':raw'); my $buffer; while( $fh->read( $buffer, 65536 ) ) { print( $buffer ); } $fh->close(); $ok = 1; } } if( not $ok ) { print $q->header(-status=>400), $q->start_html('Error'), $q->h2('Error'), $q->strong('Cannot retrieve file: ' . $fname); } return; } } my @paramNames = $q->param(); if( $q->param('DEBUG') and not $Torrus::Renderer::globalDebug ) { &Torrus::Log::setLevel('debug'); } my %options = (); foreach my $name ( @paramNames ) { if( $name =~ /^[A-Z]/ and $name ne 'SESSION_ID' ) { $options{'variables'}->{$name} = $q->param($name); } } my( $fname, $mimetype, $expires ); my @cookies; my $renderer = new Torrus::Renderer(); if( not defined( $renderer ) ) { return report_error($q, 'Error initializing Renderer'); } my $tree = $path_info; $tree =~ s/^.*\/(.*)$/$1/; if( $Torrus::CGI::authorizeUsers ) { $options{'acl'} = new Torrus::ACL; my $hostauth = $q->param('hostauth'); if( defined( $hostauth ) ) { my $uid = $q->remote_addr(); $uid =~ s/\W/_/go; my $password = $uid . '//' . $hostauth; Debug('Host-based authentication for ' . $uid); if( not $options{'acl'}->authenticateUser( $uid, $password ) ) { print $q->header(-status=>'403 Forbidden', '-type' => 'text/plain'); print('Host-based authentication failed for ' . $uid); Info('Host-based authentication failed for ' . $uid); return; } Info('Host authenticated: ' . $uid); $options{'uid'} = $uid; } else { my $ses_id = $q->cookie('SESSION_ID'); my $needs_new_session = 1; my %session; if( $ses_id ) { # create a session object based on the cookie we got from the # browser, or a new session if we got no cookie my $eval_ret = eval { tie %session, 'Apache::Session::File', $ses_id, { Directory => $Torrus::Global::sesStoreDir, LockDirectory => $Torrus::Global::sesLockDir } }; if( $eval_ret and not $@ ) { if( $options{'variables'}->{'LOGOUT'} ) { tied( %session )->delete(); } else { $needs_new_session = 0; } } } if( $needs_new_session ) { tie %session, 'Apache::Session::File', undef, { Directory => $Torrus::Global::sesStoreDir, LockDirectory => $Torrus::Global::sesLockDir }; } # might be a new session, so lets give them their cookie back my %cookie = (-name => 'SESSION_ID', -value => $session{'_session_id'}); if( $session{'uid'} ) { $options{'uid'} = $session{'uid'}; if( $session{'remember_login'} ) { $cookie{'-expires'} = '+60d'; } } else { my $needsLogin = 1; # POST form parameters my $uid = $q->param('uid'); my $password = $q->param('password'); if( defined( $uid ) and defined( $password ) ) { if( $options{'acl'}->authenticateUser( $uid, $password ) ) { $session{'uid'} = $options{'uid'} = $uid; $needsLogin = 0; Info('User logged in: ' . $uid); if( $q->param('remember') ) { $cookie{'-expires'} = '+60d'; $session{'remember_login'} = 1; } } else { $options{'authFailed'} = 1; } } if( $needsLogin ) { $options{'urlPassTree'} = $tree; foreach my $param ( 'token', 'path', 'nodeid', 'view', 'v' ) { my $val = $q->param( $param ); if( defined( $val ) and length( $val ) > 0 ) { $options{'urlPassParams'}{$param} = $val; } } ( $fname, $mimetype, $expires ) = $renderer->renderUserLogin( %options ); die('renderUserLogin returned undef') unless $fname; } } untie %session; push(@cookies, $q->cookie(%cookie)); } } if( not $fname ) { if( not $tree or not Torrus::SiteConfig::treeExists( $tree ) ) { ( $fname, $mimetype, $expires ) = $renderer->renderTreeChooser( %options ); } else { if( $Torrus::CGI::authorizeUsers and not $options{'acl'}->hasPrivilege( $options{'uid'}, $tree, 'DisplayTree' ) ) { return report_error($q, 'Permission denied'); } if( $Torrus::Renderer::displayReports and defined( $q->param('htmlreport') ) ) { if( $Torrus::CGI::authorizeUsers and not $options{'acl'}->hasPrivilege( $options{'uid'}, $tree, 'DisplayReports' ) ) { return report_error($q, 'Permission denied'); } my $reportfname = $q->param('htmlreport'); # strip off leading slashes for security $reportfname =~ s/^.*\///o; $fname = $Torrus::Global::reportsDir . '/' . $tree . '/html/' . $reportfname; if( not -f $fname ) { return report_error($q, 'No such file: ' . $reportfname); } $mimetype = 'text/html'; $expires = '3600'; } else { my $config_tree = new Torrus::ConfigTree( -TreeName => $tree ); if( not defined($config_tree) ) { return report_error($q, 'Configuration is not ready'); } my $token = $q->param('token'); if( not defined($token) ) { my $path = $q->param('path'); if( not defined($path) ) { my $nodeid = $q->param('nodeid'); if( defined($nodeid) ) { $token = $config_tree->getNodeByNodeid( $nodeid ); if( not defined($token) ) { return report_error ($q, 'Cannot find nodeid: ' . $nodeid); } } else { $token = $config_tree->token('/'); } } else { $token = $config_tree->token($path); if( not defined($token) ) { return report_error($q, 'Invalid path'); } } } elsif( $token !~ /^S/ and not defined( $config_tree->path( $token ) ) ) { return report_error($q, 'Invalid token'); } my $view = $q->param('view'); if( not defined($view) ) { $view = $q->param('v'); } if( defined($view) and not $config_tree->viewExists($view) ) { return report_error($q, 'Invalid view name: ' . $view); } ( $fname, $mimetype, $expires ) = $renderer->render( $config_tree, $token, $view, %options ); undef $config_tree; } } } undef $renderer; if( defined( $options{'acl'} ) ) { delete $options{'acl'}; } if( defined($fname) ) { if( not -e $fname ) { return report_error($q, 'No such file or directory: ' . $fname); } Debug("Render returned $fname $mimetype $expires"); my $fh = new IO::File( $fname ); if( defined( $fh ) ) { print $q->header('-type' => $mimetype, '-expires' => '+'.$expires.'s', '-cookie' => \@cookies); $fh->binmode(':raw'); my $buffer; while( $fh->read( $buffer, 65536 ) ) { print( $buffer ); } $fh->close(); unlink $fname; } else { return report_error($q, 'Cannot open file ' . $fname . ': ' . $!); } } else { return report_error($q, "Renderer returned error.\n"); } if( not $Torrus::Renderer::globalDebug ) { &Torrus::Log::setLevel('info'); } return; } sub report_error { my $q = shift; my $msg = shift; my $v = $q->param('view'); if( defined($v) and $v eq 'rpc' ) { my $json = new JSON; $json->pretty; $json->canonical; print $q->header('-type' => 'application/json', '-expires' => 'now'); print $json->encode({'success' => 0, 'error' => $msg}); } else { print $q->header('-type' => 'text/plain', '-expires' => 'now'); print('Error: ' . $msg); } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/SQL.pm0000644000175000017500000001265713131663307012772 00000000000000# Copyright (C) 2005 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Package for RDBMS communication management in Torrus # Classes should inherit Torrus::SQL and execute Torrus::SQL->new(), # and then use methods of DBIx::Abstract. package Torrus::SQL; use strict; use warnings; use DBI; use DBIx::Abstract; use DBIx::Sequence; use Torrus::Log; my %connectionArgsCache; # Obtain connection attributes for particular class and object subtype. # The attributes are defined in torrus-siteconfig.pl, in a hash # %Torrus::SQL::connections. # For a given Perl class and an optional subtype, # the connection attributes are derived in the following order: # 'Default', 'Default/[subtype]', '[Class]', '[Class]/[subtype]', # 'All/[subtype]'. # For a simple setup, the default attributes are usually defined for # 'Default' key. # The key attributes are: 'dsn', 'username', and 'password'. # Returns a hash reference with the same keys. sub getConnectionArgs { my $class = shift; my $objClass = shift; my $subtype = shift; my $cachekey = $objClass . ( defined( $subtype )? '/'.$subtype : ''); if( defined( $connectionArgsCache{$cachekey} ) ) { return $connectionArgsCache{$cachekey}; } my @lookup = ('Default'); if( defined( $subtype ) ) { push( @lookup, 'Default/' . $subtype ); } push( @lookup, $objClass ); if( defined( $subtype ) ) { push( @lookup, $objClass . '/' . $subtype, 'All/' . $subtype ); } my $ret = {}; foreach my $attr ( 'dsn', 'username', 'password' ) { my $val; foreach my $key ( @lookup ) { if( defined( $Torrus::SQL::connections{$key} ) ) { if( defined( $Torrus::SQL::connections{$key}{$attr} ) ) { $val = $Torrus::SQL::connections{$key}{$attr}; } } } if( not defined( $val ) ) { die('Undefined attribute in %Torrus::SQL::connections: ' . $attr); } $ret->{$attr} = $val; } $connectionArgsCache{$cachekey} = $ret; return $ret; } my %dbhPool; # For those who want direct DBI manipulation, simply call # Class->dbh($subtype) with optional subtype. Then you don't use # any other methods of Torrus::SQL. sub dbh { my $class = shift; my $subtype = shift; my $attrs = Torrus::SQL->getConnectionArgs( $class, $subtype ); my $poolkey = $attrs->{'dsn'} . '//' . $attrs->{'username'} . '//' . $attrs->{'password'}; my $dbh; if( exists( $dbhPool{$poolkey} ) ) { $dbh = $dbhPool{$poolkey}; if( not $dbh->ping() ) { $dbh = undef; delete $dbhPool{$poolkey}; } } if( not defined( $dbh ) ) { $dbh = DBI->connect( $attrs->{'dsn'}, $attrs->{'username'}, $attrs->{'password'}, { 'PrintError' => 0, 'AutoCommit' => 0 } ); if( not defined( $dbh ) ) { Error('Error connecting to DBI source ' . $attrs->{'dsn'} . ': ' . $DBI::errstr); } else { $dbhPool{$poolkey} = $dbh; } } return $dbh; } END { foreach my $dbh ( values %dbhPool ) { $dbh->disconnect(); } } sub new { my $class = shift; my $subtype = shift; my $self = {}; $self->{'dbh'} = $class->dbh( $subtype ); if( not defined( $self->{'dbh'} ) ) { return undef; } $self->{'sql'} = DBIx::Abstract->connect( $self->{'dbh'} ); $self->{'subtype'} = $subtype; $self->{'classname'} = $class; bless ($self, $class); return $self; } sub sequence { my $self = shift; if( not defined( $self->{'sequence'} ) ) { my $attrs = Torrus::SQL->getConnectionArgs( $self->{'classname'}, $self->{'subtype'} ); $self->{'sequence'} = DBIx::Sequence->new({ dbh => $self->{'dbh'}, allow_id_reuse => 1 }); } return $self->{'sequence'}; } sub sequenceNext { my $self = shift; return $self->sequence()->Next($self->{'classname'}); } sub fetchall { my $self = shift; my $columns = shift; my $ret = []; while( defined( my $row = $self->{'sql'}->fetchrow_arrayref() ) ) { my $retrecord = {}; my $i = 0; foreach my $col ( @{$columns} ) { $retrecord->{$col} = $row->[$i++]; } push( @{$ret}, $retrecord ); } return $ret; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/SiteConfig.pm0000644000175000017500000002203213131663307014351 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin ## %Torrus::Global::treeConfig manipulation package Torrus::SiteConfig; use strict; use warnings; use Torrus::Log; our %validDaemonNames = ('collector' => 1, 'monitor' => 1); our %mandatoryGraphStyles = ( 'SingleGraph' => {'color' => 1, 'line' => 1}, 'HWBoundary' => {'color' => 1, 'line' => 1}, 'HWFailure' => {'color' => 1}, 'HruleMin' => {'color' => 1}, 'HruleNormal' => {'color' => 1}, 'HruleMax' => {'color' => 1}, 'BpsIn' => {'color' => 1, 'line' => 1}, 'BpsOut' => {'color' => 1, 'line' => 1} ); %Torrus::SiteConfig::validLineStyles = ( 'LINE1' => 1, 'LINE2' => 1, 'LINE3' => 1, 'AREA' => 1, 'STACK' => 1 ); ## Verify the correctness of %Torrus::Global::treeConfig contents sub verify { my $ok = 1; if( not (scalar( keys %Torrus::Global::treeConfig )) ) { Error('%Torrus::Global::treeConfig is not defined or empty'); $ok = 0; } foreach my $tree ( keys %Torrus::Global::treeConfig ) { if( $tree !~ /^[a-zA-Z][a-zA-Z0-9_\-]*$/o ) { Error("Invalid tree name: " . $tree); $ok = 0; next; } if( not $Torrus::Global::treeConfig{$tree}{'description'} ) { Error("Missing description for the tree named \"" . $tree . "\""); $ok = 0; } my $xmlfiles = $Torrus::Global::treeConfig{$tree}{'xmlfiles'}; if( not ref( $xmlfiles ) or not scalar( @{$xmlfiles} ) ) { Error("'xmlfiles' array is not defined for the tree named \"" . $tree . "\""); $ok = 0; } else { foreach my $file ( @{$xmlfiles} ) { $ok = findXMLFile( $file, "in the tree named \"" . $tree . "\"" ) ? $ok:0; } if( ref( $Torrus::Global::treeConfig{$tree}{'run'} ) ) { foreach my $daemon ( keys %{$Torrus::Global::treeConfig{$tree}{'run'}} ) { if( not $validDaemonNames{$daemon} ) { Error("\"" . $daemon . "\" is not a correct daemon " . "name in the tree named \"" . $tree . "\""); $ok = 0; } } } } } foreach my $file ( @Torrus::Global::xmlAlwaysIncludeFirst ) { $ok = findXMLFile( $file, 'in @Torrus::Global::xmlAlwaysIncludeFirst' ) ? $ok:0; } foreach my $file ( @Torrus::Global::xmlAlwaysIncludeLast ) { $ok = findXMLFile( $file, 'in @Torrus::Global::xmlAlwaysIncludeLast' ) ? $ok:0; } # Validate the styling profile my $file = $Torrus::Global::stylingDir . '/' . $Torrus::Renderer::stylingProfile . '.pl'; if( -r $file ) { require $file; #Color names are always there require $Torrus::Global::stylingDir . '/colornames.pl'; if( defined($Torrus::Renderer::stylingProfileOverlay) ) { my $overlay = $Torrus::Renderer::stylingProfileOverlay; if( -r $overlay ) { require $overlay; } else { Error('Error reading styling profile overlay from ' . $overlay . ': File is not readable'); $ok = 0; } } my $profile = \%Torrus::Renderer::graphStyles; # Check if mandatory parameters present foreach my $element ( keys %mandatoryGraphStyles ) { if( ref( $profile->{$element} ) ) { if( $mandatoryGraphStyles{$element}{'color'} and not defined( $profile->{$element}{'color'} ) ) { Error('Mandatory color for ' . $element . ' is not defined in ' . $file); $ok = 0; } if( $mandatoryGraphStyles{$element}{'line'} and not defined( $profile->{$element}{'line'} ) ) { Error('Mandatory line style for ' . $element . ' is not defined in ' . $file); $ok = 0; } } else { Error('Mandatory styling for ' . $element . ' is not defined in ' . $file); $ok = 0; } } # Check validity of all parameters foreach my $element ( keys %{$profile} ) { if( defined( $profile->{$element}{'color'} ) ) { my $color = $profile->{$element}{'color'}; my $recursionLimit = 100; while( $color =~ /^\#\#(\S+)$/ ) { if( $recursionLimit-- <= 0 ) { Error('Color recursion is too deep'); $ok = 0; } else { my $colorName = $1; $color = $profile->{$colorName}{'color'}; if( not defined( $color ) ) { Error('No color is defined for ' . $colorName); $ok = 0; } } } if( $color !~ /^\#[0-9a-fA-F]{6}$/ ) { Error('Invalid color specification for ' . $element . ' in ' . $file); $ok = 0; } } if( defined( $profile->{$element}{'line'} ) ) { if( not $Torrus::SiteConfig::validLineStyles{ $profile->{$element}{'line'}} ) { Error('Invalid line specification for ' . $element . ' in ' . $file); $ok = 0; } } } } else { Error('Error reading styling profile from ' . $file . ': File is not readable'); $ok = 0; } return $ok; } sub findXMLFile { my $file = shift; my $msg = shift; my $filename; if( defined( $file ) ) { my $found = 0; foreach my $dir ( @Torrus::Global::xmlDirs ) { $filename = $dir . '/' . $file; if( -r $filename ) { $found = 1; last; } } if( not $found ) { Error("Cannot find file: " . $file); $filename = undef; } } else { Error("File name undefined " . $msg); } return $filename; } sub treeExists { my $tree = shift; return defined( $Torrus::Global::treeConfig{$tree} ); } sub listTreeNames { return( sort keys %Torrus::Global::treeConfig ); } sub mayRunCollector { my $tree = shift; my $run = $Torrus::Global::treeConfig{$tree}{'run'}{'collector'}; return( defined($run) and $run > 0 ); } sub agentInstances { my $tree = shift; my $agent = shift; my $run = $Torrus::Global::treeConfig{$tree}{'run'}{$agent}; return( (defined($run) and $run > 0) ? int($run) : 0 ); } sub mayRunMonitor { my $tree = shift; return $Torrus::Global::treeConfig{$tree}{'run'}{'monitor'}; } sub listXmlFiles { my $tree = shift; return @{$Torrus::Global::treeConfig{$tree}{'xmlfiles'}}; } sub treeDescription { my $tree = shift; return $Torrus::Global::treeConfig{$tree}{'description'}; } sub loadStyling { require $Torrus::Global::stylingDir . '/' . $Torrus::Renderer::stylingProfile . '.pl'; require $Torrus::Global::stylingDir . '/colornames.pl'; if( defined($Torrus::Renderer::stylingProfileOverlay) ) { require $Torrus::Renderer::stylingProfileOverlay; } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/SNMP_Failures.pm0000644000175000017500000001226713131663307014737 00000000000000# Copyright (C) 2010 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # this policy is paranoic about our read() method ## no critic (Subroutines::ProhibitBuiltinHomonyms) # SNMP failures statistics interface package Torrus::SNMP_Failures; use strict; use warnings; use Digest::MD5 qw(md5_hex); use Torrus::Redis; use Torrus::Log; sub new { my $self = {}; my $class = shift; my %options = @_; bless $self, $class; %{$self->{'options'}} = %options; die() if ( not defined($options{'-Tree'}) or not defined($options{'-Instance'}) ); $self->{'redis'} = Torrus::Redis->new(server => $Torrus::Global::redisServer); $self->{'redis_hname'} = $Torrus::Global::redisPrefix . 'snmp_failures:' . $options{'-Tree'}; $self->{'counters'} = ['unreachable', 'deleted', 'mib_errors']; return $self; } sub init { my $self = shift; $self->{'redis'}->del($self->{'redis_hname'}); foreach my $c ( @{$self->{'counters'}} ) { $self->{'redis'}->hset($self->{'redis_hname'}, 'c:' . $c, 0); } return; } sub host_failure { my $self = shift; my $type = shift; my $hosthash = shift; $self->{'redis'}->hset($self->{'redis_hname'}, 'h:' . $hosthash, $type . ':' . time()); return; } sub is_host_available { my $self = shift; my $hosthash = shift; return( not defined($self->{'redis'}->hget($self->{'redis_hname'}, 'h:' . $hosthash)) ); } sub set_counter { my $self = shift; my $type = shift; my $count = shift; $self->{'redis'}->hset($self->{'redis_hname'}, 'c:' . $type, $count); return; } sub remove_host { my $self = shift; my $hosthash = shift; $self->{'redis'}->hdel($self->{'redis_hname'}, 'h:' . $hosthash); return; } sub mib_error { my $self = shift; my $hosthash = shift; my $path = shift; my $redis = $self->{'redis'}; my $hname = $self->{'redis_hname'}; my $count = $redis->hget($hname, 'M:' . $hosthash); $count = 0 unless defined($count); $redis->hset($hname, 'm:' . md5_hex($path) . ':' . $hosthash, $path . ':' . time()); $redis->hset($hname, 'M:' . $hosthash, $count + 1); my $global_count = $redis->hget($hname, 'c:mib_errors'); $redis->hset($hname, 'c:mib_errors', $global_count + 1); return; } sub read { my $self = shift; my $out = shift; my %options = @_; my $redis = $self->{'redis'}; my $hname = $self->{'redis_hname'}; foreach my $c ( @{$self->{'counters'}} ) { if( not defined( $out->{'total_' . $c} ) ) { $out->{'total_' . $c} = 0; } $out->{'total_' . $c} += $redis->hget($hname, 'c:' . $c); if( $options{'-details'} and not defined( $out->{'detail_' . $c} ) ) { $out->{'detail_' . $c} = {}; } } if( $options{'-details'} ) { my $all = $redis->hgetall($hname); while( scalar(@{$all}) > 0 ) { my $key = shift @{$all}; my $val = shift @{$all}; if( $key =~ /^h:(.+)$/o ) { my $hosthash = $1; my ($counter, $timestamp) = split(/:/o, $val); $out->{'detail_' . $counter}{$hosthash} = { 'timestamp' => 0 + $timestamp, 'time' => scalar(localtime( $timestamp )), }; } elsif( $key =~ /^m:[0-9a-f]+:(.+)$/o ) { my $hosthash = $1; my ($path, $timestamp) = split(/:/o, $val); $out->{'detail_mib_errors'}{$hosthash}{'nodes'}{$path} = { 'timestamp' => 0 + $timestamp, 'time' => scalar(localtime( $timestamp )), } } elsif( $key =~ /^M:(.+)$/o ) { my $hosthash = $1; my $count = 0 + $val; if( not defined ( $out->{'detail_mib_errors'}{$hosthash}{'count'}) ) { $out->{'detail_mib_errors'}{$hosthash}{'count'} = 0; } $out->{'detail_mib_errors'}{$hosthash}{'count'} += $count; } } } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/ReportGenerator.pm0000644000175000017500000000716213131663307015450 00000000000000# Copyright (C) 2005 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Package for reports generation # Classes should inherit Torrus::ReportGenerator package Torrus::ReportGenerator; use strict; use warnings; use Date::Parse; use Torrus::Log; use Torrus::SQL::Reports; use Torrus::SQL::SrvExport; sub new { my $class = shift; my $options = shift; if( not ref( $options ) or not defined( $options->{'Date'} ) or not defined( $options->{'Time'} ) or not defined( $options->{'Name'} ) ) { Error('Missing options in Torrus::Report constructor'); return undef; } my $self = {}; bless ($self, $class); # For monthly reports, adjust date and time for the first day of the month if( $self->isMonthly() ) { $options->{'Time'} = '00:00'; my ($ss,$mm,$hh,$day,$month,$year,$zone) = strptime( $options->{'Date'} ); $year += 1900; $month++; $self->{'StartDate'} = sprintf('%.4d-%.2d-01', $year, $month); $options->{'Date'} = $self->{'StartDate'}; $self->{'StartUnixTime'} = str2time( $self->{'StartDate'} ); $self->{'Year'} = $year; $self->{'Month'} = $month; # Count the number of seconds in the month and define the end date my $endyear = $year; my $endmonth = $month + 1; if( $endmonth > 12 ) { $endmonth = 1; $endyear++; } my $enddate = sprintf('%.4d-%.2d-01', $endyear, $endmonth); $self->{'EndDate'} = $enddate; $self->{'EndUnixTime'} = str2time( $self->{'EndDate'} ); $self->{'RangeSeconds'} = $self->{'EndUnixTime'} - $self->{'StartUnixTime'}; } if( $self->usesSrvExport() ) { my $srvExp = Torrus::SQL::SrvExport->new( $options->{'SrvExportSqlSubtype'} ); if( not defined( $srvExp ) ) { Error('Cannot connect to the database'); return undef; } $self->{'srvexport'} = $srvExp; } $self->{'options'} = $options; my $sqlRep = Torrus::SQL::Reports->new( $options->{'ReportsSqlSubtype'} ); if( not defined( $sqlRep ) ) { Error('Cannot connect to the database'); return undef; } $self->{'backend'} = $sqlRep; my $reportId = $sqlRep->reportId( $options->{'Date'}, $options->{'Time'}, $options->{'Name'} ); $self->{'reportId'} = $reportId; if( $sqlRep->isComplete( $reportId ) ) { Error('Report already exists'); return undef; } return $self; } sub generate { die('Virtual method Torrus::ReportGenerator::generate() called'); } sub isMonthly { return 0; } sub usesSrvExport { return 0; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/Search.pm0000644000175000017500000000446613131663307013537 00000000000000# Copyright (C) 2002-2011 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Search database interface package Torrus::Search; use strict; use warnings; use Torrus::Log; use Git::ObjectStore; use JSON; sub new { my $class = shift; my $self = {}; bless $self, $class; $self->{'store'} = new Git::ObjectStore( 'repodir' => $Torrus::Global::gitRepoDir, 'branchname' => 'searchdb'); $self->{'json'} = JSON->new->canonical(1)->allow_nonref(1); return $self; } sub searchTree { my $self = shift; my $substring = lc( shift ); my $tree = shift; my $ret = {}; my $cb_read = sub { my ($dummy, $xtree, $word, $token, $param) = split('/', $_[0]); if( index($word, $substring) >= 0 ) { $ret->{$token}{$param} = 1; } }; $self->{'store'}->recursive_read('words/' . $tree, $cb_read, 1); return $ret; } sub searchGlobal { my $self = shift; my $substring = lc( shift ); my $ret = {}; my $cb_read = sub { my ($dummy, $word, $token, $param) = split('/', $_[0]); my $content = $_[1]; if( index($word, $substring) >= 0 ) { if( $param eq '__TREENAME__' ) { $ret->{$token}{$param} = $self->{'json'}->decode($content); } else { $ret->{$token}{$param} = 1; } } }; $self->{'store'}->recursive_read('wordsglobal', $cb_read); return $ret; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/Renderer.pm0000644000175000017500000000647513131663307014102 00000000000000# Copyright (C) 2002-2011 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::Renderer; use strict; use warnings; use File::Temp qw(tempfile); use Torrus::ConfigTree; use Torrus::RPN; use Torrus::Log; use Torrus::SiteConfig; use Torrus::Renderer::HTML; use Torrus::Renderer::RRDtool; use Torrus::Renderer::Frontpage; use Torrus::Renderer::AdmInfo; use Torrus::Renderer::RPC; use Torrus::Renderer::Health; # Inherit methods from these modules use base qw(Torrus::Renderer::HTML Torrus::Renderer::RRDtool Torrus::Renderer::Frontpage Torrus::Renderer::AdmInfo Torrus::Renderer::RPC Torrus::Renderer::Health); sub new { my $self = {}; my $class = shift; bless $self, $class; return $self; } # Returns the absolute filename and MIME type: # # my($fname, $mimetype) = $renderer->render($config_tree, $token, $view); # sub render { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my %new_options = @_; # If no options given, preserve the existing ones if( %new_options ) { $self->{'options'} = \%new_options; } my $tree = $config_tree->treeName(); if( not $config_tree->isTset($token) ) { if( not defined( $config_tree->path($token) ) ) { Error("No such token: $token"); return undef; } } $view = $config_tree->getDefaultView($token) unless defined $view; my $uid = ''; if( $self->{'options'}->{'uid'} ) { $uid = $self->{'options'}->{'uid'}; } my $method = 'render_' . $config_tree->getOtherParam($view, 'view-type'); my ($fh, $filename) = tempfile(); $fh->close(); my ($t_expires, $mime_type) = $self->$method( $config_tree, $token, $view, $filename ); if( %new_options ) { $self->{'options'} = undef; } my @ret; if( defined($t_expires) and defined($mime_type) ) { @ret = ($filename, $mime_type, $t_expires - time()); } else { unlink $filename; } return @ret; } sub xmlnormalize { my( $txt )= @_; # Remove spaces in the head and tail. $txt =~ s/^\s+//om; $txt =~ s/\s+$//om; # Unscreen special characters $txt =~ s/{COLON}/:/ogm; $txt =~ s/{SEMICOL}/;/ogm; $txt =~ s/{PERCENT}/%/ogm; $txt =~ s/\&/\&\;/ogm; $txt =~ s/\/\>\;/ogm; $txt =~ s/\'/\&apos\;/ogm; $txt =~ s/\"/\"\;/ogm; return $txt; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/ServiceID.pm0000644000175000017500000000756113131663307014146 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Manage the properties assigned to Service IDs package Torrus::ServiceID; use strict; use warnings; use Torrus::Log; use Torrus::Redis; use JSON; sub new { my $self = {}; my $class = shift; bless $self, $class; $self->{'json'} = JSON->new->canonical(1)->allow_nonref(1); $self->{'redis'} = Torrus::Redis->new(server => $Torrus::Global::redisServer); $self->{'params_hname'} = $Torrus::Global::redisPrefix . 'serviceid_params'; $self->{'tokens_hname'} = $Torrus::Global::redisPrefix . 'serviceid_tokens'; return $self; } sub idExists { my $self = shift; my $serviceid = shift; return defined($self->{'redis'}->hget($self->{'params_hname'}, $serviceid)); } sub set { my $self = shift; my $serviceid = shift; my $params = shift; my $redis = $self->{'redis'}; my $old_params = $redis->hget($self->{'params_hname'}, $serviceid); if( defined($old_params) ) { $old_params = $self->{'json'}->decode($old_params); if(defined($old_params->{'token'}) ) { Error('Cannot set new parameters for ServiceID ' . $serviceid . ' while it is assigned to token ' . $old_params->{'token'}); return 0; } } $redis->hset($self->{'params_hname'}, $serviceid, $self->{'json'}->encode($params)); if( defined($params->{'token'}) ) { $redis->hset($self->{'tokens_hname'}, $params->{'token'}, $serviceid); } return 1; } sub tokenDeleted { my $self = shift; my $token = shift; my $redis = $self->{'redis'}; my $serviceid = $redis->hget($self->{'tokens_hname'}, $token); if( defined($serviceid) ) { my $params = $self->{'json'}->decode( $redis->hget($self->{'params_hname'}, $serviceid)); delete $params->{'token'}; $redis->hset($self->{'params_hname'}, $serviceid, $self->{'json'}->encode($params)); $redis->hdel($self->{'tokens_hname'}, $token); } return; } sub getAllTokens { my $self = shift; return { $self->{'redis'}->hgetall($self->{'tokens_hname'}) }; } sub getParams { my $self = shift; my $serviceid = shift; my $params = $self->{'redis'}->hget($self->{'params_hname'}, $serviceid); if( defined($params) ) { return $self->{'json'}->decode($params); } return {}; } sub getAllForTree { my $self = shift; my $tree = shift; my $ret = []; my %all = $self->{'redis'}->hgetall($self->{'params_hname'}); foreach my $serviceid (sort keys %all) { my $params = $self->{'json'}->decode($all{$serviceid}); if( defined($params->{'trees'}) and grep {$_ eq $tree} split(',', $params->{'trees'}) ) { push( @{$ret}, $serviceid); } } return $ret; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/AgentConfig.pm0000644000175000017500000001061113131663307014503 00000000000000# Copyright (C) 2017 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::AgentConfig; use strict; use warnings; use Torrus::Redis; use Git::ObjectStore; use JSON; use Torrus::Log; sub new { my $class = shift; my $treename = shift; my $agent = shift; my $instance = shift; my $self = {}; bless $self, $class; $self->{'treename'} = $treename; $self->{'agent'} = $agent; $self->{'instance'} = $instance; $self->{'repodir'} = $Torrus::Global::gitRepoDir; $self->{'branch'} = sprintf('%s_%s_%.4x', $treename, $agent, $instance); $self->{'redis'} = Torrus::Redis->new(server => $Torrus::Global::redisServer); $self->{'redis_prefix'} = $Torrus::Global::redisPrefix; $self->{'json'} = JSON->new->allow_nonref(1); return $self; } sub _store { my $self = shift; my $store = new Git::ObjectStore( 'repodir' => $self->{'repodir'}, 'branchname' => $self->{'branch'}, 'goto' => $self->{'current_head'}); return $store; } sub needsFlush { my $self = shift; if( not defined($self->{'current_head'}) ) { return 1; } else { eval { $self->_store() }; if( $@ ) { return 1; } } return 0; } sub readAll { my $self = shift; my $cb_token_updated = shift; my $informed_not_ready; my $head; while( not defined($head) ) { $head = $self->{'redis'}->hget( $self->{'redis_prefix'} . 'githeads', $self->{'branch'}); if( not defined($head) ) { if( not $informed_not_ready ) { Info('Nothing is yet available for branch ' . $self->{'branch'} . '. Waiting for data.'); $informed_not_ready = 1; } sleep(20); } } Debug('Reading all entries in ' . $self->{'branch'}); $self->{'current_head'} = $head; my $n_updated = 0; my $store = $self->_store(); my $cb_read = sub { my ($path, $data) = @_; my $token = join('', split('/', $path)); &{$cb_token_updated}($token, $self->{'json'}->decode($data)); $n_updated++ }; $store->recursive_read('', $cb_read); Debug('Read ' . $n_updated . ' entries from ' . $self->{'branch'}); return; } sub readUpdates { my $self = shift; my $cb_token_updated = shift; my $cb_token_deleted = shift; if( not defined($self->{'current_head'}) ) { die('readUpdates was called prior to readAll'); } my $head = $self->{'redis'}->hget( $self->{'redis_prefix'} . 'githeads', $self->{'branch'}); if( not defined($head) ) { die('Cannot read the branch head from Redis'); } if( $head eq $self->{'current_head'} ) { return 0; } my $old_head = $self->{'current_head'}; $self->{'current_head'} = $head; my $store = $self->_store(); my $n_updated = 0; my $n_deleted = 0; my $cb_updated = sub { my ($path, $data) = @_; my $token = join('', split('/', $path)); &{$cb_token_updated}($token, $self->{'json'}->decode($data)); $n_updated++ }; my $cb_deleted = sub { my ($path) = @_; my $token = join('', split('/', $path)); &{$cb_token_deleted}($token); $n_deleted++ }; Debug('Reading new entries in ' . $self->{'branch'}); $store->read_updates($old_head, $cb_updated, $cb_deleted); Debug("Updated: $n_updated, Deleted: $n_deleted entries"); return 1; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/Renderer/0000755000175000017500000000000013131663307013610 500000000000000torrus-3.00/lib/Torrus/Renderer/HTML.pm0000644000175000017500000003462313131663307014642 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # our sort block is a bit complicated here ## no critic (BuiltinFunctions::RequireSimpleSortBlock) package Torrus::Renderer::HTML; use strict; use warnings; use Torrus::ConfigTree; use Torrus::Search; use Torrus::Log; use URI::Escape; use Template; use POSIX qw(abs log floor pow); use Date::Parse; use Date::Format; use IO::File; Torrus::SiteConfig::loadStyling(); # All our methods are imported by Torrus::Renderer; sub render_html { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $outfile = shift; my $tmplfile = $config_tree->getOtherParam($view, 'html-template'); my $expires = $config_tree->getOtherParam($view, 'expires'); # Create the Template Toolkit processor once, and reuse # it in subsequent render() calls if( not defined( $self->{'tt'} ) ) { $self->{'tt'} = new Template(INCLUDE_PATH => $Torrus::Global::templateDirs, TRIM => 1); } my $ttvars = { 'treeName' => $config_tree->treeName(), 'token' => $token, 'view' => $view, 'expires' => $expires, 'path' => sub { return $config_tree->path($_[0]); }, 'pathToken' => sub { return $config_tree->token($_[0]); }, 'nodeExists' => sub { return $config_tree->nodeExists($_[0]); }, 'children' => sub { return $config_tree->getChildren($_[0]); }, 'isLeaf' => sub { return $config_tree->isLeaf($_[0]); }, 'sortTokens' => sub { return $self->sortTokens($config_tree, $_[0]); }, 'nodeName' => sub { return $self->nodeName($config_tree, $_[0]); }, 'parent' => sub { return $config_tree->getParent($_[0]); }, 'nodeParam' => sub { return $config_tree->getNodeParam(@_); }, 'param' => sub { return $config_tree->getOtherParam(@_); }, 'url' => sub { return $self->makeURL($config_tree, @_); }, 'clearVar' => sub { delete $self->{'options'}{'variables'}{$_[0]}; return undef;}, 'plainURL' => $Torrus::Renderer::plainURL, 'splitUrls' => sub { return $self->makeSplitURLs($config_tree, $_[0], $_[1]); }, 'topURL' => ($Torrus::Renderer::rendererURL ne '' ? $Torrus::Renderer::rendererURL : '/'), 'rrprint' => sub { return $self->rrPrint($config_tree, $_[0], $_[1]); }, 'scale' => sub { return $self->scale($_[0], $_[1]); }, 'tsetMembers' => sub { $config_tree->tsetMembers($_[0]); }, 'tsetList' => sub { $config_tree->getTsets(); }, 'style' => sub { return $self->style($_[0]); }, 'companyName'=> $Torrus::Renderer::companyName, 'companyLogo'=> $Torrus::Renderer::companyLogo, 'companyURL' => $Torrus::Renderer::companyURL, 'siteInfo' => $Torrus::Renderer::siteInfo, 'treeInfo' => sub { return $Torrus::Global::treeConfig{ $config_tree->treeName()}{'info'}; }, 'version' => $Torrus::Global::version, 'xmlnorm' => \&Torrus::Renderer::xmlnormalize, 'userAuth' => $Torrus::CGI::authorizeUsers, 'uid' => $self->{'options'}->{'uid'}, 'userAttr' => sub { return $self->userAttribute( $_[0] ) }, 'mayDisplayAdmInfo' => sub { return $self->may_display_adminfo( $config_tree, $_[0] ) }, 'adminfo' => $self->{'adminfo'}, 'mayDisplayReports' => sub { return $self->may_display_reports($config_tree) }, 'reportsUrl' => sub { return $self->reportsUrl($config_tree); }, 'timestamp' => sub { return time2str($Torrus::Renderer::timeFormat, time()); }, 'verifyDate' => sub { return verifyDate($_[0]); }, 'markup' => sub{ return $self->translateMarkup( @_ ); }, 'searchEnabled' => $Torrus::Renderer::searchEnabled, 'searchResults' => sub { return $self->doSearch($config_tree, $_[0]); }, 'displayHealth' => $Torrus::Renderer::displayHealthIcons, 'healthView' => $Torrus::Renderer::healthView, }; # Pass the options from Torrus::Renderer::render() to Template while( my( $opt, $val ) = each( %{$self->{'options'}} ) ) { $ttvars->{$opt} = $val; } my $result = $self->{'tt'}->process( $tmplfile, $ttvars, $outfile ); undef $ttvars; if( not $result ) { if( $config_tree->isTset( $token ) ) { Error("Error while rendering tokenset $token: " . $self->{'tt'}->error()); } else { my $path = $config_tree->path($token); Error("Error while rendering $path: " . $self->{'tt'}->error()); } return undef; } return ($expires+time(), 'text/html; charset=UTF-8'); } sub nodeName { my $self = shift; my $config_tree = shift; my $token = shift; my $n = $config_tree->getNodeParam($token, 'node-display-name', 1); if( defined( $n ) and $n ne '' ) { return $n; } return $config_tree->nodeName($config_tree->path($token)); } sub sortTokens { my $self = shift; my $config_tree = shift; my $tokenlist = shift; my @sorted = (); if( ref($tokenlist) and scalar(@{$tokenlist}) > 0 ) { @sorted = sort { my $p_a = $config_tree->getNodeParam($a, 'precedence', 1); $p_a = 0 unless defined $p_a; my $p_b = $config_tree->getNodeParam($b, 'precedence', 1); $p_b = 0 unless defined $p_b; if( $p_a == $p_b ) { my $n_a = $config_tree->path($a); my $n_b = $config_tree->path($b); return $n_a cmp $n_b; } else { return $p_b <=> $p_a; } } @{$tokenlist}; } else { push(@sorted, $tokenlist); } return @sorted; } # compose an URL for a node. # Link is done with nodeid if available, or with path sub makeURL { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my @add_vars = @_; my $ret = $Torrus::Renderer::rendererURL . '/' . $config_tree->treeName(); # Try using nodeid whenever it's available if( $config_tree->isTset($token) ) { $ret .= '?token=' . $token; } else { my $nodeid = $config_tree->getNodeParam($token, 'nodeid', 1); if( defined( $nodeid ) ) { $ret .= '?nodeid=' . uri_escape($nodeid, $Torrus::Renderer::uriEscapeExceptions); } else { $ret .= '?path=' . uri_escape($config_tree->path($token), $Torrus::Renderer::uriEscapeExceptions); } } if( $view ) { $ret .= '&view=' . uri_escape($view); } my %vars = (); # This could be array or a reference to array my $add_vars_size = scalar( @add_vars ); if( $add_vars_size == 1 and ref( $add_vars[0] ) ) { %vars = @{$add_vars[0]}; } elsif( $add_vars_size > 0 and ($add_vars_size % 2 == 0) ) { %vars = @add_vars; } if( ref( $self->{'options'}->{'variables'} ) ) { foreach my $name ( sort keys %{$self->{'options'}->{'variables'}} ) { my $val = $self->{'options'}->{'variables'}->{$name}; if( not defined( $vars{$name} ) ) { $vars{$name} = $val; } } } foreach my $name ( sort keys %vars ) { if( $vars{$name} ne '' ) { $ret .= '&' . $name . '=' . uri_escape( $vars{$name}, $Torrus::Renderer::uriEscapeExceptions ); } } return $ret; } sub makeSplitURLs { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $ret = ''; while( defined( $token ) ) { my $path = $config_tree->path($token); my $str = ''; $str .= sprintf('%s%s', $self->makeURL($config_tree, $token, $view), $config_tree->nodeName($path), ( $config_tree->isSubtree($token) and $path ne '/') ? '/':'' ); $str .= "\n"; $ret = $str . $ret; $token = $config_tree->getParent( $token ); } return $ret; } sub rrPrint { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my @ret = (); my($fname, $mimetype) = $self->render( $config_tree, $token, $view ); if( $mimetype ne 'text/plain' ) { Error("View $view does not produce text/plain for token $token"); } else { my $fh = IO::File->new($fname, 'r'); if( not defined($fh) ) { Error("Cannot open $fname for reading: $!"); } else { chomp(my $values = <$fh>); @ret = split(':', $values); $fh->close(); unlink $fname; } } return @ret; } # This subroutine is taken from Dave Plonka's Flowscan sub scale { my $self = shift; # This is based somewhat on Tobi Oetiker's code in rrd_graph.c: my $fmt = shift; my $value = shift; my @symbols = ("a", # 10e-18 Ato "f", # 10e-15 Femto "p", # 10e-12 Pico "n", # 10e-9 Nano "u", # 10e-6 Micro "m", # 10e-3 Milli "", # Base "k", # 10e3 Kilo "M", # 10e6 Mega "G", # 10e9 Giga "T", # 10e12 Terra "P", # 10e15 Peta "E"); # 10e18 Exa my $symbcenter = 6; my $digits = (0 == $value)? 0 : floor(log(abs($value))/log(1000)); return sprintf( $fmt . "%s", $value/pow(1000, $digits), $symbols[ $symbcenter+$digits ] ); } sub style { my $self = shift; my $object = shift; my $media; if( not defined( $media = $self->{'options'}->{'variables'}->{'MEDIA'} ) ) { $media = 'default'; } return $Torrus::Renderer::styling{$media}{$object}; } sub userAttribute { my $self = shift; my $attr = shift; if( $self->{'options'}->{'uid'} and $self->{'options'}->{'acl'} ) { return ($self->{'options'}->{'acl'}-> userAttribute( $self->{'options'}->{'uid'}, $attr )); } else { return ''; } } sub hasPrivilege { my $self = shift; my $object = shift; my $privilege = shift; if( $self->{'options'}->{'uid'} and $self->{'options'}->{'acl'} ) { return ($self->{'options'}->{'acl'}-> hasPrivilege( $self->{'options'}->{'uid'}, $object, $privilege )); } else { return undef; } } sub translateMarkup { my $self = shift; my @strings = @_; my $tt = new Template( TRIM => 1 ); my $ttvars = { 'em' => sub { return '' . $_[0] . ''; }, 'strong' => sub { return '' . $_[0] . ''; } }; my $ret = ''; foreach my $str ( @strings ) { my $output = ''; my $result = $tt->process( \$str, $ttvars, \$output ); if( not $result ) { Error('Error translating markup: ' . $tt->error()); } else { $ret .= $output; } } undef $tt; return $ret; } sub verifyDate { my $input = shift; my $time = str2time( $input ); # rrdtool does not understand dates prior to 1980 (315529200) if( defined( $time ) and $time > 315529200 ) { # Present the time in format understood by rrdtool return time2str('%H:%M %Y%m%d', $time); } else { return ''; } } sub may_display_reports { my $self = shift; my $config_tree = shift; if( $Torrus::Renderer::displayReports ) { if( not $Torrus::CGI::authorizeUsers ) { return 1; } my $tree = $config_tree->treeName(); if( $self->hasPrivilege( $tree, 'DisplayReports' ) and -r $Torrus::Global::reportsDir . '/' . $tree . '/html/index.html' ) { return 1; } } return 0; } sub reportsUrl { my $self = shift; my $config_tree = shift; return $Torrus::Renderer::rendererURL . '/' . $config_tree->treeName() . '?htmlreport=index.html'; } sub doSearch { my $self = shift; my $config_tree = shift; my $string = shift; my $tree = $config_tree->treeName(); my $sr = new Torrus::Search; my $result = $sr->searchTree( $string, $tree ); my $unsorted = []; foreach my $token (keys %{$result}) { my $data = { 'token' => $token, 'path' => $config_tree->path($token), 'match' => {}, }; foreach my $param (keys %{$result->{$token}}) { if( $param ne '__NODENAME__' ) { $data->{'match'}{$param} = $config_tree->getNodeParam($token, $param); } } push(@{$unsorted}, $data); } return [sort {$a->{'path'} cmp $b->{'path'}} @{$unsorted}]; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/Renderer/Frontpage.pm0000644000175000017500000001634313131663307016022 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::Renderer::Frontpage; use strict; use warnings; use Torrus::ConfigTree; use Torrus::Search; use Torrus::Log; use Template; use URI::Escape; use File::Temp qw(tempfile); # All our methods are imported by Torrus::Renderer; sub renderUserLogin { my $self = shift; my %new_options = @_; if( %new_options ) { $self->{'options'} = \%new_options; } my ($fh, $filename) = tempfile(); $fh->close(); my $mime_type = $Torrus::Renderer::LoginScreen::mimeType; my $tmplfile = $Torrus::Renderer::LoginScreen::template; # Create the Template Toolkit processor once, and reuse # it in subsequent render() calls if( not defined( $self->{'tt'} ) ) { $self->{'tt'} = new Template(INCLUDE_PATH => $Torrus::Global::templateDirs, TRIM => 1); } my $url = $Torrus::Renderer::rendererURL; if( length( $self->{'options'}->{'urlPassTree'} ) > 0 ) { $url .= '/' . $self->{'options'}->{'urlPassTree'}; } my $ttvars = { 'url' => $url, 'plainURL' => $Torrus::Renderer::plainURL, 'style' => sub { return $self->style($_[0]); }, 'companyName'=> $Torrus::Renderer::companyName, 'companyLogo'=> $Torrus::Renderer::companyLogo, 'companyURL' => $Torrus::Renderer::companyURL, 'lostPasswordURL' => $Torrus::Renderer::lostPasswordURL, 'siteInfo' => $Torrus::Renderer::siteInfo, 'version' => $Torrus::Global::version, 'xmlnorm' => \&Torrus::Renderer::xmlnormalize }; # Pass the options from Torrus::Renderer::render() to Template while( my( $opt, $val ) = each( %{$self->{'options'}} ) ) { $ttvars->{$opt} = $val; } my $result = $self->{'tt'}->process( $tmplfile, $ttvars, $filename ); undef $ttvars; my @ret; if( not $result ) { Error("Error while rendering login screen: " . $self->{'tt'}->error()); } else { @ret = ($filename, $mime_type, 0); } $self->{'options'} = undef; return @ret; } sub renderTreeChooser { my $self = shift; my %new_options = @_; if( %new_options ) { $self->{'options'} = \%new_options; } my $uid = ''; if( $self->{'options'}->{'uid'} ) { $uid = $self->{'options'}->{'uid'}; } my ($fh, $filename) = tempfile(); $fh->close(); my $t_expires = time() + $Torrus::Renderer::Chooser::expires; my $mime_type = $Torrus::Renderer::Chooser::mimeType; my $tmplfile; if( defined( $self->{'options'}{'variables'}{'SEARCH'} ) and $self->mayGlobalSearch() ) { $tmplfile = $Torrus::Renderer::Chooser::searchTemplate; } else { $tmplfile = $Torrus::Renderer::Chooser::template; } # Create the Template Toolkit processor once, and reuse # it in subsequent render() calls if( not defined( $self->{'tt'} ) ) { $self->{'tt'} = new Template(INCLUDE_PATH => $Torrus::Global::templateDirs, TRIM => 1); } my $ttvars = { 'treeNames' => sub{ return Torrus::SiteConfig::listTreeNames() }, 'treeDescr' => sub{ return Torrus::SiteConfig::treeDescription($_[0]) } , 'url' => sub { return $Torrus::Renderer::rendererURL . '/' . $_[0] }, 'tokenUrl' => sub { return $Torrus::Renderer::rendererURL . '/' . $_[0] . '?token=' . $_[1] }, 'plainURL' => $Torrus::Renderer::plainURL, 'clearVar' => sub { delete $self->{'options'}{'variables'}{$_[0]}; return undef;}, 'style' => sub { return $self->style($_[0]); }, 'companyName'=> $Torrus::Renderer::companyName, 'companyLogo'=> $Torrus::Renderer::companyLogo, 'companyURL' => $Torrus::Renderer::companyURL, 'siteInfo' => $Torrus::Renderer::siteInfo, 'version' => $Torrus::Global::version, 'xmlnorm' => \&Torrus::Renderer::xmlnormalize, 'userAuth' => $Torrus::CGI::authorizeUsers, 'uid' => $self->{'options'}->{'uid'}, 'userAttr' => sub { return $self->userAttribute( $_[0] ) }, 'mayDisplayTree' => sub { return $self-> hasPrivilege( $_[0], 'DisplayTree' ) } , 'mayGlobalSearch' => sub { return $self->mayGlobalSearch(); }, 'searchResults' => sub { return $self->doGlobalSearch($_[0]); } }; # Pass the options from Torrus::Renderer::render() to Template while( my( $opt, $val ) = each( %{$self->{'options'}} ) ) { $ttvars->{$opt} = $val; } my $result = $self->{'tt'}->process( $tmplfile, $ttvars, $filename ); undef $ttvars; my @ret; if( not $result ) { Error("Error while rendering tree chooser: " . $self->{'tt'}->error()); } else { @ret = ($filename, $mime_type, $t_expires - time()); } $self->{'options'} = undef; return @ret; } sub mayGlobalSearch { my $self = shift; return ( $Torrus::Renderer::globalSearchEnabled and ( not $Torrus::CGI::authorizeUsers or ( $self->hasPrivilege( '*', 'GlobalSearch' ) ) ) ); } sub doGlobalSearch { my $self = shift; my $string = shift; my $sr = new Torrus::Search; my $result = $sr->searchGlobal( $string ); my %cf; my $unsorted = []; foreach my $token (keys %{$result}) { my $tree = $result->{$token}{'__TREENAME__'}; die('Undefined __TREENAME__ for ' . $token) unless defined($tree); my $config_tree = $cf{$tree}; if( not defined($config_tree) ) { $config_tree = $cf{$tree} = new Torrus::ConfigTree( -TreeName => $tree ); } my $data = { 'token' => $token, 'tree' => $tree, 'path' => $config_tree->path($token), 'match' => {}, }; foreach my $param (keys %{$result->{$token}}) { if( $param !~ /^__/o ) { $data->{'match'}{$param} = $config_tree->getNodeParam($token, $param); } } push(@{$unsorted}, $data); } return [sort {$a->{'path'} cmp $b->{'path'}} @{$unsorted}]; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/Renderer/RRDtool.pm0000644000175000017500000011016513131663307015417 00000000000000# Copyright (C) 2002-2011 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::Renderer::RRDtool; use strict; use warnings; use Torrus::ConfigTree; use Torrus::RPN; use Torrus::Log; use RRDs; use IO::File; # All our methods are imported by Torrus::Renderer; my %rrd_graph_opts = ( 'start' => '--start', 'end' => '--end', 'width' => '--width', 'height' => '--height', 'imgformat' => '--imgformat', 'border' => '--border', ); my %mime_type = ('PNG' => 'image/png', 'SVG' => 'image/svg+xml', 'EPS' => 'application/postscript', 'PDF' => 'application/pdf'); my @arg_arrays = qw(opts defs bg hwtick hwline line hrule fg); sub prepare_rrgraph_args { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $opt = shift; $opt = {} unless defined($opt); my $obj = {'args' => {}, 'dname' => 'A'}; foreach my $arrayName ( @arg_arrays ) { $obj->{'args'}{$arrayName} = []; } push( @{$obj->{'args'}{'opts'}}, $self->rrd_make_opts( $config_tree, $token, $view, \%rrd_graph_opts, $obj ) ); push( @{$obj->{'args'}{'opts'}}, $self->rrd_make_graph_opts( $config_tree, $token, $view ) ); my $dstype = $config_tree->getNodeParam($token, 'ds-type'); if( $dstype eq 'rrd-multigraph' ) { $self->rrd_make_multigraph( $config_tree, $token, $view, $obj ); } else { my $showmax = 0; my $max_dname = $obj->{'dname'} . '_Max'; my $leaftype = $config_tree->getNodeParam($token, 'leaf-type'); # Handle DEFs and CDEFs # At the moment, we call the DEF as 'A'. Could change in the future if( $leaftype eq 'rrd-def' ) { my $defstring = $self->rrd_make_def( $config_tree, $token, $obj->{'dname'} ); return(undef) unless defined($defstring); push( @{$obj->{'args'}{'defs'}}, $defstring ); if( $self->rrd_check_hw( $config_tree, $token, $view ) ) { $self->rrd_make_holtwinters( $config_tree, $token, $view, $obj ); } else { if( $self->rrd_if_showmax($config_tree, $token, $view) ) { my $step = $self->rrd_maxline_step( $config_tree, $view ); my $maxdef = $self->rrd_make_def( $config_tree, $token, $max_dname, 'MAX', {'step' => $step}); push( @{$obj->{'args'}{'defs'}}, $maxdef ); $showmax = 1; } } } elsif( $leaftype eq 'rrd-cdef' ) { my $expr = $config_tree->getNodeParam($token, 'rpn-expr'); push( @{$obj->{'args'}{'defs'}}, $self->rrd_make_cdef($config_tree, $token, $obj->{'dname'}, $expr) ); if( $self->rrd_if_showmax($config_tree, $token, $view) ) { my $step = $self->rrd_maxline_step( $config_tree, $view ); push( @{$obj->{'args'}{'defs'}}, $self->rrd_make_cdef( $config_tree, $token, $max_dname, $expr, {'force_function' => 'MAX', 'step' => $step} ) ); $showmax = 1; } } else { Error("Unsupported leaf-type: $leaftype"); return undef; } $self->rrd_make_graphline( $config_tree, $token, $view, $obj ); if( $showmax ) { $self->rrd_make_maxline( $max_dname, $config_tree, $token, $view, $obj ); } } return(undef) if $obj->{'error'}; if( not $opt->{'data_only'} ) { $self->rrd_make_hrules( $config_tree, $token, $view, $obj ); if( not $Torrus::Renderer::ignoreDecorations ) { $self->rrd_make_decorations( $config_tree, $token, $view, $obj ); } } # We're all set my $args = []; if( defined($Torrus::Global::RRDCachedSock) ) { push( @{$args}, "--daemon=unix:" . $Torrus::Global::RRDCachedSock ); } foreach my $arrayName ( @arg_arrays ) { push( @{$args}, @{$obj->{'args'}{$arrayName}} ); } return ($args, $obj); } sub render_rrgraph { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $outfile = shift; if( not $config_tree->isLeaf($token) ) { Error("Token $token is not a leaf"); return undef; } my ($args, $obj) = $self->prepare_rrgraph_args($config_tree, $token, $view); if( not defined($args) ) { return undef; } Debug("RRDs::graph arguments: " . join(' ', @{$args})); # localize the TZ enviromennt for the child process { my $tz = $self->{'options'}->{'variables'}->{'TZ'}; if( not defined($tz) ) { $tz = $ENV{'TZ'}; } local $ENV{'TZ'}; if( defined($tz) ) { $ENV{'TZ'} = $tz; } &RRDs::graph( $outfile, @{$args} ); } my $ERR=RRDs::error; if( $ERR ) { my $path = $config_tree->path($token); Error("$path $view: Error during RRD graph: $ERR"); return undef; } my $mimetype = $obj->{'mimetype'}; if( not defined($mimetype) ) { $mimetype = 'image/png'; } return( $config_tree->getOtherParam($view, 'expires')+time(), $mimetype ); } my %rrd_print_opts = ( 'start' => '--start', 'end' => '--end', ); sub render_rrprint { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $outfile = shift; if( not $config_tree->isLeaf($token) ) { Error("Token $token is not a leaf"); return undef; } my @arg_opts; my @arg_defs; my @arg_print; push( @arg_opts, $self->rrd_make_opts( $config_tree, $token, $view, \%rrd_print_opts, ) ); my $dstype = $config_tree->getNodeParam($token, 'ds-type'); if( $dstype eq 'rrd-multigraph' ) { Error("View type rrprint is not supported ". "for DS type rrd-multigraph"); return undef; } my $leaftype = $config_tree->getNodeParam($token, 'leaf-type'); # Handle DEFs and CDEFs # At the moment, we call the DEF as 'A'. Could change in the future my $dname = 'A'; if( $leaftype eq 'rrd-def' ) { my $defstring = $self->rrd_make_def( $config_tree, $token, $dname ); return(undef) unless defined($defstring); push( @arg_defs, $defstring ); } elsif( $leaftype eq 'rrd-cdef' ) { my $expr = $config_tree->getNodeParam($token, 'rpn-expr'); push( @arg_defs, $self->rrd_make_cdef($config_tree, $token, $dname, $expr)); } else { Error("Unsupported leaf-type: $leaftype"); return undef; } foreach my $cf ( split(',', $config_tree->getOtherParam($view, 'print-cf')) ) { push( @arg_print, sprintf( 'PRINT:%s:%s:%%le', $dname, $cf ) ); } # We're all set my @args = ( @arg_opts, @arg_defs, @arg_print ); Debug("RRDs::graph arguments: " . join(' ', @args)); my $printout; # localize the TZ enviromennt for the child process { my $tz = $self->{'options'}->{'variables'}->{'TZ'}; if( not defined($tz) ) { $tz = $ENV{'TZ'}; } local $ENV{'TZ'}; if( defined($tz) ) { $ENV{'TZ'} = $tz; } ($printout, undef, undef) = RRDs::graph('/dev/null', @args); } my $ERR=RRDs::error; if( $ERR ) { my $path = $config_tree->path($token); Error("$path $view: Error during RRD graph: $ERR"); return undef; } my $fh = IO::File->new($outfile, 'w'); if( not defined($fh) ) { Error("Cannot open $outfile for writing: $!"); return undef; } else { $fh->printf("%s\n", join(':', @{$printout})); $fh->close(); } return( $config_tree->getOtherParam($view, 'expires')+time(), 'text/plain' ); } sub rrd_make_multigraph { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $obj = shift; my @dsNames = split(',', $config_tree->getNodeParam($token, 'ds-names') ); # We need this to refer to some existing variable name $obj->{'dname'} = $dsNames[0]; my $showmax = $self->rrd_if_showmax($config_tree, $token, $view); # Analyze the drawing order my %dsOrder; foreach my $dname ( @dsNames ) { my $order = $config_tree->getNodeParam($token, 'line-order-'.$dname); $dsOrder{$dname} = defined( $order ) ? $order : 100; } my $disable_legend = $config_tree->getOtherParam($view, 'disable-legend'); $disable_legend = (defined($disable_legend) and $disable_legend eq 'yes') ? 1:0; # make DEFs and Line instructions my $do_gprint = 0; if( not $disable_legend ) { $do_gprint = $self->rrd_if_gprint( $config_tree, $token ); if( $do_gprint ) { $self->rrd_make_gprint_header( $config_tree, $token, $view, $obj ); } } foreach my $dname ( sort {$dsOrder{$a} <=> $dsOrder{$b}} @dsNames ) { my $dograph = 1; my $ignoreViews = $config_tree->getNodeParam($token, 'ignore-views-'.$dname); if( defined( $ignoreViews ) and grep {$_ eq $view} split(',', $ignoreViews) ) { $dograph = 0; } my $gprint_this = $do_gprint; if( $do_gprint ) { my $ds_nogprint = $config_tree->getNodeParam($token, 'disable-gprint-'.$dname); if( defined( $ds_nogprint ) and $ds_nogprint eq 'yes' ) { $gprint_this = 0; } } my $legend = ''; my $ds_expr; if( $dograph or $gprint_this ) { $ds_expr = $config_tree->getNodeParam($token, 'ds-expr-'.$dname); my @cdefs = $self->rrd_make_cdef($config_tree, $token, $dname, $ds_expr); if( not scalar(@cdefs) ) { $obj->{'error'} = 1; next; } push( @{$obj->{'args'}{'defs'}}, @cdefs ); $legend = $config_tree->getNodeParam($token, 'graph-legend-'.$dname); if( defined( $legend ) ) { $legend =~ s/:/\\:/g; } else { $legend = ''; } } if( $gprint_this ) { $self->rrd_make_gprint( $dname, $legend, $config_tree, $token, $view, $obj ); if( not $dograph ) { push( @{$obj->{'args'}{'line'}}, 'COMMENT:' . $legend . '\l'); } } else { # For datasource that disables gprint, there's no reason # to print the label $legend = ''; } if( $dograph ) { my $linestyle = $self->mkline( $config_tree->getNodeParam ($token, 'line-style-'.$dname) ); my $linecolor = $self->mkcolor( $config_tree->getNodeParam ($token, 'line-color-'.$dname) ); my $alpha = $config_tree->getNodeParam($token, 'line-alpha-'.$dname); if( defined( $alpha ) ) { $linecolor .= $alpha; } my $stack = $config_tree->getNodeParam($token, 'line-stack-'.$dname); if( defined( $stack ) and $stack eq 'yes' ) { $stack = ':STACK'; } else { $stack = ''; } if( $showmax and ($stack eq '') ) { my $max_dname = $dname . '_Max'; my $p_maxlinestyle = $config_tree->getNodeParam($token, 'maxline-style-'.$dname); my $p_maxlinecolor = $config_tree->getNodeParam($token, 'maxline-color-'.$dname); my $step = $self->rrd_maxline_step( $config_tree, $view ); if( defined($p_maxlinestyle) and defined($p_maxlinecolor) ) { my @cdefs = $self->rrd_make_cdef($config_tree, $token, $max_dname, $ds_expr, {'force_function' => 'MAX', 'step' => $step}); if( not scalar(@cdefs) ) { $obj->{'error'} = 1; next; } push( @{$obj->{'args'}{'defs'}}, @cdefs ); my $max_linestyle = $self->mkline( $p_maxlinestyle ); my $max_linecolor = $self->mkcolor( $p_maxlinecolor ); if( defined( $alpha ) ) { $max_linecolor .= $alpha; } push( @{$obj->{'args'}{'line'}}, sprintf( '%s:%s%s', $max_linestyle, $max_dname, $max_linecolor ) ); } } push( @{$obj->{'args'}{'line'}}, sprintf( '%s:%s%s%s%s', $linestyle, $dname, $linecolor, ($legend ne '') ? ':'.$legend.'\l' : ':\l', $stack ) ); } } return; } # Check if Holt-Winters stuff is needed sub rrd_check_hw { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $use_hw = 0; my $nodeHW = $config_tree->getNodeParam($token, 'rrd-hwpredict'); if( defined($nodeHW) and $nodeHW eq 'enabled' ) { my $viewHW = $config_tree->getOtherParam($view, 'rrd-hwpredict'); my $varNoHW = $self->{'options'}->{'variables'}->{'NOHW'}; if( (not defined($viewHW) or $viewHW ne 'disabled') and (not $varNoHW) ) { $use_hw = 1; } } return $use_hw; } sub rrd_make_holtwinters { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $obj = shift; my $dname = $obj->{'dname'}; my $defstring = $self->rrd_make_def( $config_tree, $token, $dname . 'pred', 'HWPREDICT' ); return() unless defined($defstring); push( @{$obj->{'args'}{'defs'}}, $defstring ); $defstring = $self->rrd_make_def( $config_tree, $token, $dname . 'dev', 'DEVPREDICT' ); return() unless defined($defstring); push( @{$obj->{'args'}{'defs'}}, $defstring ); # Upper boundary definition push( @{$obj->{'args'}{'defs'}}, sprintf( 'CDEF:%supper=%spred,%sdev,2,*,+', $dname, $dname, $dname ) ); # Lower boundary definition push( @{$obj->{'args'}{'defs'}}, sprintf( 'CDEF:%slower=%spred,%sdev,2,*,-', $dname, $dname, $dname ) ); # Failures definition $defstring = $self->rrd_make_def( $config_tree, $token, $dname . 'fail', 'FAILURES' ); return() unless defined($defstring); push( @{$obj->{'args'}{'defs'}}, $defstring ); # Generate H-W Boundary Lines # Boundary style my $hw_bndr_style = $config_tree->getOtherParam($view, 'hw-bndr-style'); $hw_bndr_style = 'LINE1' unless defined $hw_bndr_style; $hw_bndr_style = $self->mkline( $hw_bndr_style ); my $hw_bndr_color = $config_tree->getOtherParam($view, 'hw-bndr-color'); $hw_bndr_color = '#FF0000' unless defined $hw_bndr_color; $hw_bndr_color = $self->mkcolor( $hw_bndr_color ); push( @{$obj->{'args'}{'hwline'}}, sprintf( '%s:%supper%s:%s', $hw_bndr_style, $dname, $hw_bndr_color, $Torrus::Renderer::hwGraphLegend ? 'Boundaries\n':'' ) ); push( @{$obj->{'args'}{'hwline'}}, sprintf( '%s:%slower%s', $hw_bndr_style, $dname, $hw_bndr_color ) ); # Failures Tick my $hw_fail_color = $config_tree->getOtherParam($view, 'hw-fail-color'); $hw_fail_color = '#FFFFA0' unless defined $hw_fail_color; $hw_fail_color = $self->mkcolor( $hw_fail_color ); push( @{$obj->{'args'}{'hwtick'}}, sprintf( 'TICK:%sfail%s:1.0:%s', $dname, $hw_fail_color, $Torrus::Renderer::hwGraphLegend ? 'Failures':'') ); return; } sub rrd_make_graphline { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $obj = shift; my $legend; my $disable_legend = $config_tree->getOtherParam($view, 'disable-legend'); if( not defined($disable_legend) or $disable_legend ne 'yes' ) { $legend = $config_tree->getNodeParam($token, 'graph-legend'); if( defined( $legend ) ) { $legend =~ s/:/\\:/g; } } if( not defined( $legend ) ) { $legend = ''; } my $styleval = $config_tree->getNodeParam($token, 'line-style'); if( not defined($styleval) ) { $styleval = $config_tree->getOtherParam($view, 'line-style'); } my $linestyle = $self->mkline( $styleval ); my $colorval = $config_tree->getNodeParam($token, 'line-color'); if( not defined($colorval) ) { $colorval = $config_tree->getOtherParam($view, 'line-color'); } my $linecolor = $self->mkcolor( $colorval ); if( $self->rrd_if_gprint( $config_tree, $token ) ) { $self->rrd_make_gprint_header( $config_tree, $token, $view, $obj ); $self->rrd_make_gprint( $obj->{'dname'}, $legend, $config_tree, $token, $view, $obj ); } push( @{$obj->{'args'}{'line'}}, sprintf( '%s:%s%s%s', $linestyle, $obj->{'dname'}, $linecolor, ($legend ne '') ? ':'.$legend.'\l' : '' ) ); if( $legend eq '' ) { push( @{$obj->{'args'}{'line'}}, 'COMMENT:\l' ); } return; } sub rrd_make_maxline { my $self = shift; my $max_dname = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $obj = shift; my $legend; my $disable_legend = $config_tree->getOtherParam($view, 'disable-legend'); if( not defined($disable_legend) or $disable_legend ne 'yes' ) { $legend = $config_tree->getNodeParam($token, 'graph-legend'); if( defined( $legend ) ) { $legend =~ s/:/\\:/g; } } if( not defined( $legend ) ) { $legend = 'Max'; } else { $legend = 'Max ' . $legend; } my $styleval = $config_tree->getNodeParam($token, 'maxline-style'); if( not defined($styleval) ) { $styleval = $config_tree->getOtherParam($view, 'maxline-style'); } my $linestyle = $self->mkline( $styleval ); my $colorval = $config_tree->getNodeParam($token, 'maxline-color'); if( not defined($colorval) ) { $colorval = $config_tree->getOtherParam($view, 'maxline-color'); } my $linecolor = $self->mkcolor( $colorval ); if( $self->rrd_if_gprint( $config_tree, $token ) ) { $self->rrd_make_gprint( $max_dname, $legend, $config_tree, $token, $view, $obj ); } push( @{$obj->{'args'}{'line'}}, sprintf( '%s:%s%s%s', $linestyle, $max_dname, $linecolor, ($legend ne '') ? ':'.$legend.'\l' : ':\l' ) ); return; } # Generate RRDtool arguments for HRULE's sub rrd_make_hrules { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $obj = shift; my $hrulesList = $config_tree->getOtherParam($view, 'hrules'); if( defined( $hrulesList ) ) { foreach my $hruleName ( split(',', $hrulesList ) ) { # The presence of this parameter is checked by Validator my $valueParam = $config_tree->getOtherParam( $view, 'hrule-value-'.$hruleName ); my $value = $config_tree->getNodeParam( $token, $valueParam ); if( defined( $value ) ) { my $style = $config_tree->getOtherParam($view, 'hrule-color-'.$hruleName); my $color = $self->mkcolor( $style ); my $line = $self->mkline( $style ); my $legend = $config_tree->getNodeParam($token, 'hrule-legend-'.$hruleName); my $arg = sprintf( '%s:%e%s::skipscale', $line, $value, $color ); if( defined( $legend ) and $legend =~ /\S/ ) { $arg .= ':' . $legend . '\l'; } push( @{$obj->{'args'}{'hrule'}}, $arg ); } } } return; } sub rrd_make_decorations { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $obj = shift; my $decorList = $config_tree->getOtherParam($view, 'decorations'); my $ignore_decor = $config_tree->getNodeParam($token, 'graph-ignore-decorations'); if( defined( $decorList ) and (not defined($ignore_decor) or $ignore_decor ne 'yes') ) { my $decor = {}; foreach my $decorName ( split(',', $decorList ) ) { my $order = $config_tree->getOtherParam($view, 'dec-order-' . $decorName); $decor->{$order} = {'def' => [], 'line' => ''}; my $style = $self->mkline($config_tree-> getOtherParam($view, 'dec-style-' . $decorName)); my $color = $self->mkcolor($config_tree-> getOtherParam($view, 'dec-color-' . $decorName)); my $expr = $config_tree-> getOtherParam($view, 'dec-expr-' . $decorName); my @cdefs = $self->rrd_make_cdef( $config_tree, $token, $decorName, $obj->{'dname'} . ',POP,' . $expr ); if( scalar(@cdefs) ) { push( @{$decor->{$order}{'def'}}, @cdefs ); $decor->{$order}{'line'} = sprintf( '%s:%s%s', $style, $decorName, $color ); } else { $obj->{'error'} = 1; } } foreach my $order ( sort {$a<=>$b} keys %{$decor} ) { my $array = $order < 0 ? 'bg':'fg'; push( @{$obj->{'args'}{'defs'}}, @{$decor->{$order}{'def'}} ); push( @{$obj->{'args'}{$array}}, $decor->{$order}{'line'} ); } } return; } # Takes the parameters from the view, and composes the list of # RRDtool arguments sub rrd_make_opts { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $opthash = shift; my $obj = shift; my @args = (); foreach my $param ( keys %{$opthash} ) { my $value = $self->{'options'}->{'variables'}->{'G' . $param}; if( not defined( $value ) ) { $value = $config_tree->getOtherParam( $view, $param ); } if( defined( $value ) ) { if( ( $param eq 'start' or $param eq 'end' ) and defined( $self->{'options'}->{'variables'}->{'NOW'} ) ) { my $now = $self->{'options'}->{'variables'}->{'NOW'}; if( index( $value , 'now' ) >= 0 ) { $value =~ s/now/$now/; } elsif( $value =~ /^(\-|\+)/ ) { $value = $now . $value; } } elsif( $param eq 'imgformat' ) { if( not defined($mime_type{$value}) ) { Error('Unsupported value for imgformat: ' . $value); $value = 'PNG'; } if( defined($obj) ) { $obj->{'mimetype'} = $mime_type{$value}; } } push( @args, $opthash->{$param}, $value ); } } my $params = $config_tree->getOtherParam($view, 'rrd-params'); if( defined( $params ) ) { push( @args, split('\s+', $params) ); } my $scalingbase = $config_tree->getNodeParam($token, 'rrd-scaling-base'); if( defined($scalingbase) and $scalingbase == 1024 ) { push( @args, '--base', '1024' ); } return @args; } sub rrd_make_graph_opts { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my @args; my $graph_log = $config_tree->getNodeParam($token, 'graph-logarithmic'); if( defined($graph_log) and $graph_log eq 'yes' ) { push( @args, '--logarithmic' ); } my $disable_title = $config_tree->getOtherParam($view, 'disable-title'); if( not defined( $disable_title ) or $disable_title ne 'yes' ) { my $title = $config_tree->getNodeParam($token, 'graph-title'); if( not defined($title) ) { $title = ' '; } push( @args, '--title', $title ); } my $disable_vlabel = $config_tree->getOtherParam($view, 'disable-vertical-label'); if( not defined( $disable_vlabel ) or $disable_vlabel ne 'yes' ) { my $vertical_label = $config_tree->getNodeParam($token, 'vertical-label'); if( defined( $vertical_label ) ) { push( @args, '--vertical-label', $vertical_label ); } } my $ignore_limits = $config_tree->getOtherParam($view, 'ignore-limits'); if( not defined($ignore_limits) or $ignore_limits ne 'yes' ) { my $ignore_lower = $config_tree->getOtherParam($view, 'ignore-lower-limit'); if( not defined($ignore_lower) or $ignore_lower ne 'yes' ) { my $limit = $config_tree->getNodeParam($token, 'graph-lower-limit'); if( defined($limit) ) { push( @args, '--lower-limit', $limit ); } } my $ignore_upper = $config_tree->getOtherParam($view, 'ignore-upper-limit'); if( not defined($ignore_upper) or $ignore_upper ne 'yes' ) { my $limit = $config_tree->getNodeParam($token, 'graph-upper-limit'); if( defined($limit) ) { push( @args, '--upper-limit', $limit ); } } my $rigid_boundaries = $config_tree->getNodeParam($token, 'graph-rigid-boundaries'); if( defined($rigid_boundaries) and $rigid_boundaries eq 'yes' ) { push( @args, '--rigid' ); } } # take colors from view and URL params my $colorval = $self->{'options'}->{'variables'}->{'Gcolors'}; if( not defined( $colorval ) ) { $colorval = $config_tree->getOtherParam( $view, 'graph-colors' ); } if( defined( $colorval ) ) { my @values = split( /:/, $colorval ); if( (scalar(@values) % 2) != 0 ) { Error("Graph colors should be an even number of " . "elements separated by colon: " . $colorval); } else { while( scalar(@values) ) { my $tag = shift @values; my $color = shift @values; if( $tag !~ /^[A-Z]+$/o ) { Error("Invalid format for color tag in graph colors: " . $colorval); } elsif( $color !~ /^[0-9A-F]{6}([0-9A-F]{2})?$/io ) { Error("Invalid format for color value in graph colors: " . $colorval); } else { push( @args, '--color', $tag . '#' . $color ); } } } } if( scalar( @Torrus::Renderer::graphExtraArgs ) > 0 ) { push( @args, @Torrus::Renderer::graphExtraArgs ); } return @args; } sub rrd_make_def { my $self = shift; my $config_tree = shift; my $token = shift; my $dname = shift; my $cf = shift; my $opts = shift; my $datafile = $config_tree->getNodeParam($token, 'data-file'); my $dataddir = $config_tree->getNodeParam($token, 'data-dir'); my $rrdfile = $dataddir.'/'.$datafile; if( not -r $rrdfile ) { my $path = $config_tree->path($token); Error("$path: No such file or directory: $rrdfile"); return undef; } my $ds = $config_tree->getNodeParam($token, 'rrd-ds'); if( not defined $cf ) { $cf = $config_tree->getNodeParam($token, 'rrd-cf'); } my $def_options = ''; my $step = $config_tree->getNodeParam($token, 'graph-step'); if( defined($opts) and defined($opts->{'step'}) ) { $step = $opts->{'step'}; } if( defined($step) ) { $def_options .= ':step=' . $step; } return sprintf( 'DEF:%s=%s:%s:%s%s', $dname, $rrdfile, $ds, $cf, $def_options ); } my %cfNames = ( 'AVERAGE' => 1, 'MIN' => 1, 'MAX' => 1, 'LAST' => 1 ); # Moved the validation part to Torrus::ConfigTree::Validator sub rrd_make_cdef { my $self = shift; my $config_tree = shift; my $token = shift; my $dname = shift; my $expr = shift; my $opts = shift; my @args = (); my $ok = 1; my $step = $config_tree->getNodeParam($token, 'graph-step'); if( defined($opts) and defined($opts->{'step'}) ) { $step = $opts->{'step'}; } # We will name the DEFs as $dname.sprintf('%.2d', $ds_couter++); my $ds_couter = 1; my $rpn = new Torrus::RPN; # The callback for RPN translation my $callback = sub { my ($noderef, $timeoffset) = @_; my $function; if( defined($opts) and defined($opts->{'force_function'}) ) { $function = $opts->{'force_function'}; } elsif( $noderef =~ s/^(.+)\@// ) { $function = $1; } my $cf; if( defined( $function ) and $cfNames{$function} ) { $cf = $function; } my $leaf = ($noderef ne '') ? $config_tree->getRelative($token, $noderef) : $token; my $varname = $dname . sprintf('%.2d', $ds_couter++); my $defstring = $self->rrd_make_def( $config_tree, $leaf, $varname, $cf ); if( not defined($defstring) ) { $ok = 0; } else { if( defined($step) ) { $defstring .= ':step=' . $step; } push( @args, $defstring ); } return $varname; }; $expr = $rpn->translate( $expr, $callback ); return() unless $ok; push( @args, sprintf( 'CDEF:%s=%s', $dname, $expr ) ); return @args; } sub rrd_if_gprint { my $self = shift; my $config_tree = shift; my $token = shift; my $disable = $config_tree->getNodeParam($token, 'graph-disable-gprint'); if( defined( $disable ) and $disable eq 'yes' ) { return 0; } return 1; } # determine if MAX line should be drawn sub rrd_if_showmax { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $disable = $config_tree->getNodeParam($token, 'graph-disable-maxline'); if( defined( $disable ) and $disable eq 'yes' ) { return 0; } if( $self->{'options'}->{'variables'}->{'Gmaxline'} ) { return 1; } my $enable = $config_tree->getOtherParam($view, 'draw-maxline'); if( defined($enable) and $enable eq 'yes' ) { return 1; } return 0; } # determine the aggregation step for MAX line sub rrd_maxline_step { my $self = shift; my $config_tree = shift; my $view = shift; my $step = $config_tree->getOtherParam($view, 'maxline-step'); if( not defined($step) ) { $step = 86400; } my $var = $self->{'options'}->{'variables'}->{'Gmaxlinestep'}; if( defined($var) ) { $step = $var; } return $step; } sub rrd_make_gprint { my $self = shift; my $vname = shift; my $legend = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $obj = shift; my @args = (); my $gprintValues = $config_tree->getOtherParam($view, 'gprint-values'); if( defined( $gprintValues ) ) { foreach my $gprintVal ( split(',', $gprintValues ) ) { my $format = $config_tree->getOtherParam($view, 'gprint-format-' . $gprintVal); push( @args, 'GPRINT:' . $vname . ':' . $format ); } } push( @{$obj->{'args'}{'line'}}, @args ); return; } sub rrd_make_gprint_header { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $obj = shift; my $gprintValues = $config_tree->getOtherParam($view, 'gprint-values'); if( defined( $gprintValues ) ) { my $gprintHeader = $config_tree->getOtherParam($view, 'gprint-header'); if( defined( $gprintHeader ) ) { push( @{$obj->{'args'}{'line'}}, 'COMMENT:' . $gprintHeader . '\l' ); } } return; } sub mkcolor { my $self = shift; my $color = shift; my $alpha; my $recursionLimit = 10; while( $color =~ /^\#\#(\S+)$/ ) { if( $recursionLimit-- <= 0 ) { Error('Color recursion is too deep'); $color = '#000000'; } else { my $colorName = $1; $color = $Torrus::Renderer::graphStyles{$colorName}{'color'}; if( not defined( $color ) ) { Error('No color is defined for ' . $colorName); $color = '#000000'; } my $new_alpha = $Torrus::Renderer::graphStyles{$colorName}{'alpha'}; if( defined($new_alpha) ) { $alpha = $new_alpha; } } } $alpha = '' unless defined($alpha); return ($color . $alpha); } sub mkline { my $self = shift; my $line = shift; if( $line =~ /^\#\#(\S+)$/ ) { my $lineName = $1; $line = $Torrus::Renderer::graphStyles{$lineName}{'line'}; if( not defined( $line ) ) { Error('No line style is defined for ' . $lineName); $line = 'LINE1'; } } return $line; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/Renderer/AdmInfo.pm0000644000175000017500000001732213131663307015410 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::Renderer::AdmInfo; use strict; use warnings; use Torrus::ConfigTree; use Torrus::Log; use Torrus::ACL; use Template; use IO::File; my %rrd_params = ( 'leaf-type' => {'rrd-def' => {'rrd-ds' => undef, 'rrd-cf' => undef, 'data-file' => undef, 'data-dir' => undef}, 'rrd-cdef' => {'rpn-expr' => undef}}, ); my %rrdmulti_params = ( 'ds-names' => undef ); my %collector_params = ( 'storage-type' => {'rrd' => { 'data-file' => undef, 'data-dir' => undef, 'leaf-type' => { 'rrd-def' => {'rrd-ds' => undef, 'rrd-cf' => undef, 'rrd-create-dstype' => undef, 'rrd-create-rra' => undef, 'rrd-create-heartbeat' => undef, 'rrd-hwpredict' => { 'enabled' => {'rrd-create-hw-rralen' => undef}, 'disabled' => undef }}}}}, 'collector-type' => undef, 'collector-period' => undef, 'collector-timeoffset' => undef, 'collector-instance' => undef, 'collector-instance-hashstring' => undef, 'collector-scale' => undef, 'collector-dispersed-timeoffset' => { 'no' => undef, 'yes' => {'collector-timeoffset-min' => undef, 'collector-timeoffset-max' => undef, 'collector-timeoffset-step' => undef, 'collector-timeoffset-hashstring' => undef}} ); my %leaf_params = ('ds-type' => {'rrd-file' => \%rrd_params, 'rrd-multigraph' => \%rrdmulti_params, 'collector' => \%collector_params}, 'rrgraph-views' => undef, 'rrd-scaling-base' => undef, 'graph-logarithmic' => undef, 'graph-rigid-boundaries' => undef, 'graph-ignore-decorations' => undef, 'nodeid' => undef); my %param_categories = ( 'collector-dispersed-timeoffset' => 'Collector', 'collector-period' => 'Collector', 'collector-scale' => 'Collector', 'collector-timeoffset' => 'Collector', 'collector-timeoffset-hashstring' => 'Collector', 'collector-timeoffset-max' => 'Collector', 'collector-timeoffset-min' => 'Collector', 'collector-timeoffset-step' => 'Collector', 'collector-type' => 'Collector', 'collector-instance' => 'Collector', 'collector-instance-hashstring' => 'Collector', 'data-dir' => 'Storage', 'data-file' => 'Storage', 'ds-names' => 'Multigraph', 'ds-type' => 'Common Parameters', 'graph-ignore-decorations' => 'Display', 'graph-logarithmic' => 'Display', 'graph-rigid-boundaries' => 'Display', 'leaf-type' => 'Common Parameters', 'nodeid' => 'Common Parameters', 'rpn-expr' => 'RRD CDEF Paramters', 'rrd-cf' => 'RRD', 'rrd-create-dstype' => 'RRD', 'rrd-create-heartbeat' => 'RRD', 'rrd-create-hw-rralen' => 'RRD', 'rrd-create-rra' => 'RRD', 'rrd-ds' => 'RRD', 'rrd-hwpredict' => 'RRD', 'rrd-scaling-base' => 'RRD', 'rrgraph-views' => 'Display', 'storage-type' => 'Storage' ); # Load additional validation, configurable from # torrus-config.pl and torrus-siteconfig.pl foreach my $mod ( @Torrus::Renderer::loadAdmInfo ) { if( not eval('require ' . $mod) or $@ ) { die( $@ ); } if( not eval('&' . $mod . '::initAdmInfo( \%leaf_params, \%param_categories ); 1;') or $@ ) { die($@); } } # All our methods are imported by Torrus::Renderer; sub render_adminfo { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $outfile = shift; if( $self->may_display_adminfo( $config_tree, $token ) ) { $self->{'adminfo'} = $self->retrieve_adminfo( $config_tree, $token ); my @ret = $self->render_html( $config_tree, $token, $view, $outfile ); delete $self->{'adminfo'}; return @ret; } else { my $fh = IO::File->new($outfile, 'w'); if( not defined($fh) ) { Error("Cannot open $outfile for writing: $!"); return undef; } else { $fh->print("Cannot display admin information\n"); $fh->close(); } return (300+time(), 'text/plain'); } return; } sub may_display_adminfo { my $self = shift; my $config_tree = shift; my $token = shift; if( $config_tree->isLeaf( $token ) ) { # hasPrivilege is imported from Torrus::Renderer::HTML if( $self->hasPrivilege( $config_tree->treeName(), 'DisplayAdmInfo' ) ) { return 1; } } return 0; } sub retrieve_adminfo { my $self = shift; my $config_tree = shift; my $token = shift; my $ret = {}; my @namemaps = ( \%leaf_params ); while( scalar( @namemaps ) > 0 ) { my @next_namemaps = (); foreach my $namemap ( @namemaps ) { foreach my $paramkey ( keys %{$namemap} ) { my $pname = $paramkey; my $pval = $config_tree->getNodeParam( $token, $pname ); if( defined( $pval ) ) { if( ref( $namemap->{$paramkey} ) ) { if( exists $namemap->{$paramkey}->{$pval} ) { if( defined $namemap->{$paramkey}->{$pval} ) { push( @next_namemaps, $namemap->{$paramkey}->{$pval} ); } } } my $category = $param_categories{$pname}; if( not defined( $category ) ) { $category = 'Other'; } $ret->{$category}{$pname} = $pval; } } } @namemaps = @next_namemaps; } return $ret; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/Renderer/Health.pm0000644000175000017500000001246313131663307015301 00000000000000# Copyright (C) 2016 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::Renderer::Health; use strict; use warnings; use Torrus::ConfigTree; use Torrus::Log; use File::Copy; use RRDs; # All our methods are imported by Torrus::Renderer; sub render_health { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $outfile = shift; my $err = sub { return $self->_render_health_error( $config_tree, $token, $view, $outfile); }; my $has_health = $config_tree->getNodeParam($token, 'has-health-status', 1); if( not defined($has_health) or $has_health ne 'yes' ) { my $path = $config_tree->path($token); Error($path . ': has-health-status is not set to yes, cannot display health'); return &{$err}; } my $health_nodeid = $config_tree->getNodeParam($token, 'health-status-nodeid'); if( not defined($health_nodeid) ) { my $path = $config_tree->path($token); Error($path . ': health-status-nodeid is not defined, cannot display health'); return &{$err}; } my $health_token = $config_tree->getNodeByNodeid($health_nodeid); if( not defined($health_token) ) { my $path = $config_tree->path($token); Error($path . ': health-status-nodeid points to an undefined nodeid, ' . 'cannot display health'); return &{$err}; } if( not $config_tree->isLeaf($health_token) ) { my $path = $config_tree->path($health_token); Error($path . ' is referred for health status, but is not a leaf'); return &{$err}; } my $leaftype = $config_tree->getNodeParam($health_token, 'leaf-type'); if( $leaftype ne 'rrd-def' ) { my $path = $config_tree->path($health_token); Error($path . ' is referred for health status, but is not of type rrd-def'); return &{$err}; } my $t_end = time(); my $timespan = $config_tree->getNodeParam($token, 'health-lookup-period'); if( not defined($timespan) ) { $timespan = 900; } my $t_start = $t_end - $timespan; $self->{'options'}->{'variables'}->{'Gstart'} = $t_start; $self->{'options'}->{'variables'}->{'Gend'} = $t_end; my @args; push( @args, $self->rrd_make_opts( $config_tree, $health_token, $view, {'start' => '--start', 'end' => '--end'} ) ); push( @args, $self->rrd_make_def($config_tree, $health_token, 'Aavg', 'AVERAGE') ); push( @args, 'VDEF:D1=Aavg,AVERAGE', 'PRINT:D1:%le' ); # Info('RRDs::graphv arguments: ' . join(' ', @args)); my $r = RRDs::graphv('-', @args); my $ERR=RRDs::error; if( $ERR ) { Error('RRD::graphv returned error: ' . $ERR); return &{$err}; } my $status = 'good'; my $value = $r->{'print[0]'}; # Info("health value: " . $value); if( $value < $config_tree->getNodeParam($token, 'health-level-good') ) { if( $value < $config_tree->getNodeParam( $token, 'health-level-warning') ) { $status = 'critical'; } else { $status = 'warning'; } } my $imgfile = $config_tree->getOtherParam($view, $status . '-img'); # if relative path, the icon is in our default dir if( $imgfile !~ /^\// ) { $imgfile = $Torrus::Global::healthIconsDir . '/' . $imgfile; } if( not -r $imgfile ) { Error("Cannot read the health icon file: " . $imgfile); return undef; } copy($imgfile, $outfile); my $expires = $config_tree->getOtherParam($view, 'expires'); return ($expires+$t_end, 'image/png'); } sub _render_health_error { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $outfile = shift; my $status = 'unknown'; my $imgfile = $config_tree->getOtherParam($view, $status . '-img'); if( not defined($imgfile) ) { return undef; } # if relative path, the icon is in our default dir if( $imgfile !~ /^\// ) { $imgfile = $Torrus::Global::healthIconsDir . '/' . $imgfile; } if( not -r $imgfile ) { Error("Cannot read the health icon file: " . $imgfile); return undef; } copy($imgfile, $outfile); my $expires = $config_tree->getOtherParam($view, 'expires'); return ($expires+time(), 'image/png'); } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/Renderer/RPC.pm0000644000175000017500000003276513131663307014527 00000000000000# Copyright (C) 2011 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::Renderer::RPC; use strict; use warnings; use Torrus::ConfigTree; use Torrus::Log; use RRDs; use JSON (); use IO::File; use Math::BigFloat; # Set to true if you want JSON to be pretty and canonical our $pretty_json; # List of parameters that are always queried our @default_leaf_params; # never return these parameters our %params_blacklist; # make sure we don't pull too much data our $result_limit = 100; my %rpc_methods = ( 'WALK_LEAVES' => { 'call' => \&rpc_walk_leaves, 'needs_params' => 1, }, 'AGGREGATE_DS' => { 'call' => \&rpc_aggregate_ds, }, 'TIMESERIES' => { 'call' => \&rpc_timeseries, }, 'SEARCH_NODEID' => { 'call' => \&rpc_search_nodeid, 'needs_params' => 1, }, ); # All our methods are imported by Torrus::Renderer; sub render_rpc { my $self = shift; my $config_tree = shift; my $token = shift; my $view = shift; my $outfile = shift; my $result = {'success' => 1, 'data' => {}}; my $callproc = $self->{'options'}{'variables'}{'RPCCALL'}; if( not defined $callproc ) { $result->{'success'} = 0; $result->{'error'} = 'Missing RPC call name in RPCCALL'; } elsif( not defined($rpc_methods{$callproc}) ) { $result->{'success'} = 0; $result->{'error'} = 'Unsupported RPC call: ' . $callproc; } # Prepare the list of parameters to retrieve via an RPC call my @params; if( $result->{'success'} and $rpc_methods{$callproc}{'needs_params'} ) { push(@params, @default_leaf_params); my $additional_params = $self->{'options'}{'variables'}{'GET_PARAMS'}; if( defined($additional_params) ) { foreach my $p (split(/\s*,\s*/o, $additional_params)) { if( $params_blacklist{$p} ) { $result->{'success'} = 0; $result->{'error'} = 'Parameter ' . $p . ' is blacklisted'; last; } else { push(@params, $p); } } } } # Process the call if( $result->{'success'} ) { &{$rpc_methods{$callproc}{'call'}} ($self, $config_tree, { 'token' => $token, 'view' => $view, 'params' => \@params, 'result' => $result }); } my $json = new JSON; if( $pretty_json or $self->{'options'}{'variables'}{'PRETTY'}) { $json->pretty; $json->canonical; } my $fh = new IO::File($outfile, 'w'); if( not $fh ) { Error("Error opening $outfile for writing: $!"); return undef; } $fh->binmode(':utf8'); print $fh $json->encode($result); $fh->close; my $expires = $config_tree->getOtherParam($view, 'expires'); return ($expires+time(), 'application/json'); } sub rpc_walk_leaves { my $self = shift; my $config_tree = shift; my $opts = shift; my $token = $opts->{'token'}; my $params = $opts->{'params'}; my $result = $opts->{'result'}; if( scalar(keys %{$result->{'data'}}) > $result_limit ) { $result->{'success'} = 0; $result->{'error'} = 'Result is too big. Aborting the tree walk'; return; } if( $config_tree->isLeaf($token) ) { my $data = {'path' => $config_tree->path($token)}; foreach my $p (@{$params}) { my $val = $config_tree->getNodeParam($token, $p); if( defined($val) ) { $data->{$p} = $val; } } $result->{'data'}{$token} = $data; } elsif( $config_tree->isSubtree($token) ) { foreach my $ctoken ($config_tree->getChildren($token)) { rpc_walk_leaves($self, $config_tree, {'token' => $ctoken, 'params' => $params, 'result' => $result}); } } return; } my @rpc_print_statements = ( { 'name' => 'START', 'args' => ['CDEF:B1=Aavg,POP,TIME', 'VDEF:B2=B1,MINIMUM', 'PRINT:B2:%.0lf'], }, { 'name' => 'END', 'args' => ['CDEF:C1=Aavg,POP,TIME', 'VDEF:C2=C1,MAXIMUM', 'PRINT:C2:%.0lf'], }, { 'name' => 'AVG', 'args' => ['VDEF:D1=Aavg,AVERAGE', 'PRINT:D1:%le'], }, { 'name' => 'AVAIL', 'args' => ['CDEF:F1=Aavg,UN,0,100,IF', 'VDEF:F2=F1,AVERAGE', 'PRINT:F2:%.2lf'], }, ); my @rpc_print_max_statements = ( { 'name' => 'MAX', 'args' => ['VDEF:E1=Amax,MAXIMUM', 'PRINT:E1:%le'], }, ); my %rrd_print_opts = ( 'start' => '--start', 'end' => '--end', ); sub rpc_aggregate_ds { my $self = shift; my $config_tree = shift; my $opts = shift; my $token = $opts->{'token'}; my $view = $opts->{'view'}; my $params = $opts->{'params'}; my $result = $opts->{'result'}; if( not $config_tree->isLeaf($token) ) { $result->{'success'} = 0; $result->{'error'} = 'AGGREGATE_DS method supports only leaf nodes'; return; } if( $config_tree->getNodeParam($token, 'ds-type') eq 'rrd-multigraph' ) { $result->{'success'} = 0; $result->{'error'} = 'AGGREGATE_DS method does not support rrd-multigraph leaves'; return undef; } my $leaftype = $config_tree->getNodeParam($token, 'leaf-type'); if( $leaftype ne 'rrd-def' ) { $result->{'success'} = 0; $result->{'error'} = 'Unsupported leaf-type: ' . $leaftype; return; } my $rra = $config_tree->getNodeParam($token, 'rrd-create-rra'); my $has_max = ($rra =~ /RRA:MAX:/s); my @args; push( @args, $self->rrd_make_opts( $config_tree, $token, $view, \%rrd_print_opts, ) ); push( @args, $self->rrd_make_def($config_tree, $token, 'Aavg', 'AVERAGE') ); if( $has_max ) { push( @args, $self->rrd_make_def($config_tree, $token, 'Amax', 'MAX') ); } my @prints; push( @prints, @rpc_print_statements ); if( $has_max ) { push( @prints, @rpc_print_max_statements ); } foreach my $entry ( @prints ) { push( @args, @{$entry->{'args'}} ); } Debug('RRDs::graphv arguments: ' . join(' ', @args)); my $r = RRDs::graphv('-', @args); my $ERR=RRDs::error; if( $ERR ) { $result->{'success'} = 0; $result->{'error'} = 'RRD::graphv returned error: ' . $ERR; return undef; } my $data = {}; my $i = 0; foreach my $entry ( @prints ) { my $key = 'print[' . $i . ']'; my $val = $r->{$key}; if( not defined($val) ) { $val = 'NaN'; } $data->{$entry->{'name'}} = $val; $i++; } $result->{'data'}{$token} = $data; return; } sub rpc_timeseries { my $self = shift; my $config_tree = shift; my $opts = shift; my $token = $opts->{'token'}; my $view = $opts->{'view'}; my $params = $opts->{'params'}; my $result = $opts->{'result'}; if( not $config_tree->isLeaf($token) ) { $result->{'success'} = 0; $result->{'error'} = 'TIMESERIES supports only leaf nodes'; return; } my @args; foreach my $opt ('step', 'maxrows') { my $value = $self->{'options'}->{'variables'}->{'G' . $opt}; if( defined($value) ) { push(@args, '--' . $opt, $value); } } my $dataonly = $self->{'options'}{'variables'}{'DATAONLY'} ? 1:0; my ($rrgraph_args, $obj) = $self->prepare_rrgraph_args($config_tree, $token, 'embedded', {'data_only' => $dataonly}); Debug('rrgraph_args: ' . join(' ', @{$rrgraph_args})); my @xport_names; my $labels = []; my $title = ''; my $vertical_label = ''; for(my $i=0; $i < scalar(@{$rrgraph_args}); $i++) { my $val = $rrgraph_args->[$i]; if( ($val eq '--start') or ($val eq '--end') ) { $i++; push(@args, $val, $rrgraph_args->[$i]); } elsif( $val =~ /^C?DEF/o ) { push(@args, $val); } elsif( $val =~ /^LINE\d*:([a-zA-Z_][a-zA-Z0-9_]*)/o or $val =~ /^AREA:([a-zA-Z_][a-zA-Z0-9_]*)/o ) { push(@xport_names, $1); if( $val =~ /:([^:\\]+)\\l/o ) { push(@{$labels}, $1); } else { push(@{$labels}, ''); } } elsif( $val eq '--title' ) { $i++; $title = $rrgraph_args->[$i]; } elsif( $val eq '--vertical-label' ) { $i++; $vertical_label = $rrgraph_args->[$i]; } } foreach my $name ( @xport_names ) { push(@args, 'XPORT:' . $name . ':' . $name); } Debug('RRDs::xport arguments: ' . join(' ', @args)); my @xport_ret = RRDs::xport(@args); my $ERR=RRDs::error; if( $ERR ) { $result->{'success'} = 0; $result->{'error'} = 'RRD::xport returned error: ' . $ERR; return undef; } my $r = $result->{'data'}; foreach my $ret_name ('start', 'end', 'step', 'cols', 'names', 'data') { $r->{$ret_name} = shift @xport_ret; } if( not $dataonly ) { # remove --start and --end from rrgraph_args my $i = 0; while( $i < scalar(@{$rrgraph_args}) ) { my $val = $rrgraph_args->[$i]; if( ($val eq '--start') or ($val eq '--end') ) { splice(@{$rrgraph_args}, $i, 2); } else { $i++; } } $r->{'rrgraph_args'} = $rrgraph_args; } $r->{'title'} = $title; $r->{'vertical_label'} = $vertical_label; $r->{'labels'} = $labels; # convert numbers to strings, undefs to NaN, andinfinities to # Infinity and -Infinity for( my $i=0; $i < scalar(@{$r->{'data'}}); $i++ ) { for( my $j=0; $j < scalar(@{$r->{'data'}[$i]}); $j++ ) { my $val = $r->{'data'}[$i][$j]; if( not defined($val) ) { $val = 'NaN'; } else { $val = Math::BigFloat->new($val); if( $val->is_nan() ) { $val = 'NaN'; } elsif( $val->is_inf('+') ) { $val = 'Infinity'; } elsif( $val->is_inf('-') ) { $val = '-Infinity'; } else { $val = $val->bstr(); } } $r->{'data'}[$i][$j] = $val; } } return; } sub rpc_search_nodeid { my $self = shift; my $config_tree = shift; my $opts = shift; my $params = $opts->{'params'}; my $result = $opts->{'result'}; my $search_prefix = $self->{'options'}{'variables'}{'PREFIX'}; if( not defined $search_prefix ) { $result->{'success'} = 0; $result->{'error'} = 'Missing the search prefix in PREFIX'; return; } my $search_results = $config_tree->searchNodeidPrefix($search_prefix); if( not defined($search_results) or scalar(@{$search_results}) == 0 ) { $result->{'data'} = {}; return; } if( scalar(@{$search_results}) > $result_limit ) { $result->{'success'} = 0; $result->{'error'} = 'Result is too big. Aborting the RPC call'; return; } # results are pairs [nodeid,token] foreach my $res ( @{$search_results} ) { my $token = $res->[1]; if( $config_tree->isLeaf($token) ) { my $data = {'path' => $config_tree->path($token)}; foreach my $p (@{$params}) { my $val = $config_tree->getNodeParam($token, $p); if( defined($val) ) { $data->{$p} = $val; } } $result->{'data'}{$token} = $data; } } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/ReportOutput/0000755000175000017500000000000013131663307014536 500000000000000torrus-3.00/lib/Torrus/ReportOutput/HTML.pm0000644000175000017500000001570413131663307015567 00000000000000# Copyright (C) 2005 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::ReportOutput::HTML; use strict; use warnings; use base 'Torrus::ReportOutput'; use Template; use Date::Format; use Torrus::Log; use Torrus::ReportOutput; use Torrus::SiteConfig; our @monthNames = qw (January February March April May June July August September October November December); sub init { my $self = shift; Torrus::SiteConfig::loadStyling(); my $htmldir = $self->{'outdir'} . '/html'; if( not -d $htmldir ) { Verbose('Creating directory: ' . $htmldir); if( not mkdir( $htmldir ) ) { Error('Cannot create directory ' . $htmldir . ': ' . $!); return 0; } } $self->{'htmldir'} = $htmldir; $self->{'tt'} = new Template(INCLUDE_PATH => $Torrus::Global::templateDirs, TRIM => 1); return 1; } # Print the head page and years reference sub genIntroduction { my $self = shift; my $allReports = shift; return $self->render({ 'filename' => $self->indexFilename(), 'template' => 'index', 'data' => $allReports }); } # Print monthly report for a given service ID # The fields argument is a hash of hashes: # serviceid => reportname => month => fieldname => {value, units} sub genSrvIdOutput { my $self = shift; my $year = shift; my $fields = shift; my $ok = 1; while( my( $serviceid, $ref ) = each %{$fields} ) { $ok = $self->render({ 'filename' => $self->srvIdFilename($year, $serviceid), 'template' => 'serviceid', 'data' => $ref, 'serviceid' => $serviceid, 'year' => $year }) ? $ok:0; } return $ok; } # Print daily report -- NOT IMPLEMENTED YET # Fields structure: # day => reportname => serviceid => fieldname => {value, units} sub genDailyOutput { my $self = shift; my $year = shift; my $month = shift; my $fields = shift; return 1; } # Print monthly report # fields: # month => reportname => serviceid => fieldname => {value, units} sub genMonthlyOutput { my $self = shift; my $year = shift; my $fields = shift; my $ok = 1; my @months; while( my( $month, $ref ) = each %{$fields} ) { if( $self->render({ 'filename' => $self->monthlyFilename($year, $month), 'template' => 'monthly', 'data' => $ref, 'year' => $year, 'month' => $month }) ) { push( @months, $month ); } else { $ok = 0; } } my @sorted = sort {$a <=>$b} @months; $ok = $self->render({ 'filename' => $self->yearlyFilename($year), 'template' => 'yearly', 'data' => {'months' => \@sorted}, 'year' => $year }) ? $ok:0; return $ok; } sub indexFilename { return 'index.html'; } sub srvIdFilename { my $self = shift; my $year = shift; my $serviceid = shift; return sprintf('%.4d_serviceid_%s.html', $year, $serviceid); } sub monthlyFilename { my $self = shift; my $year = shift; my $month = shift; return sprintf('%.4d_monthly_%.2d.html', $year, $month); } sub yearlyFilename { my $self = shift; my $year = shift; return sprintf('%.4d_yearly.html', $year); } sub render { my $self = shift; my $opt = shift; my $outfile = $self->{'htmldir'} . '/' . $opt->{'filename'}; my $tmplfile = $Torrus::ReportOutput::HTML::templates{$opt->{'template'}}; Debug('Rendering ' . $outfile . ' from ' . $tmplfile); my $ttvars = { 'plainURL' => $Torrus::Renderer::plainURL, 'style' => sub { return $self->style($_[0]); }, 'treeName' => $self->{'options'}->{'Tree'}, 'companyName'=> $Torrus::Renderer::companyName, 'companyURL' => $Torrus::Renderer::companyURL, 'siteInfo' => $Torrus::Renderer::siteInfo, 'version' => $Torrus::Global::version, 'xmlnorm' => \&xmlnormalize, 'data' => $opt->{'data'}, 'year' => $opt->{'year'}, 'month' => $opt->{'month'}, 'serviceid' => $opt->{'serviceid'}, 'indexUrl' => sub { return $self->reportUrl($self->indexFilename());}, 'srvIdUrl' => sub { return $self->reportUrl($self->srvIdFilename($opt->{'year'}, $_[0]));}, 'monthlyUrl' => sub { return $self->reportUrl($self->monthlyFilename($opt->{'year'}, $_[0]));}, 'yearlyUrl' => sub { return $self->reportUrl($self->yearlyFilename($_[0]));}, 'monthName' => sub {$self->monthName($_[0]);}, 'formatValue' => sub { if( ref($_[0])) { return sprintf('%.2f %s', $_[0]->{'value'}, $_[0]->{'units'}); } else { return 'N/A'; }}, 'timestamp' => sub { return time2str($Torrus::Renderer::timeFormat, time()); }, }; my $result = $self->{'tt'}->process( $tmplfile, $ttvars, $outfile ); if( not $result ) { Error("Error while rendering " . $outfile . ": " . $self->{'tt'}->error()); return 0; } return 1; } sub style { my $self = shift; my $object = shift; my $ret = $Torrus::Renderer::styling{'report'}{$object}; if( not defined( $ret ) ) { $ret = $Torrus::Renderer::styling{'default'}{$object}; } return $ret; } sub monthName { my $self = shift; my $month = shift; return $monthNames[ $month - 1 ]; } sub reportUrl { my $self = shift; my $filename = shift; return $Torrus::Renderer::rendererURL . '/' . $self->{'options'}->{'Tree'} . '?htmlreport=' . $filename; } sub xmlnormalize { my( $txt )= @_; $txt =~ s/\&/\&\;/gm; $txt =~ s/\/\>\;/gm; $txt =~ s/\'/\&apos\;/gm; $txt =~ s/\"/\"\;/gm; return $txt; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/ReportOutput/XLSX.pm0000644000175000017500000001010613131663307015610 00000000000000# Copyright (C) 2016 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin package Torrus::ReportOutput::XLSX; use strict; use warnings; use base 'Torrus::ReportOutput'; use Excel::Writer::XLSX; use Date::Format; use Torrus::Log; use Torrus::ReportOutput; use Torrus::SiteConfig; sub init { my $self = shift; Torrus::SiteConfig::loadStyling(); my $xlsxdir = $self->{'outdir'} . '/xlsx'; if( not -d $xlsxdir ) { Verbose('Creating directory: ' . $xlsxdir); if( not mkdir( $xlsxdir ) ) { Error('Cannot create directory ' . $xlsxdir . ': ' . $!); return 0; } } $self->{'xlsxdir'} = $xlsxdir; return 1; } # Print monthly report # fields: # month => reportname => serviceid => fieldname => {value, units} sub genMonthlyOutput { my $self = shift; my $year = shift; my $fields = shift; my $filename = $self->{'xlsxdir'} . '/monthly_usage.' . $year . '.xlsx'; my $workbook = Excel::Writer::XLSX->new($filename); my $c_tblheader = $workbook->set_custom_color(40, '#003366'); my $f_tblheader = $workbook->add_format ( bold => 1, bottom => 1, align => 'center', bg_color => $c_tblheader, color => 'white' ); my $f_num = $workbook->add_format(num_format => '0.00'); foreach my $month (sort {$b<=>$a} keys %{$fields}) { my $worksheet = $workbook->add_worksheet($year.$month); my $col = 0; my $row = 0; $worksheet->set_column($col, $col, 40); $worksheet->write($row, $col, "Service ID", $f_tblheader); $col++; $worksheet->set_column($col, $col, 25); $worksheet->write($row, $col, "Average, Mbps", $f_tblheader); $col++; $worksheet->set_column($col, $col, 25); $worksheet->write($row, $col, "95th Percentile, Mbps", $f_tblheader); $col++; $worksheet->set_column($col, $col, 25); $worksheet->write($row, $col, "Maximum, Mbps", $f_tblheader); $col++; $worksheet->set_column($col, $col, 25); $worksheet->write($row, $col, "Unavailable samples, %", $f_tblheader); $col++; $worksheet->set_column($col, $col, 25); $worksheet->write($row, $col, "Volume, GB", $f_tblheader); $row++; foreach my $reportName (keys %{$fields->{$month}}) { if( $reportName eq 'MonthlyUsage' ) { my $r = $fields->{$month}{$reportName}; foreach my $serviceid (sort keys %{$r}) { $col=0; $worksheet->write_string($row, $col, $serviceid); $col++; foreach my $varname ('AVG', '95TH_PERCENTILE', 'MAX', 'UNAVAIL', 'VOLUME') { $worksheet->write_number ($row, $col, $r->{$serviceid}{$varname}{'value'}, $f_num); $col++; } $row++; } } } } $workbook->close(); Verbose("Wrote $filename"); return 1; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/ReportOutput.pm0000644000175000017500000001262213131663307015017 00000000000000# Copyright (C) 2005 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Package for generating report output to HTML, PDF, whatever # Media-specific classes should inherit from this package # and package Torrus::ReportOutput; use strict; use warnings; use Torrus::Log; use Torrus::SQL::Reports; use Torrus::ServiceID; sub new { my $class = shift; my $options = shift; my $self = {}; bless ($self, $class); $self->{'options'} = $options; defined( $self->{'options'}->{'Tree'} ) or die('Tree undefined'); my $sqlRep = Torrus::SQL::Reports->new( $options->{'ReportsSqlSubtype'} ); if( not defined( $sqlRep ) ) { Error('Cannot connect to the database'); return undef; } $self->{'backend'} = $sqlRep; my $outdir = $Torrus::Global::reportsDir . '/' . $self->{'options'}->{'Tree'}; $self->{'outdir'} = $outdir; if( not -d $outdir ) { if( not mkdir( $outdir ) ) { Error('Cannot create directory ' . $outdir . ': ' . $!); return undef; } } return $self; } # initialize the subclasses' internals sub init { my $self = shift; return 1; } sub generate { my $self = shift; my $ok = 1; my %monthlyReportNames; my $srvIdList; if( not $self->{'options'}->{'All_Service_IDs'} ) { my $srvId = new Torrus::ServiceID; if( not defined($srvId) ) { die('Cannot initialize a Torrus::ServiceID object'); } $srvIdList = $srvId->getAllForTree( $self->{'options'}->{'Tree'} ); } my $allReports = $self->{'backend'}->getAllReports( $srvIdList ); # frontpage, title, list of years, etc. $self->genIntroduction( $allReports ); while( my( $year, $yearRef ) = each %{$allReports} ) { my $monthlyReportFields = {}; my $srvidMonthlyFields = {}; while( my( $month, $monthRef ) = each %{$yearRef} ) { my $dailyReportFields = {}; while( my( $day, $dayRef ) = each %{$monthRef} ) { while( my( $reportName, $fieldsRef ) = each %{$dayRef} ) { # Check if the report is monthly if( not defined( $monthlyReportNames{$reportName} ) ) { my $class = $Torrus::ReportGenerator::modules{$reportName}; if( not eval('require ' . $class) or $@ ) { die($@); } $monthlyReportNames{$reportName} = $class->isMonthly() ? 1:0; } # This report is monthly -- do not include it in daily # list. if( $monthlyReportNames{$reportName} ) { $monthlyReportFields->{$month}{$reportName} = $fieldsRef; while( my( $serviceid, $fref ) = each %{$fieldsRef} ) { $srvidMonthlyFields->{$serviceid}{$reportName}->{ $month} = $fref; } } else { $dailyReportFields->{$day} = $dayRef; } } } $ok = $self->genDailyOutput( $year, $month, $dailyReportFields )? $ok:0; } $ok = $self->genSrvIdOutput( $year, $srvidMonthlyFields ) ? $ok:0; $ok = $self->genMonthlyOutput( $year, $monthlyReportFields ) ? $ok:0;; } return $ok; } # Print the head page and years reference sub genIntroduction { my $self = shift; my $allReports = shift; return 1; } # Print monthly report for a given service ID # The fields argument is a hash of hashes: # serviceid => reportname => month => fieldname => {value, units} sub genSrvIdOutput { my $self = shift; my $year = shift; my $fields = shift; return 1; } # Print daily report # Fields structure: # day => reportname => serviceid => fieldname => {value, units} sub genDailyOutput { my $self = shift; my $year = shift; my $month = shift; my $fields = shift; return 1; } # Print monthly report # fields: # month => reportname => serviceid => fieldname => {value, units} sub genMonthlyOutput { my $self = shift; my $year = shift; my $fields = shift; return 1; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/Scheduler.pm0000644000175000017500000001637113131663307014246 00000000000000# Copyright (C) 2002-2011 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Task scheduler. # Task object MUST implement two methods: # run() -- the running cycle # whenNext() -- returns the next time it must be run. # See also: Torrus::Scheduler::PeriodicTask class definition # # Options: # -Tree => tree name # -ProcessName => process name and commandline options # -RunOnce => 1 -- this prevents from infinite loop. package Torrus::Scheduler; use strict; use warnings; use Torrus::SchedulerInfo; use Torrus::Log; sub new { my $self = {}; my $class = shift; my %options = @_; bless $self, $class; %{$self->{'options'}} = %options; %{$self->{'data'}} = (); if( not defined( $options{'-Tree'} ) or not defined( $options{'-ProcessName'} ) ) { die(); } $self->{'stats'} = new Torrus::SchedulerInfo( -Tree => $options{'-Tree'}, -WriteAccess => 1 ); return $self; } sub DESTROY { my $self = shift; delete $self->{'stats'}; return; } sub treeName { my $self = shift; return $self->{'options'}{'-Tree'}; } sub setProcessStatus { my $self = shift; my $text = shift; $0 = $self->{'options'}{'-ProcessName'} . ' [' . $text . ']'; return; } sub addTask { my $self = shift; my $task = shift; my $when = shift; if( not defined $when ) { $when = $task->whenNext(); } $self->storeTask( $task, $when ); $self->{'stats'}->clearStats( $task->id() ); return; } sub storeTask { my $self = shift; my $task = shift; my $when = shift; if( not defined( $self->{'tasks'}{$when} ) ) { $self->{'tasks'}{$when} = []; } push( @{$self->{'tasks'}{$when}}, $task ); return; } sub flushTasks { my $self = shift; if( defined( $self->{'tasks'} ) ) { foreach my $when ( keys %{$self->{'tasks'}} ) { foreach my $task ( @{$self->{'tasks'}{$when}} ) { $self->{'stats'}->clearStats( $task->id() ); } } delete $self->{'tasks'}; } return; } sub run { my $self = shift; my $stop = 0; while( not $stop ) { $self->setProcessStatus('initializing scheduler'); while( not $self->beforeRun() ) { Error('Scheduler initialization error. Sleeping ' . $Torrus::Scheduler::failedInitSleep . ' seconds'); sleep($Torrus::Scheduler::failedInitSleep); } $self->setProcessStatus(''); my $nextRun = time() + 3600; foreach my $when ( keys %{$self->{'tasks'}} ) { # We have 1-second rounding error if( $when <= time() + 1 ) { foreach my $task ( @{$self->{'tasks'}{$when}} ) { my $startTime = time(); $self->beforeTaskRun( $task, $startTime, $when ); $task->beforeRun( $self->{'stats'} ); $self->setProcessStatus('running'); $task->run(); $task->afterRun( $self->{'stats'}, $startTime ); $self->afterTaskRun( $task, $startTime ); my $whenNext = $task->whenNext(); if( $whenNext > 0 ) { if( $whenNext == $when ) { Error("Incorrect time returned by task"); } $self->storeTask( $task, $whenNext ); if( $nextRun > $whenNext ) { $nextRun = $whenNext; } } } delete $self->{'tasks'}{$when}; } elsif( $nextRun > $when ) { $nextRun = $when; } } if( $self->{'options'}{'-RunOnce'} or ( scalar( keys %{$self->{'tasks'}} ) == 0 and not $self->{'options'}{'-RunAlways'} ) ) { $self->setProcessStatus(''); $stop = 1; } else { if( scalar( keys %{$self->{'tasks'}} ) == 0 ) { Info('Tasks list is empty. Will sleep until ' . scalar(localtime($nextRun))); } $self->setProcessStatus('sleeping'); Debug('We will sleep until ' . scalar(localtime($nextRun))); if( $Torrus::Scheduler::maxSleepTime > 0 ) { Debug('This is a VmWare-like clock. We devide the sleep ' . 'interval into small pieces'); while( time() < $nextRun ) { my $sleep = $nextRun - time(); if( $sleep > $Torrus::Scheduler::maxSleepTime ) { $sleep = $Torrus::Scheduler::maxSleepTime; } Debug('Sleeping ' . $sleep . ' seconds'); sleep( $sleep ); } } else { my $sleep = $nextRun - time(); if( $sleep > 0 ) { sleep( $sleep ); } } } } return; } # A method to override by ancestors. Executed every time before the # running cycle. Must return true value when finishes. sub beforeRun { my $self = shift; Debug('Torrus::Scheduler::beforeRun() - doing nothing'); return 1; } sub beforeTaskRun { my $self = shift; my $task = shift; my $startTime = shift; my $plannedStartTime = shift; if( (not $task->didNotRun()) and $task->initialized() and $startTime > $plannedStartTime + 1 ) { my $late = $startTime - $plannedStartTime; Verbose(sprintf('Task delayed %d seconds', $late)); $self->{'stats'}->setStatsValues( $task->id(), 'LateStart', $late ); } return; } sub afterTaskRun { my $self = shift; my $task = shift; my $startTime = shift; my $len = time() - $startTime; Verbose(sprintf('%s task finished in %d seconds', $task->name(), $len)); $self->{'stats'}->setStatsValues( $task->id(), 'RunningTime', $len ); return; } # User data can be stored here sub data { my $self = shift; return $self->{'data'}; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover.pm0000644000175000017500000005563513131663307014553 00000000000000# Copyright (C) 2002-2011 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Core SNMP device discovery module package Torrus::DevDiscover; use strict; use warnings; use POSIX qw(strftime); use Net::SNMP qw(:snmp :asn1); use Digest::MD5 qw(md5); use Torrus::DevDiscover::DevDetails; use Torrus::Log; BEGIN { foreach my $mod ( @Torrus::DevDiscover::loadModules ) { if( not eval('require ' . $mod) or $@ ) { die($@); } } } # Callback registry to inizialise multithreading before any threads are spawned our %threading_init_callbacks; # Callback registry to report discovery failures our %discovery_failed_callbacks; # Custom overlays for templates # overlayName -> # 'Module::templateName' -> { 'name' => 'templateName', # 'source' => 'filename.xml' } our %templateOverlays; our @requiredParams = ( 'snmp-port', 'snmp-version', 'snmp-timeout', 'snmp-retries', 'data-dir', 'snmp-host' ); our %defaultParams; $defaultParams{'rrd-hwpredict'} = 'no'; $defaultParams{'domain-name'} = ''; $defaultParams{'host-subtree'} = ''; $defaultParams{'snmp-check-sysuptime'} = 'yes'; $defaultParams{'show-recursive'} = 'yes'; $defaultParams{'snmp-ipversion'} = '4'; $defaultParams{'snmp-transport'} = 'udp'; $defaultParams{'snmp-maxrepetitions'} = 10; our @copyParams = ( 'collector-period', 'collector-timeoffset', 'collector-dispersed-timeoffset', 'collector-timeoffset-min', 'collector-timeoffset-max', 'collector-timeoffset-step', 'comment', 'domain-name', 'monitor-period', 'monitor-timeoffset', 'nodeid-device', 'rrd-create-rra', 'show-recursive', 'snmp-host', 'snmp-port', 'snmp-localaddr', 'snmp-localport', 'snmp-ipversion', 'snmp-transport', 'snmp-community', 'snmp-version', 'snmp-username', 'snmp-contextname', 'snmp-authkey', 'snmp-authpassword', 'snmp-authprotocol', 'snmp-privkey', 'snmp-privpassword', 'snmp-privprotocol', 'snmp-timeout', 'snmp-retries', 'snmp-oids-per-pdu', 'snmp-check-sysuptime', 'snmp-max-msg-size', 'snmp-maxrepetitions', 'snmp-reachability-rra', 'system-id' ); %Torrus::DevDiscover::oiddef = ( 'system' => '1.3.6.1.2.1.1', 'sysDescr' => '1.3.6.1.2.1.1.1.0', 'sysObjectID' => '1.3.6.1.2.1.1.2.0', 'sysUpTime' => '1.3.6.1.2.1.1.3.0', 'sysContact' => '1.3.6.1.2.1.1.4.0', 'sysName' => '1.3.6.1.2.1.1.5.0', 'sysLocation' => '1.3.6.1.2.1.1.6.0' ); my @systemOIDs = ('sysDescr', 'sysObjectID', 'sysUpTime', 'sysContact', 'sysName', 'sysLocation'); sub new { my $self = {}; my $class = shift; my %options = @_; bless $self, $class; $self->{'oiddef'} = {}; $self->{'oidrev'} = {}; # Combine all %MODULE::oiddef hashes into one foreach my $module ( 'Torrus::DevDiscover', @Torrus::DevDiscover::loadModules ) { my $oiddef_ref = eval('\%'.$module.'::oiddef'); die($@) if $@; if( ref($oiddef_ref) ) { while( my($name, $oid) = each %{$oiddef_ref} ) { $self->{'oiddef'}->{$name} = $oid; $self->{'oidrev'}->{$oid} = $name; } } } $self->{'datadirs'} = {}; $self->{'globalData'} = {}; return $self; } sub globalData { my $self = shift; return $self->{'globalData'}; } sub discover { my $self = shift; my @paramhashes = @_; my $devdetails = new Torrus::DevDiscover::DevDetails(); foreach my $params ( \%defaultParams, @paramhashes ) { $devdetails->setParams( $params ); } foreach my $param ( @requiredParams ) { if( not defined( $devdetails->param( $param ) ) ) { Error('Required parameter not defined: ' . $param); return 0; } } my %snmpargs; my $community; my $version = $devdetails->param( 'snmp-version' ); $snmpargs{'-version'} = $version; foreach my $arg ( qw(-port -localaddr -localport -timeout -retries) ) { if( defined( $devdetails->param( 'snmp' . $arg ) ) ) { $snmpargs{$arg} = $devdetails->param( 'snmp' . $arg ); } } $snmpargs{'-domain'} = $devdetails->param('snmp-transport') . '/ipv' . $devdetails->param('snmp-ipversion'); if( $version eq '1' or $version eq '2c' ) { $community = $devdetails->param( 'snmp-community' ); if( not defined( $community ) ) { Error('Required parameter not defined: snmp-community'); return 0; } $snmpargs{'-community'} = $community; my $maxmsgsize = $devdetails->param('snmp-max-msg-size'); if( defined( $maxmsgsize ) ) { $snmpargs{'-maxmsgsize'} = $maxmsgsize; } } elsif( $version eq '3' ) { foreach my $arg ( qw(-username -authkey -authpassword -authprotocol -privkey -privpassword -privprotocol) ) { if( defined $devdetails->param( 'snmp' . $arg ) ) { $snmpargs{$arg} = $devdetails->param( 'snmp' . $arg ); } } $community = $snmpargs{'-username'}; if( not defined( $community ) ) { Error('Required parameter not defined: snmp-user'); return 0; } } else { Error('Illegal value for snmp-version parameter: ' . $version); return 0; } my $hostname = $devdetails->param('snmp-host'); my $domain = $devdetails->param('domain-name'); if( $domain and index($hostname, '.') < 0 and index($hostname, ':') < 0 ) { $hostname .= '.' . $domain; } $snmpargs{'-hostname'} = $hostname; my $port = $snmpargs{'-port'}; my $time_start = time(); Debug('Discovering host: ' . $hostname . ':' . $port . ':' . $community); my ($session, $error) = Net::SNMP->session( %snmpargs, -nonblocking => 0, -translate => ['-all', 0, '-octetstring', 1] ); if( not defined($session) ) { Error('Cannot create SNMP session: ' . $error); return undef; } my $contextname = $devdetails->param('snmp-contextname'); if( defined($contextname) and $contextname ne '' ) { # dirty hack: this is a private method in Net::SNMP $session->_context_name($contextname); } my @oids = (); foreach my $var ( @systemOIDs ) { push( @oids, $self->oiddef( $var ) ); } # This is the only checking if the remote agent is alive my $result = $session->get_request( -varbindlist => \@oids ); if( defined $result ) { $devdetails->storeSnmpVars( $result ); } else { # When the remote agent is reacheable, but system objecs are # not implemented, we get a positive error_status if( $session->error_status() == 0 ) { Error("Unable to communicate with SNMP agent on " . $hostname . ':' . $port . ':' . $community . " - " . $session->error()); return undef; } } my $data = $devdetails->data(); $data->{'param'} = {}; $data->{'templates'} = []; push( @{$data->{'templates'}}, split( /\s*,\s*/, $devdetails->paramString('custom-host-templates') ) ); # Build host-level legend my %legendValues = ( 10 => { 'name' => 'Location', 'value' => $devdetails->snmpVar($self->oiddef('sysLocation')) }, 20 => { 'name' => 'Contact', 'value' => $devdetails->snmpVar($self->oiddef('sysContact')) }, 30 => { 'name' => 'System ID', 'value' => $devdetails->param('system-id') }, 50 => { 'name' => 'Description', 'value' => $devdetails->snmpVar($self->oiddef('sysDescr')) } ); my $legend = ''; foreach my $key ( sort keys %legendValues ) { my $text = $legendValues{$key}{'value'}; if( defined($text) and $text ne '' ) { $text = $devdetails->screenSpecialChars( $text ); $legend .= $legendValues{$key}{'name'} . ':' . $text . ';'; } } if( $devdetails->paramDisabled('suppress-legend') ) { $data->{'param'}{'legend'} = $legend; } # some parameters need just one-to-one copying my @hostCopyParams = split('\s*,\s*', $devdetails->paramString('host-copy-params')); foreach my $param ( @copyParams, @hostCopyParams ) { my $val = $devdetails->param( $param ); if( defined($val) ) { $data->{'param'}{$param} = $val; } } # If snmp-host is ipv6 address, system-id needs to be adapted to # remove colons if( not defined( $data->{'param'}{'system-id'} ) and index($data->{'param'}{'snmp-host'}, ':') >= 0 ) { my $systemid = $data->{'param'}{'snmp-host'}; $systemid =~ s/:/_/g; $data->{'param'}{'system-id'} = $systemid; } if( not defined( $devdetails->snmpVar($self->oiddef('sysUpTime')) ) ) { Debug('Agent does not support sysUpTime'); $data->{'param'}{'snmp-check-sysuptime'} = 'no'; } $data->{'param'}{'data-dir'} = $self->genDataDir( $devdetails->param('data-dir'), $hostname ); # Register the directory for listDataDirs() $self->{'datadirs'}{$devdetails->param('data-dir')} = 1; $self->{'session'} = $session; $self->{'maxrepetitions'} = $devdetails->param('snmp-maxrepetitions'); # some discovery modules need to be disabled on per-device basis my %onlyDevtypes; my $useOnlyDevtypes = 0; foreach my $devtype ( split('\s*,\s*', $devdetails->paramString('only-devtypes') ) ) { $onlyDevtypes{$devtype} = 1; $useOnlyDevtypes = 1; } my %disabledDevtypes; foreach my $devtype ( split('\s*,\s*', $devdetails->paramString('disable-devtypes') ) ) { $disabledDevtypes{$devtype} = 1; } # 'checkdevtype' procedures for each known device type return true # when it's their device. They also research the device capabilities. my $reg = \%Torrus::DevDiscover::registry; foreach my $devtype ( sort {$reg->{$a}{'sequence'} <=> $reg->{$b}{'sequence'}} keys %{$reg} ) { if( ( not $useOnlyDevtypes or $onlyDevtypes{$devtype} ) and not $disabledDevtypes{$devtype} and &{$reg->{$devtype}{'checkdevtype'}}($self, $devdetails) ) { $devdetails->setDevType( $devtype ); Debug('Found device type: ' . $devtype); } } my @devtypes = sort { my $x = $reg->{$a}{'sequence'} <=> $reg->{$b}{'sequence'}; if( $x == 0 ) { return $a cmp $b; } else { return $x; } } $devdetails->getDevTypes(); $data->{'param'}{'devdiscover-devtypes'} = join(',', @devtypes); $data->{'param'}{'devdiscover-nodetype'} = '::device'; # Do the detailed discovery and prepare data my $ok = 1; foreach my $devtype ( @devtypes ) { $ok = &{$reg->{$devtype}{'discover'}}($self, $devdetails) ? $ok:0; } delete $self->{'session'}; $session->close(); $devdetails->applySelectors(); my $subtree = $devdetails->param('host-subtree'); if( not defined( $self->{'devdetails'}{$subtree} ) ) { $self->{'devdetails'}{$subtree} = []; } push( @{$self->{'devdetails'}{$subtree}}, $devdetails ); foreach my $pair ( split(/\s*;\s*/, $devdetails->paramString('define-tokensets') ) ) { my( $tset, $description ) = split( /\s*:\s*/, $pair ); my $params = {}; if( $tset !~ /^[a-z][a-z0-9-_]*$/ ) { Error('Invalid name for tokenset: ' . $tset); $ok = 0; } elsif( not defined($description) or $description eq '' ) { Error('Missing description for tokenset: ' . $tset); $ok = 0; } else { $params->{'comment'} = $description; } my $v = $devdetails->param($tset . '-tokenset-rrgraph-view'); if( defined($v) ) { $params->{'rrgraph-view'} = $v; } if( $ok ) { $self->{'define-tokensets'}{$tset} = $params; } } Verbose('Discovery for ' . $hostname . ' finished in ' . (time() - $time_start) . ' seconds'); return $ok; } sub buildConfig { my $self = shift; my $cb = shift; my $reg = \%Torrus::DevDiscover::registry; foreach my $subtree ( sort keys %{$self->{'devdetails'}} ) { # Chop the first and last slashes my $path = $subtree; $path =~ s/^\///; $path =~ s/\/$//; # generate subtree path XML my $subtreeNode = undef; foreach my $subtreeName ( split( '/', $path ) ) { $subtreeNode = $cb->addSubtree( $subtreeNode, $subtreeName ); } foreach my $devdetails ( sort {$a->param('snmp-host') cmp $b->param('snmp-host')} @{$self->{'devdetails'}{$subtree}} ) { my $data = $devdetails->data(); my @registryOverlays = (); if( defined( $devdetails->param('template-registry-overlays' ) ) ) { my @overlayNames = split(/\s*,\s*/, $devdetails->param('template-registry-overlays' )); foreach my $overlayName ( @overlayNames ) { if( defined( $templateOverlays{$overlayName}) ) { push( @registryOverlays, $templateOverlays{$overlayName} ); } else { Error('Cannot find the template overlay named ' . $overlayName); } } } # we should call this anyway, in order to flush the overlays # set by previous host $cb->setRegistryOverlays( @registryOverlays ); my $reachabilityStatsEnabled = 0; if( $devdetails->paramEnabled('disable-snmpcollector' ) ) { push( @{$data->{'templates'}}, '::viewonly-defaults' ); } else { push( @{$data->{'templates'}}, '::snmp-defaults' ); if( $devdetails->paramDisabled('disable-reachability-stats') and ( (not defined($devdetails->param('only-devtypes'))) or $devdetails->paramEnabled('enable-reachability-stats') ) ) { push( @{$data->{'templates'}}, '::snmp-reachability' ); $reachabilityStatsEnabled = 1; } } if( $devdetails->paramEnabled('rrd-hwpredict' ) ) { push( @{$data->{'templates'}}, '::holt-winters-defaults' ); } my $devNodeName = $devdetails->paramString('symbolic-name'); if( $devNodeName eq '' ) { $devNodeName = $devdetails->paramString('system-id'); if( $devNodeName eq '' ) { $devNodeName = $devdetails->param('snmp-host'); } } my $devNode = $cb->addSubtree( $subtreeNode, $devNodeName, $data->{'param'}, $data->{'templates'} ); if( $reachabilityStatsEnabled ) { my $reachabilityMonitor = $devdetails->param('reachability-monitor'); if( defined($reachabilityMonitor) ) { $cb->addLeaf( $devNode, 'Device_Reachability', {'monitor' => $reachabilityMonitor} ); } } foreach my $alias ( split( '\s*,\s*', $devdetails->paramString('host-aliases') ) ) { $cb->addAlias( $devNode, $alias ); } foreach my $file ( split( '\s*,\s*', $devdetails->paramString('include-files') ) ) { $cb->addFileInclusion( $file ); } # Let the device type-specific modules add children # to the subtree foreach my $devtype ( sort {$reg->{$a}{'sequence'} <=> $reg->{$b}{'sequence'}} $devdetails->getDevTypes() ) { &{$reg->{$devtype}{'buildConfig'}} ( $devdetails, $cb, $devNode, $self->{'globalData'} ); } $cb->{'statistics'}{'hosts'}++; } } foreach my $devtype ( sort {$reg->{$a}{'sequence'} <=> $reg->{$b}{'sequence'}} keys %{$reg} ) { if( defined( $reg->{$devtype}{'buildGlobalConfig'} ) ) { &{$reg->{$devtype}{'buildGlobalConfig'}}($cb, $self->{'globalData'}); } } if( defined( $self->{'define-tokensets'} ) ) { my $tsetsNode = $cb->startTokensets(); foreach my $tset ( sort keys %{$self->{'define-tokensets'}} ) { $cb->addTokenset( $tsetsNode, $tset, $self->{'define-tokensets'}{$tset} ); } } return; } sub session { my $self = shift; return $self->{'session'}; } sub oiddef { my $self = shift; my $var = shift; my $ret = $self->{'oiddef'}->{$var}; if( not $ret ) { Error('Undefined OID definition: ' . $var); } return $ret; } sub oidref { my $self = shift; my $oid = shift; return $self->{'oidref'}->{$oid}; } sub genDataDir { my $self = shift; my $basedir = shift; my $hostname = shift; if( $Torrus::DevDiscover::hashDataDirEnabled ) { return $basedir . '/' . sprintf( $Torrus::DevDiscover::hashDataDirFormat, unpack('N', md5($hostname)) % $Torrus::DevDiscover::hashDataDirBucketSize ); } else { return $basedir; } } sub listDataDirs { my $self = shift; my @basedirs = keys %{$self->{'datadirs'}}; my @ret = @basedirs; if( $Torrus::DevDiscover::hashDataDirEnabled ) { foreach my $basedir ( @basedirs ) { for( my $i = 0; $i < $Torrus::DevDiscover::hashDataDirBucketSize; $i++ ) { push( @ret, $basedir . '/' . sprintf( $Torrus::DevDiscover::hashDataDirFormat, $i ) ); } } } return @ret; } ## # Check if SNMP table is present, without retrieving the whole table sub checkSnmpTable { my $self = shift; my $oidname = shift; my $session = $self->session(); my $oid = $self->oiddef( $oidname ); my $result = $session->get_next_request( -varbindlist => [ $oid ] ); if( defined( $result ) ) { # check if the returned oid shares the base of the query my $firstOid = (keys %{$result})[0]; if( Net::SNMP::oid_base_match( $oid, $firstOid ) ) { return 1; } } return 0; } ## # walk through the table, and return a hashref with index->value content sub walkSnmpTable { my $self = shift; my $oidname = shift; my $session = $self->session(); my $base = $self->oiddef( $oidname ); my @arg = ( -baseoid => $base ); if( $session->version() > 0 ) { push(@arg, -maxrepetitions => $self->{'maxrepetitions'}); } my $table = $session->get_table( @arg ); if( not defined($table) ) { return {}; } my $prefixLen = length( $base ) + 1; my $ret = {}; while( my( $oid, $value ) = each %{$table} ) { my $INDEX = substr( $oid, $prefixLen ); $ret->{$INDEX} = $value; } return $ret; } ## # Check if given OID is present sub checkSnmpOID { my $self = shift; my $oidname = shift; my $session = $self->session(); my $oid = $self->oiddef( $oidname ); my $result = $session->get_request( -varbindlist => [ $oid ] ); if( $session->error_status() == 0 and defined($result) and defined($result->{$oid}) and $result->{$oid} ne '' ) { return 1; } return 0; } ## # retrieve the given OIDs by names and return hash with values # if the agent returns noSuchObject, the corresponding hash values # are empty strings sub retrieveSnmpOIDs { my $self = shift; my @oidnames = @_; my $session = $self->session(); my $oids = []; foreach my $oidname ( @oidnames ) { push( @{$oids}, $self->oiddef( $oidname ) ); } my $result = $session->get_request( -varbindlist => $oids ); if( $session->error_status() == 0 and defined( $result ) ) { my $ret = {}; foreach my $oidname ( @oidnames ) { $ret->{$oidname} = $result->{$self->oiddef( $oidname )}; } return $ret; } return undef; } ## # Simple wrapper for Net::SNMP::oid_base_match sub oidBaseMatch { my $self = shift; my $base_oid = shift; my $oid = shift; if( not defined($oid) ) { return undef; } if( $base_oid =~ /^\D/ ) { $base_oid = $self->oiddef( $base_oid ); } return Net::SNMP::oid_base_match( $base_oid, $oid ); } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/SQL/0000755000175000017500000000000013131663307012501 500000000000000torrus-3.00/lib/Torrus/SQL/Reports.pm0000644000175000017500000001260013131663307014414 00000000000000# Copyright (C) 2005 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Class for Reporter data manipulation package Torrus::SQL::Reports; use strict; use warnings; use Torrus::SQL; use base 'Torrus::SQL'; use Torrus::SQL::ReportFields; use Torrus::Log; # The name of the table and columns # defaults configured in torrus-config.pl our $tableName; our %columns; sub new { my $class = shift; my $subtype = shift; my $self = $class->SUPER::new( $subtype ); $self->{'fields'} = Torrus::SQL::ReportFields->new( $subtype ); bless ($self, $class); return $self; } # Find or create a new row in reports table # sub reportId { my $self = shift; my $repdate = shift; my $reptime = shift; my $repname = shift; my $result = $self->{'sql'}->select_one_to_arrayref({ 'fields' => [ $columns{'id'}, $columns{'iscomplete'} ], 'table' => $tableName, 'where' => { $columns{'rep_date'} => $repdate, $columns{'rep_time'} => $reptime, $columns{'reportname'} => $repname } }); if( defined( $result ) ) { if( not $result->[1] ) { # iscomplete is zero - the report is unfinished Warn('Found unfinished report ' . $repname . ' for ' . $repdate . ' ' . $reptime . '. Deleting the previous report data'); $self->{'fields'}->removeAll( $result->[0] ); } return $result->[0]; } else { my $id = $self->sequenceNext(); $self->{'sql'}->insert({ 'table' => $tableName, 'fields' => { $columns{'id'} => $id, $columns{'rep_date'} => $repdate, $columns{'rep_time'} => $reptime, $columns{'reportname'} => $repname, $columns{'iscomplete'} => 0 } }); return $id; } } # Add a new field to a report. The field is a hash array reference # with keys: 'name', 'serviceid', 'value', 'units' sub addField { my $self = shift; my $reportId = shift; my $field = shift; if( isDebug() ) { Debug('Adding report field: ' . $field->{'name'} . ':' . $field->{'serviceid'} . ' = ' . $field->{'value'} . ' ' . $field->{'units'}); } $self->{'fields'}->add( $reportId, $field ); return; } sub getFields { my $self = shift; my $reportId = shift; return $self->{'fields'}->getAll( $reportId ); } sub isComplete { my $self = shift; my $reportId = shift; my $result = $self->{'sql'}->select_one_to_arrayref({ 'fields' => [ $columns{'iscomplete'} ], 'table' => $tableName, 'where' => { $columns{'id'} => $reportId } }); if( defined( $result ) ) { return $result->[0]; } else { Error('Cannot find the report record for ID=' . $reportId); } return 0; } sub finalize { my $self = shift; my $reportId = shift; $self->{'sql'}->update({ 'table' => $tableName, 'where' => { $columns{'id'} => $reportId }, 'fields' => { $columns{'iscomplete'} => 1 } }); $self->{'sql'}->commit(); return; } sub getAllReports { my $self = shift; my $srvIdList = shift; my $limitDate = shift; my $where = { $columns{'iscomplete'} => 1 }; if( defined( $limitDate ) ) { $where->{$columns{'rep_date'}} = ['>=', $limitDate]; } $self->{'sql'}->select({ 'table' => $tableName, 'where' => $where, 'fields' => [ $columns{'id'}, $columns{'rep_date'}, $columns{'rep_time'}, $columns{'reportname'} ] }); my $reports = $self->fetchall([ 'id', 'rep_date', 'rep_time', 'reportname' ]); my $ret = {}; foreach my $report ( @{$reports} ) { my($year, $month, $day) = split('-', $report->{'rep_date'}); my $fields = $self->getFields( $report->{'id'} ); my $fieldsref = {}; foreach my $field ( @{$fields} ) { if( not ref( $srvIdList ) or grep {$field->{'serviceid'} eq $_} @{$srvIdList} ) { $fieldsref->{$field->{'serviceid'}}->{$field->{'name'}} = { 'value' => $field->{'value'}, 'units' => $field->{'units'} }; } } $ret->{$year}{$month}{$day}{$report->{'reportname'}} = $fieldsref; } return $ret; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/SQL/ReportFields.pm0000644000175000017500000000453213131663307015365 00000000000000# Copyright (C) 2005 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin ## Class for report fields table package Torrus::SQL::ReportFields; use strict; use warnings; use base 'Torrus::SQL'; use Torrus::Log; # The name of the table and columns # defaults configured in torrus-config.pl our $tableName; our %columns; sub add { my $self = shift; my $reportId = shift; my $attrs = shift; my $id = $self->sequenceNext(); $self->{'sql'}->insert({ 'table' => $tableName, 'fields' => { $columns{'id'} => $id, $columns{'rep_id'} => $reportId, $columns{'name'} => $attrs->{'name'}, $columns{'serviceid'} => $attrs->{'serviceid'}, $columns{'value'} => $attrs->{'value'}, $columns{'units'} => $attrs->{'units'} } }); return; } sub getAll { my $self = shift; my $reportId = shift; $self->{'sql'}->select({ 'table' => $tableName, 'where' => { $columns{'rep_id'} => $reportId }, 'fields' => [ $columns{'name'}, $columns{'serviceid'}, $columns{'value'}, $columns{'units'}] }); return $self->fetchall([ 'name', 'serviceid', 'value', 'units' ]); } sub removeAll { my $self = shift; my $reportId = shift; $self->{'sql'}->delete({ 'table' => $tableName, 'where' => { $columns{'rep_id'} => $reportId }}); return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/SQL/SrvExport.pm0000644000175000017500000000543113131663307014736 00000000000000# Copyright (C) 2005 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Class for Collector's external storage export data manipulation. package Torrus::SQL::SrvExport; use strict; use warnings; use Torrus::SQL; use base 'Torrus::SQL'; use Torrus::Log; # The name of the table and columns where the collector export is stored # defaults configured in torrus-config.pl our $tableName; our %columns; sub sqlInsertStatement { return sprintf('INSERT INTO %s (%s,%s,%s,%s,%s) VALUES (?,?,?,?,?)', $tableName, $columns{'srv_date'}, $columns{'srv_time'}, $columns{'serviceid'}, $columns{'value'}, $columns{'intvl'}); } sub getServiceIDs { my $self = shift; $self->{'sql'}->select({ 'fields' => [ $columns{'serviceid'} ], 'table' => $tableName, 'group' => [ $columns{'serviceid'} ], 'order' => [ $columns{'serviceid'} ] }); my $ret = []; while( defined( my $row = $self->{'sql'}->fetchrow_arrayref() ) ) { push( @{$ret}, $row->[0] ); } return $ret; } # YYYY-MM-DD for start and end date # returns the reference to the array of hashes for selected entries. sub getIntervalData { my $self = shift; my $startdate = shift; my $enddate = shift; my $serviceid = shift; $self->{'sql'}->select({ 'fields' => [ $columns{'srv_date'}, $columns{'srv_time'}, $columns{'value'}, $columns{'intvl'} ], 'table' => $tableName, 'where' => [ {$columns{'serviceid'} => $serviceid}, 'AND', {$columns{'srv_date'} => ['>=', $startdate]}, 'AND', {$columns{'srv_date'} => ['<', $enddate]} ]}); return $self->fetchall([ 'srv_date', 'srv_time', 'value', 'intvl' ]); } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DataAccess.pm0000644000175000017500000002065613131663307014324 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # this policy is paranoic about our read() method ## no critic (Subroutines::ProhibitBuiltinHomonyms) package Torrus::DataAccess; use strict; use warnings; use Torrus::ConfigTree; use Torrus::Log; use Torrus::RPN; use RRDs; # The Torrus::DataAccess object contains cached values, and it does not # check the cache validity. We assume that a Torrus::DataAccess object # lifetime is within a short period of time, such as one monitor cycle. sub new { my $self = {}; my $class = shift; bless $self, $class; return $self; } # Read the data from datasource file, depending on its type. # If time is not specified, reads the latest available data. # In case of rrd-cdef leaf type, the returned timestamp is the # earliest timestamp of the data sources involved. # # ($value, $timestamp) = $da->read( $config_tree, $leaf_token ) # # ($value, $timestamp) = $da->read( $config_tree, $leaf_token, $end_time ) # # ($value, $timestamp) = $da->read( $config_tree, $leaf_token, # $end_time, $start_time ) sub read { my $self = shift; my $config_tree = shift; my $token = shift; my $t_end = shift; my $t_start = shift; my $cachekey = $token . ':' . (defined($t_end)?$t_end:'') . ':' . (defined($t_start)?$t_start:''); if( exists( $self->{'cache_read'}{$cachekey} ) ) { return @{$self->{'cache_read'}{$cachekey}}; } if( not $config_tree->isLeaf( $token ) ) { my $path = $config_tree->path( $token ); Error("Torrus::DataAccess::readLast: $path is not a leaf"); return undef; } my $ret_val; my $ret_time; my $ds_type = $config_tree->getNodeParam( $token, 'ds-type' ); if( $ds_type eq 'rrd-file' or $ds_type eq 'collector' ) { my $leaf_type = $config_tree->getNodeParam( $token, 'leaf-type' ); if( $leaf_type eq 'rrd-def' ) { my $file = $config_tree->getNodeParam( $token, 'data-file' ); my $dir = $config_tree->getNodeParam( $token, 'data-dir' ); my $ds = $config_tree->getNodeParam( $token, 'rrd-ds' ); my $cf = $config_tree->getNodeParam( $token, 'rrd-cf' ); ( $ret_val, $ret_time ) = $self->read_RRD_DS( $dir.'/'.$file, $cf, $ds, $t_end, $t_start ); } elsif( $leaf_type eq 'rrd-cdef' ) { my $expr = $config_tree->getNodeParam( $token, 'rpn-expr' ); ( $ret_val, $ret_time ) = $self->read_RPN( $config_tree, $token, $expr, $t_end, $t_start ); } else { my $path = $config_tree->path( $token ); Error("$path: leaf-type $leaf_type is not supported ". "for data access"); } } else { my $path = $config_tree->path( $token ); Error("$path: ds-type $ds_type is not supported ". "for data access"); } $self->{'cache_read'}{$cachekey} = [ $ret_val, $ret_time ]; return ( $ret_val, $ret_time ); } sub read_RRD_DS { my $self = shift; my $filename = shift; my $cf = shift; my $ds = shift; my $t_end = shift; my $t_start = shift; my $cachekey = $filename . ':' . $cf . ':' . (defined($t_end)?$t_end:'') . ':' . (defined($t_start)?$t_start:''); if( exists( $self->{'cache_RRD'}{$cachekey}{$ds} ) ) { return @{$self->{'cache_RRD'}{$cachekey}{$ds}}; } my $rrdinfo = RRDs::info( $filename ); my $ERR = RRDs::error; if( $ERR ) { Error("Error during RRD info for $filename: $ERR"); return undef; } my $step = $rrdinfo->{'step'}; my $last_available = $rrdinfo->{'last_update'}; $last_available -= $last_available % $step; if( not defined $t_end ) { $t_end = $last_available; } elsif( index( $t_end, 'LAST' ) >= 0 ) { $t_end =~ s/LAST/$last_available/g; } if( not defined $t_start ) { $t_start = $t_end . '-' . int($step * 3); } elsif( index( $t_start, 'LAST' ) >= 0 ) { $t_start =~ s/LAST/$last_available/g; } # From here on, f_ prefix means fetch results my( $f_start, $f_step, $f_names, $f_data ) = RRDs::fetch( $filename, $cf, '--start', $t_start, '--end', $t_end ); $ERR = RRDs::error; if( $ERR ) { Error("Error during RRD fetch for $filename: $ERR"); return undef; } # Memorize the DS names in cache for( my $i = 0; $i < @{$f_names}; $i++ ) { $self->{'cache_RRD'}{$cachekey}{$f_names->[$i]} = []; } # Get the last available data and store in cache foreach my $f_line ( @{$f_data} ) { for( my $i = 0; $i < @{$f_names}; $i++ ) { if( defined $f_line->[$i] ) { $self->{'cache_RRD'}{$cachekey}{$f_names->[$i]} = [ $f_line->[$i], $f_start ]; } } $f_start += $f_step; } if( not exists( $self->{'cache_RRD'}{$cachekey}{$ds} ) ) { Error("DS name $ds is not found in $filename"); return undef; } else { if( scalar( @{$self->{'cache_RRD'}{$cachekey}{$ds}} ) == 0 ) { Warn("Value undefined for ", "DS=$ds, CF=$cf, start=$t_start, end=$t_end in $filename"); return undef; } else { return @{$self->{'cache_RRD'}{$cachekey}{$ds}}; } } } # Data access for other CF than defined for the leaf doesn't make much # sense. So we ignore the CF in DataAccess and leave it for the # sake of Renderer compatibility my %cfNames = ( 'AVERAGE' => 1, 'MIN' => 1, 'MAX' => 1, 'LAST' => 1 ); sub read_RPN { my $self = shift; my $config_tree = shift; my $token = shift; my $expr = shift; my $t_end = shift; my $t_start = shift; my @expr_list = split(',', $expr); my $timestamp = (defined($t_end) and $t_end > 0) ? $t_end : time(); my $rpn = new Torrus::RPN; my $callback = sub { my ($noderef, $timeoffset) = @_; my $function; if( $noderef =~ s/^(.)\@// ) { $function = $1; } my $leaf = length($noderef) > 0 ? $config_tree->getRelative($token, $noderef) : $token; if( not defined $leaf ) { my $path = $config_tree->path($token); Error("Cannot find relative reference $noderef at $path"); return undef; } my ($rval, $var_tstamp) = $self->read($config_tree, $leaf, $timeoffset, $t_start); if( defined $rval ) { if( $var_tstamp == 0 ) { Warn("Torrus::DataAccess::read retirned zero timestamp ". "for $leaf"); } if( $var_tstamp < $timestamp ) { $timestamp = $var_tstamp; } } if( defined( $function ) ) { if( $function eq 'T' ) { return $var_tstamp; } elsif( not $cfNames{$function} ) { Error("Function not supported in RPN: $function"); return undef; } } return $rval; }; my $result = $rpn->run( $expr, $callback ); return ( $result, $timestamp ); } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/0000755000175000017500000000000013131663307014257 500000000000000torrus-3.00/lib/Torrus/DevDiscover/ComtechEFData.pm0000644000175000017500000001017313131663307017126 00000000000000# Copyright (C) 2012 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Comtech EF Data satellite modems package Torrus::DevDiscover::ComtechEFData; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'ComtechEFData'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( 'ComtechEFData' => '1.3.6.1.4.1.6247', 'cdm570' => '1.3.6.1.4.1.6247.24', 'cdm570TxFrequency' => '1.3.6.1.4.1.6247.24.1.2.2.1.0', 'cdm570TxDataRate' => '1.3.6.1.4.1.6247.24.1.2.2.2.0', 'cdm570RxFrequency' => '1.3.6.1.4.1.6247.24.1.2.3.1.0', 'cdm570RxDataRate' => '1.3.6.1.4.1.6247.24.1.2.3.2.0', 'cdmipWanFpgaRxPayLoadCount' => '1.3.6.1.4.1.6247.4.8.5.6.0', ); my %cdm570_OID = ( 'cdm570TxFrequency' => 'cdm-wan-tx-freq', 'cdm570TxDataRate' => 'cdm-wan-tx-rate', 'cdm570RxFrequency' => 'cdm-wan-rx-freq', 'cdm570RxDataRate' => 'cdm-wan-rx-rate', ); sub checkdevtype { my $dd = shift; my $devdetails = shift; my $sysObjectID = $devdetails->snmpVar( $dd->oiddef('sysObjectID') ); if( not $dd->oidBaseMatch( 'ComtechEFData', $sysObjectID ) ) { return 0; } if( $dd->oidBaseMatch( 'cdm570', $sysObjectID ) ) { $devdetails->setCap('cdm570'); } $devdetails->setCap('interfaceIndexingPersistent'); &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, { 'loopback' => { 'ifType' => 24, # softwareLoopback 'ifDescr' => 'loopback' } }); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $data = $devdetails->data(); my $session = $dd->session(); $data->{'param'}{'snmp-oids-per-pdu'} = 10; # Get TX/RX frequency and data rate if( $devdetails->hasCap('cdm570') ) { my @oids = (); foreach my $var ( sort keys %cdm570_OID ) { push( @oids, $dd->oiddef($var) ); } my $result = $session->get_request( -varbindlist => \@oids ); if( not defined $result ) { Error('Failed to get CDM570 radio parameters'); return 0; } foreach my $var ( keys %cdm570_OID ) { my $val = $result->{$dd->oiddef($var)}; if( not defined($val) ) { $val = 0; } $data->{'cdm570'}{$var} = $val; $data->{'param'}{$cdm570_OID{$var}} = $val; } } # Check if IP cotroller is present { my $oid = $dd->oiddef('cdmipWanFpgaRxPayLoadCount'); my $result = $session->get_request( -varbindlist => [$oid] ); if( $session->error_status() == 0 and defined( $result ) and defined($result->{$oid}) ) { $devdetails->setCap('CDMIPController'); } } return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; if( $devdetails->hasCap('cdm570') ) { $cb->addTemplateApplication($devNode, 'ComtechEFData::cdm570'); } if( $devdetails->hasCap('CDMIPController') ) { $cb->addTemplateApplication($devNode, 'ComtechEFData::cdmip'); } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/MotorolaBSR.pm0000644000175000017500000001517613131663307016712 00000000000000# # Discovery module for Motorola Broadband Services Router (formely Riverdelta) # # Copyright (C) 2006 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # # Cisco SCE devices discovery package Torrus::DevDiscover::MotorolaBSR; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'MotorolaBSR'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; # pmodule-dependend OIDs are presented for module #1 only. # currently devices with more than one module do not exist our %oiddef = ( 'rdnProducts' => '1.3.6.1.4.1.4981.4.1', # RDN-CMTS-MIB 'rdnCmtsUpstreamChannelTable' => '1.3.6.1.4.1.4981.2.1.2' ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'rdnProducts', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) or not $devdetails->isDevType('RFC2670_DOCS_IF') ) { return 0; } $devdetails->setCap('interfaceIndexingPersistent'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); $data->{'param'}{'ifindex-map'} = '$IFIDX_IFINDEX'; Torrus::DevDiscover::RFC2863_IF_MIB::storeIfIndexParams( $devdetails ); if( $dd->checkSnmpTable( 'rdnCmtsUpstreamChannelTable' ) ) { $devdetails->setCap('rdnCmtsUpstreamChannelTable'); foreach my $ifIndex ( @{$data->{'docsCableUpstream'}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; push( @{$interface->{'docsTemplates'}}, 'MotorolaBSR::motorola-bsr-docsis-upstream-util' ); } } return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); if( $devdetails->hasCap('rdnCmtsUpstreamChannelTable') and scalar( @{$data->{'docsCableUpstream'}} ) > 0 ) { my $upstrNode = $cb->getChildSubtree( $devNode, $data->{'docsConfig'}{'docsCableUpstream'}{ 'subtreeName'} ); my $shortcuts = 'snr,fec,freq,modems'; my $param = { 'overview-shortcuts' => $shortcuts, 'overview-subleave-name-modems' => 'Modems', 'overview-direct-link-modems' => 'yes', 'overview-direct-link-view-modems' => 'expanded-dir-html', 'overview-shortcut-text-modems' => 'All modems', 'overview-shortcut-title-modems'=> 'Show modem quantities in one page', 'overview-page-title-modems' => 'Modem quantities', }; $cb->addParams( $upstrNode, $param ); # Build All_Modems summary graph $param = { 'ds-type' => 'rrd-multigraph', 'ds-names' => 'registered,unregistered,offline', 'graph-lower-limit' => '0', 'precedence' => '1000', 'vertical-label' => 'Modems', 'descriptive-nickname' => '%system-id%: All modems', 'ds-expr-registered' => '{Modems_Registered}', 'graph-legend-registered' => 'Registered', 'line-style-registered' => 'AREA', 'line-color-registered' => '##blue', 'line-order-registered' => '1', 'ds-expr-unregistered' => '{Modems_Unregistered}', 'graph-legend-unregistered' => 'Unregistered', 'line-style-unregistered' => 'STACK', 'line-color-unregistered' => '##crimson', 'line-order-unregistered' => '2', 'ds-expr-offline' => '{Modems_Offline}', 'graph-legend-offline' => 'Offline', 'line-style-offline' => 'STACK', 'line-color-offline' => '##silver', 'line-order-offline' => '3', }; $param->{'comment'} = 'Registered, Unregistered and Offline modems on CMTS'; $param->{'nodeid'} = $data->{'docsConfig'}{'docsCableUpstream'}{'nodeidCategory'} . '//%nodeid-device%//modems'; my $first = 1; foreach my $ifIndex ( @{$data->{'docsCableUpstream'}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; my $intf = $interface->{$data->{'nameref'}{'ifSubtreeName'}}; if( $first ) { $param->{'ds-expr-registered'} = '{' . $intf . '/Modems_Registered}'; $param->{'ds-expr-unregistered'} = '{' . $intf . '/Modems_Unregistered}'; $param->{'ds-expr-offline'} = '{' . $intf . '/Modems_Offline}'; $first = 0; } else { $param->{'ds-expr-registered'} .= ',{' . $intf . '/Modems_Registered},+'; $param->{'ds-expr-unregistered'} .= ',{' . $intf . '/Modems_Unregistered},+'; $param->{'ds-expr-offline'} .= ',{' . $intf . '/Modems_Offline},+'; } } my $usNode = $cb->getChildSubtree( $devNode, $data->{'docsConfig'}{ 'docsCableUpstream'}{ 'subtreeName'} ); if( defined( $usNode ) ) { $cb->addLeaf( $usNode, 'All_Modems', $param, [] ); } else { Error('Could not find the Upstream subtree'); exit 1; } } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/CiscoCatOS.pm0000644000175000017500000001244613131663307016476 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Cisco CatOS devices discovery # To do: # Power supply and temperature monitoring # RAM monitoring package Torrus::DevDiscover::CiscoCatOS; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'CiscoCatOS'} = { 'sequence' => 510, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( # CISCO-SMI 'ciscoWorkgroup' => '1.3.6.1.4.1.9.5', # CISCO-STACK-MIB 'CISCO-STACK-MIB::portName' => '1.3.6.1.4.1.9.5.1.4.1.1.4', 'CISCO-STACK-MIB::portIfIndex' => '1.3.6.1.4.1.9.5.1.4.1.1.11', 'CISCO-STACK-MIB::chassisSerialNumberString' => '1.3.6.1.4.1.9.5.1.2.19.0' ); # Not all interfaces are normally needed to monitor. # You may override the interface filtering in devdiscover-siteconfig.pl: # redefine $Torrus::DevDiscover::CiscoCatOS::interfaceFilter # or define $Torrus::DevDiscover::CiscoCatOS::interfaceFilterOverlay our $interfaceFilter; our $interfaceFilterOverlay; my %catOsInterfaceFilter; if( not defined( $interfaceFilter ) ) { $interfaceFilter = \%catOsInterfaceFilter; } # Key is some unique symbolic name, does not mean anything # ifType is the number to match the interface type # ifDescr is the regexp to match the interface description %catOsInterfaceFilter = ( 'VLAN N' => { 'ifType' => 53, # propVirtual 'ifDescr' => '^VLAN\s+\d+' }, ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'ciscoWorkgroup', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { return 0; } &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, $interfaceFilter); if( defined( $interfaceFilterOverlay ) ) { &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, $interfaceFilterOverlay); } $devdetails->setCap('interfaceIndexingManaged'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); $data->{'nameref'}{'ifReferenceName'} = 'ifName'; $data->{'nameref'}{'ifSubtreeName'} = 'ifNameT'; $data->{'param'}{'ifindex-table'} = '$ifName'; $data->{'nameref'}{'ifComment'} = 'portName'; # Retrieve port descriptions from CISCO-STACK-MIB my $portIfIndexOID = $dd->oiddef('CISCO-STACK-MIB::portIfIndex'); my $portNameOID = $dd->oiddef('CISCO-STACK-MIB::portName'); my $portIfIndex = $session->get_table( -baseoid => $portIfIndexOID ); if( defined $portIfIndex ) { $devdetails->storeSnmpVars( $portIfIndex ); my $portName = $session->get_table( -baseoid => $portNameOID ); if( defined $portName ) { foreach my $portIndex ( $devdetails->getSnmpIndices( $portIfIndexOID ) ) { my $ifIndex = $devdetails->snmpVar( $portIfIndexOID .'.'. $portIndex ); my $interface = $data->{'interfaces'}{$ifIndex}; $interface->{'portName'} = $portName->{$portNameOID .'.'. $portIndex}; } } } # In large installations, only named ports may be of interest if( $devdetails->paramEnabled('CiscoCatOS::suppress-noname-ports') ) { my $nExcluded = 0; foreach my $ifIndex ( keys %{$data->{'interfaces'}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; if( not defined($interface->{'portName'}) or $interface->{'portName'} eq '' ) { $interface->{'excluded'} = 1; $nExcluded++; } } Debug('Excluded ' . $nExcluded . ' catalyst ports with empty names'); } my $chassisSerial = $dd->retrieveSnmpOIDs( 'CISCO-STACK-MIB::chassisSerialNumberString' ); if( defined( $chassisSerial ) ) { if( defined( $data->{'param'}{'comment'} ) ) { $data->{'param'}{'comment'} .= ', '; } $data->{'param'}{'comment'} .= 'Hw Serial#: ' . $chassisSerial->{'CISCO-STACK-MIB::chassisSerialNumberString'}; } return 1; } # Nothing really to do yet sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/Apple_AE.pm0000644000175000017500000001222413131663307016144 00000000000000# # Copyright (C) 2007 Jon Nistor # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Jon Nistor # Apple Airport Extreme Discovery Module # # NOTE: Options for this module: # Apple_AE::disable-clients package Torrus::DevDiscover::Apple_AE; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'Apple_AE'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( # Apple Airport Extreme 'airportObject' => '1.3.6.1.4.1.63.501', 'baseStation3' => '1.3.6.1.4.1.63.501.3', # Airport Information 'sysConfName' => '1.3.6.1.4.1.63.501.3.1.1.0', 'sysConfContact' => '1.3.6.1.4.1.63.501.3.1.2.0', 'sysConfLocation' => '1.3.6.1.4.1.63.501.3.1.3.0', 'sysConfFirmwareVersion' => '1.3.6.1.4.1.63.501.3.1.5.0', 'wirelessNumber' => '1.3.6.1.4.1.63.501.3.2.1.0', 'wirelessPhysAddress' => '1.3.6.1.4.1.63.501.3.2.2.1.1' ); sub checkdevtype { my $dd = shift; my $devdetails = shift; # PROG: Standard sysObject does not work on Airport devices # So we will match on the specific OID if( not $dd->checkSnmpOID('sysConfName') ) { return 0; } $devdetails->setCap('interfaceIndexingPersistent'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); # NOTE: Comments and Serial number of device my $chassisInfo = $dd->retrieveSnmpOIDs( 'sysConfName', 'sysConfLocation', 'sysConfFirmwareVersion' ); if( defined( $chassisInfo ) ) { if( not $chassisInfo->{'sysConfLocation'} ) { $chassisInfo->{'sysConfLocation'} = "unknown"; } $data->{'param'}{'comment'} = "Apple Airport Extreme, " . "Fw#: " . $chassisInfo->{'sysConfFirmwareVersion'} . ", " . $chassisInfo->{'sysConfName'} . " located at " . $chassisInfo->{'sysConfLocation'}; } else { $data->{'param'}{'comment'} = "Apple Airport Extreme"; } # PROG: Find wireless clients if( $devdetails->paramDisabled('Apple_AE::disable-clients') ) { my $numWireless = $dd->retrieveSnmpOIDs('wirelessNumber'); my $tableClients = $session->get_table( -baseoid => $dd->oiddef('wirelessPhysAddress') ); $devdetails->storeSnmpVars( $tableClients ); if( $tableClients && ($numWireless->{'wirelessNumber'} > 0) ) { # PROG: setCap that we actually have clients ... $devdetails->setCap('AE_clients'); foreach my $wClient ( $devdetails->getSnmpIndices ($dd->oiddef('wirelessPhysAddress')) ) { my $wMAC = $devdetails->snmpVar( $dd->oiddef('wirelessPhysAddress') . "." . $wClient); # Construct data $data->{'Apple_AE'}{'wClients'}{$wClient} = undef; $data->{'Apple_AE'}{'wClients'}{$wClient}{'wMAC'} = $wMAC; Debug("Apple_AE:: Client $wMAC / $wClient"); } } } return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); # Wireless Client information if( $devdetails->hasCap('AE_clients') ) { my $nodeTop = $cb->addSubtree( $devNode, 'Wireless_Clients', undef, [ 'Apple_AE::ae-wireless-clients-subtree'] ); foreach my $wClient ( keys %{$data->{'Apple_AE'}{'wClients'}} ) { my $airport = $data->{'Apple_AE'}{'wClients'}{$wClient}; my $wMAC = $airport->{'wMAC'}; my $wMACfix = $wMAC; $wMACfix =~ s/:/_/g; my $nodeWireless = $cb->addSubtree( $nodeTop, $wMACfix, { 'wireless-mac' => $wMAC, 'wireless-macFix' => $wMACfix, 'wireless-macOid' => $wClient }, [ 'Apple_AE::ae-wireless-clients-leaf' ] ); } } # PROG: Adding global statistics $cb->addTemplateApplication( $devNode, 'Apple_AE::ae-global-stats'); return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/CasaCMTS.pm0000644000175000017500000002043313131663307016075 00000000000000# Copyright (C) 2010 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # DOCSIS interface, CASA specific package Torrus::DevDiscover::CasaCMTS; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'CasaCMTS'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; $Torrus::DevDiscover::RFC2863_IF_MIB::knownSelectorActions{ 'DocsisMacModemsMonitor'} = 'CasaCMTS'; our %oiddef = ( 'casaProducts' => '1.3.6.1.4.1.20858.2', ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'casaProducts', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) or not $devdetails->isDevType('RFC2670_DOCS_IF') ) { return 0; } return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $data = $devdetails->data(); push( @{$data->{'docsConfig'}{'docsCableMaclayer'}{'templates'}}, 'CasaCMTS::casa-docsis-mac-subtree' ); foreach my $ifIndex ( @{$data->{'docsCableMaclayer'}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; push( @{$interface->{'docsTemplates'}}, 'CasaCMTS::casa-docsis-mac-util' ); } foreach my $ifIndex ( @{$data->{'docsCableUpstream'}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; push( @{$interface->{'docsTemplates'}}, 'CasaCMTS::casa-docsis-upstream-util' ); } foreach my $ifIndex ( @{$data->{'docsCableDownstream'}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; push( @{$interface->{'docsTemplates'}}, 'CasaCMTS::casa-docsis-downstream-util' ); } $data->{'nameref'}{'ifNodeid'} = 'ifNameT'; return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); if( scalar( @{$data->{'docsCableMaclayer'}} ) > 0 ) { # Build All_Modems summary graph my $param = { 'ds-type' => 'rrd-multigraph', 'ds-names' => 'total,active,registered', 'graph-lower-limit' => '0', 'precedence' => '1000', 'vertical-label' => 'Modems', 'graph-legend-total' => 'Total', 'line-style-total' => '##totalresource', 'line-color-total' => '##totalresource', 'line-order-total' => '1', 'graph-legend-active' => 'Active', 'line-style-active' => '##resourcepartusage', 'line-color-active' => '##resourcepartusage', 'line-order-active' => '2', 'graph-legend-registered' => 'Registered', 'line-style-registered' => '##resourceusage', 'line-color-registered' => '##resourceusage', 'line-order-registered' => '3', 'descriptive-nickname' => '%system-id%: All modems' }; # for the sake of better Emacs formatting $param->{'comment'} = 'Registered, Active and Total modems on CMTS'; $param->{'nodeid'} = $data->{'docsConfig'}{'docsCableMaclayer'}{'nodeidCategory'} . '//%nodeid-device%//modems'; my $first = 1; foreach my $ifIndex ( @{$data->{'docsCableMaclayer'}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; my $intf = $interface->{$data->{'nameref'}{'ifSubtreeName'}}; if( $first ) { $param->{'ds-expr-total'} = '{' . $intf . '/Modems_Total}'; $param->{'ds-expr-active'} = '{' . $intf . '/Modems_Active}'; $param->{'ds-expr-registered'} = '{' . $intf . '/Modems_Registered}'; $first = 0; } else { $param->{'ds-expr-total'} .= ',{' . $intf . '/Modems_Total},+'; $param->{'ds-expr-active'} .= ',{' . $intf . '/Modems_Active},+'; $param->{'ds-expr-registered'} .= ',{' . $intf . '/Modems_Registered},+'; } } my $macNode = $cb->getChildSubtree( $devNode, $data->{'docsConfig'}{ 'docsCableMaclayer'}{ 'subtreeName'} ); if( defined( $macNode ) ) { $cb->addLeaf( $macNode, 'All_Modems', $param, [] ); } else { Error('Could not find the MAC layer subtree'); exit 1; } # Apply selector actions foreach my $ifIndex ( @{$data->{'docsCableMaclayer'}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; my $intf = $interface->{$data->{'nameref'}{'ifSubtreeName'}}; my $monitor = $interface->{'selectorActions'}{'DocsisMacModemsMonitor'}; if( defined( $monitor ) ) { my $intfNode = $cb->getChildSubtree( $macNode, $intf ); $cb->addLeaf( $intfNode, 'Modems_Registered', {'monitor' => $monitor } ); } } } if( scalar( @{$data->{'docsCableUpstream'}} ) > 0 ) { my $upstrNode = $cb->getChildSubtree( $devNode, $data->{'docsConfig'}{'docsCableUpstream'}{ 'subtreeName'} ); # Override the overview shortcus defined in rfc2670.docsis-if.xml my $shortcuts = 'snr,fec,freq,modems'; my $param = { 'overview-shortcuts' => $shortcuts, 'overview-subleave-name-modems' => 'Modems', 'overview-direct-link-modems' => 'yes', 'overview-direct-link-view-modems' => 'expanded-dir-html', 'overview-shortcut-text-modems' => 'All modems', 'overview-shortcut-title-modems'=> 'Show modem quantities in one page', 'overview-page-title-modems' => 'Modem quantities', }; $cb->addParams( $upstrNode, $param ); } if( scalar( @{$data->{'docsCableDownstream'}} ) > 0 ) { my $downstrNode = $cb->getChildSubtree( $devNode, $data->{'docsConfig'}{'docsCableDownstream'}{ 'subtreeName'} ); # Override the overview shortcus defined in rfc2670.docsis-if.xml my $shortcuts = 'util,modems'; my $param = { 'overview-shortcuts' => $shortcuts, 'overview-subleave-name-modems' => 'Modems', 'overview-direct-link-modems' => 'yes', 'overview-direct-link-view-modems' => 'expanded-dir-html', 'overview-shortcut-text-modems' => 'All modems', 'overview-shortcut-title-modems' => 'Show modem quantities in one page', 'overview-page-title-modems' => 'Modem quantities', }; $cb->addParams( $downstrNode, $param ); } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/CompaqCIM.pm0000644000175000017500000001372113131663307016312 00000000000000# Copyright (C) 2003 Shawn Ferry # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Shawn Ferry # Compaq Insight Manager # MIB files available at # http://h18023.www1.hp.com/support/files/server/us/download/19885.html package Torrus::DevDiscover::CompaqCIM; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'CompaqCIM'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( # Compaq Insite Manager 'cpqcim' => '1.3.6.1.4.1.232', # CPQHLTH-MIB 'cpqHeTemperatureTable' => '1.3.6.1.4.1.232.6.2.6.8', 'cpqHeTemperatureChassis' => '1.3.6.1.4.1.232.6.2.6.8.1.1', 'cpqHeTemperatureIndex' => '1.3.6.1.4.1.232.6.2.6.8.1.2', 'cpqHeTemperatureLocale' => '1.3.6.1.4.1.232.6.2.6.8.1.3', 'cpqHeTemperatureCelsius' => '1.3.6.1.4.1.232.6.2.6.8.1.4', 'cpqHeTemperatureHwLocation' => '1.3.6.1.4.1.232.6.2.6.8.1.8', 'cpqHeCorrMemTotalErrs' => '1.3.6.1.4.1.232.6.2.3.3.0', # This is not a complete implementation of the HLTH MIB ); sub checkdevtype { my $dd = shift; my $devdetails = shift; return $dd->checkSnmpTable( 'cpqcim' ); } my $enumLocale = { 1 => 'other', 2 => 'unknown', 3 => 'system', 4 => 'systemBoard', 5 => 'ioBoard', 6 => 'cpu', 7 => 'memory', 8 => 'storage', 9 => 'removableMedia', 10 => 'powerSupply', 11 => 'ambient', 12 => 'chassis', 13 => 'bridgeCard', }; sub discover { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); my @checkOids = ( 'cpqHeCorrMemTotalErrs' ); foreach my $oid ( @checkOids ) { if( $dd->checkSnmpOID($oid) ) { $devdetails->setCap( $oid ); } } my $TemperatureTable = $session->get_table( -baseoid => $dd->oiddef('cpqHeTemperatureTable') ); if( defined( $TemperatureTable ) ) { $devdetails->storeSnmpVars( $TemperatureTable ); $devdetails->setCap( 'cpqHeTemperatureTable' ); my $ref = {}; $ref->{'indices'} = []; $data->{'TemperatureTable'} = $ref; # Index is Chassis . Index foreach my $INDEX ( $devdetails-> getSnmpIndices( $dd->oiddef('cpqHeTemperatureIndex') ) ) { next if ( $devdetails->snmpVar ( $dd->oiddef('cpqHeTemperatureCelsius') . '.' . $INDEX ) < 0 ); push( @{$ref->{'indices'}}, $INDEX ); my $chassis = $devdetails->snmpVar ( $dd->oiddef('cpqHeTemperatureChassis') . '.' . $INDEX ); my $sensorIdx = $devdetails->snmpVar ( $dd->oiddef('cpqHeTemperatureIndex') . '.' . $INDEX ); my $locale = $devdetails->snmpVar ( $dd->oiddef('cpqHeTemperatureLocale') . '.' . $INDEX ); $locale = $enumLocale->{$locale} if $enumLocale->{$locale}; my $location = $devdetails->snmpVar ( $dd->oiddef('cpqHeTemperatureHwLocation') . '.' . $INDEX ); my $nick = sprintf('Chassis%d_%s_%d', $chassis, $locale, $sensorIdx); my $param = {}; $ref->{$INDEX}->{'param'} = $param; $param->{'cpq-cim-sensor-index'} = $INDEX; $param->{'cpq-cim-sensor-nick'} = $nick; $param->{'comment'} = sprintf('Chassis: %s Location: %s Index: %s', $chassis, $locale, $sensorIdx); $param->{'precedence'} = 1000 - $sensorIdx; } } return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); my $cimParam = { 'comment' => 'Compaq Insight Manager', 'precedence' => '-500', }; my $cimNode = $cb->addSubtree( $devNode, 'CompaqCIM', $cimParam ); my $healthParam = { 'comment' => 'Compaq CIM Health', 'precedence' => '-500' }; my @healthTemplates; if( $devdetails->hasCap('cpqHeCorrMemTotalErrs') ) { push( @healthTemplates, 'CompaqCIM::cpq-cim-corr-mem-errs' ); } my $Health = $cb->addSubtree( $cimNode, 'Health', $healthParam, \@healthTemplates); if( $devdetails->hasCap('cpqHeTemperatureTable') ) { my $tempParam = { 'precedence' => '-100', 'comment' => 'Compaq Temperature Sensors', 'rrd-create-dstype' => 'GAUGE', }; my $tempNode = $cb->addSubtree( $Health, 'Temperature_Sensors', $tempParam ); my $ref = $data->{'TemperatureTable'}; foreach my $INDEX ( @{ $ref->{'indices'} } ) { my $param = $ref->{$INDEX}->{'param'}; $cb->addLeaf( $tempNode, $param->{'cpq-cim-sensor-nick'}, $param, [ 'CompaqCIM::cpq-cim-temperature-sensor' ] ); } } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/NexComm.pm0000644000175000017500000000356313131663307016112 00000000000000# Copyright (C) 2011 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # NexComm System xDSL gateways # Only interface indexing and naming is handled here. package Torrus::DevDiscover::NexComm; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'NexComm'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( 'nexcomm_products' => '1.3.6.1.4.1.5927.1', ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'nexcomm_products', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { return 0; } $devdetails->setCap('interfaceIndexingPersistent'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $data = $devdetails->data(); my $session = $dd->session(); $data->{'param'}{'snmp-oids-per-pdu'} = 10; return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/Paradyne.pm0000644000175000017500000001300513131663307016277 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Paradyne devices discovery # A typical Paradyne device has several slots, and all slots are managed # through the same IP address, with different community strings. # That's why you have to configure "Paradyne::slot-name" parameter # in your discovery file, uniquely for each slot. A slot name should # not contain special characters. # Tested with: # # - Paradyne GranDSLAM 2.0 DSLAM - Hotwire DSL; # Model: 8000-B2-211; S/W Release : M04.02.27 # # - Paradyne Hotwire ATM ADSL Line Card; # Model: 8365-B1-000; S/W Release: 02.03.54 # # - Paradyne Hotwire ATM G.SHDSL Line Card; # Model: 8385-B1-000; S/W Release: 02.03.45 # # - Hotwire IP ReachDSL Line Card; # Model: 8314-B3-000; S/W Release: 04.03.10 package Torrus::DevDiscover::Paradyne; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'Paradyne'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( # PDN-HEADER-MIB 'paradyne-products' => '1.3.6.1.4.1.1795.1.14', 'xdslDevIfStatsElapsedTimeLinkUp' => '1.3.6.1.4.1.1795.2.24.2.6.8.1.1.1.1.4' ); our $statsInterval; if( not defined $statsInterval ) { $statsInterval = 6; # current15Minutes (GORD) } sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'paradyne-products', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { return 0; } if( not defined($devdetails->param('Paradyne::slot-name')) ) { Error('Mandatory discovery parameter "Paradyne::slot-name" ' . 'is not defined for a Paradyne device: ' . $devdetails->param('snmp-host') . ':' . $devdetails->param('snmp-port') . ':' . $devdetails->param('snmp-community')); return 0; } $devdetails->setCap('interfaceIndexingManaged'); $devdetails->setCap('interfaceIndexingPersistent'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $data = $devdetails->data(); my $session = $dd->session(); $data->{'nameref'}{'ifReferenceName'} = 'ifName'; $data->{'nameref'}{'ifSubtreeName'} = 'ifNameT'; $data->{'nameref'}{'ifNick'} = 'ParadyneIfNick'; $data->{'nameref'}{'ifComment'} = 'ifDescr'; if( not defined( $data->{'param'}{'snmp-oids-per-pdu'} ) ) { $data->{'param'}{'snmp-oids-per-pdu'} = '10'; } my $slot = $devdetails->param('Paradyne::slot-name'); foreach my $ifIndex ( keys %{$data->{'interfaces'}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; $interface->{'ParadyneIfNick'} = $slot . '_' . $interface->{'ifNameT'}; } my $xdslOID = $dd->oiddef('xdslDevIfStatsElapsedTimeLinkUp'); my $xdslTable = $session->get_table( -baseoid => $xdslOID ); if( defined $xdslTable ) { $devdetails->storeSnmpVars( $xdslTable ); $devdetails->setCap('paradyneXDSL'); foreach my $ifIndex ( keys %{$data->{'interfaces'}} ) { if( $devdetails->hasOID( $xdslOID .'.'. $ifIndex .'.'. $statsInterval ) ) { push( @{$data->{'paradyneXDSLInterfaces'}}, $ifIndex ); } } } return 1; } # Nothing really to do yet sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; if( $devdetails->hasCap('paradyneXDSL') ) { my $subtreeName = 'XDSL_Line_Stats'; my $subtreeParam = { 'precedence' => '-600', 'comment' => 'Paradyne XDSL line statistics', 'xdsl-stats-interval' => $statsInterval }; my $subtreeNode = $cb->addSubtree( $devNode, $subtreeName, $subtreeParam ); my $data = $devdetails->data(); foreach my $ifIndex ( sort {$a<=>$b} @{$data->{'paradyneXDSLInterfaces'}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; my $ifSubtreeName = $interface->{$data->{'nameref'}{'ifSubtreeName'}}; my $templates = ['Paradyne::paradyne-xdsl-interface']; my $param = { 'interface-name' => $interface->{'param'}{'interface-name'}, 'interface-nick' => $interface->{'param'}{'interface-nick'}, 'comment' => $interface->{'param'}{'comment'} }; $cb->addSubtree( $subtreeNode, $ifSubtreeName, $param, $templates ); } } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/MicrosoftWindows.pm0000644000175000017500000001452213131663307020061 00000000000000# Copyright (C) 2003-2011 Stanislav Sinyagin, Shawn Ferry # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Shawn Ferry # MS Windows 2000/XP SNMP agent discovery. # ifDescr does not give unique interace mapping, so MAC address mapping # is used. package Torrus::DevDiscover::MicrosoftWindows; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'MicrosoftWindows'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( # MSFT-MIB 'windowsNT' => '1.3.6.1.4.1.311.1.1.3.1', # FtpServer-MIB 'ms_ftpStatistics' => '1.3.6.1.4.1.311.1.7.2.1', # HttpServer-MIB 'ms_httpStatistics' => '1.3.6.1.4.1.311.1.7.3.1', ); # Not all interfaces are normally needed to monitor. # You may override the interface filtering in devdiscover-siteconfig.pl: # redefine $Torrus::DevDiscover::MicrosoftWindows::interfaceFilter # or define $Torrus::DevDiscover::MicrosoftWindows::interfaceFilterOverlay our $interfaceFilter; our $interfaceFilterOverlay; my %winNTInterfaceFilter; if( not defined( $interfaceFilter ) ) { $interfaceFilter = \%winNTInterfaceFilter; } # Key is some unique symbolic name, does not mean anything # ifType is the number to match the interface type # ifDescr is the regexp to match the interface description %winNTInterfaceFilter = ( 'MS TCP Loopback interface' => { 'ifType' => 24 # softwareLoopback }, 'Tunnel' => { 'ifType' => 131 # tunnel }, 'PPP' => { 'ifType' => 23 # ppp }, 'WAN Miniport Ethernet' => { 'ifType' => 6, # ethernetCsmacd 'ifDescr' => '^WAN[-|\s+]Miniport' }, 'QoS Packet Scheduler' => { 'ifType' => 6, # ethernetCsmacd 'ifDescr' => 'QoS\s+Packet\s+Scheduler' }, 'LightWeight Filter' => { 'ifType' => 6, # ethernetCsmacd 'ifDescr' => 'WFP\s+LightWeight\s+Filter' }, 'LightWeight Filter MAC Native' => { 'ifType' => 6, # ethernetCsmacd 'ifDescr' => 'WFP\s+Native\s+MAC\s+Layer\s+LightWeight\s+Filter' }, 'LightWeight Filter MAC 802.3' => { 'ifType' => 6, # ethernetCsmacd 'ifDescr' => 'WFP\s+802.3\s+MAC\s+Layer\s+LightWeight\s+Filter' }, 'Microsoft Kernel Debug Network Adapter' => { 'ifType' => 6, # ethernetCsmacd 'ifDescr' => 'Microsoft\s+Kernel\s+Debug\s+Network\s+Adapter' }, ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'windowsNT', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { return 0; } my $data = $devdetails->data(); &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, $interfaceFilter); if( defined( $interfaceFilterOverlay ) ) { &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, $interfaceFilterOverlay); } $devdetails->setCap('interfaceIndexingManaged'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); # to keep backward compatibility we set the interface # comment explicitly to '' if there is no ifAlias table # which _may_ be the case with very old versions of # Microsoft Windows if ( not $devdetails->hasCap( 'ifAlias' ) ) { Debug("No ifAlias present to setting ifComment to ''"); $data->{'nameref'}{'ifComment'} = ''; } # In Windows SNMP agent, ifDescr is not unique per interface. # We use MAC address as a unique interface identifier. $data->{'param'}{'ifindex-map'} = '$IFIDX_MAC'; Torrus::DevDiscover::RFC2863_IF_MIB::retrieveMacAddresses( $dd, $devdetails ); $data->{'nameref'}{'ifNick'} = 'MAC'; $data->{'nameref'}{'ifNodeid'} = 'MAC'; # FTP and HTTP servers, if present if( $dd->checkSnmpTable( 'ms_ftpStatistics' ) ) { $devdetails->setCap( 'msIIS' ); $devdetails->setCap( 'msFtpStats' ); } if( $dd->checkSnmpTable( 'ms_httpStatistics' ) ) { $devdetails->setCap( 'msIIS' ); $devdetails->setCap( 'msHttpStats' ); } return 1; } # Nothing really to do yet sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; if( $devdetails->hasCap( 'msIIS' ) ) { my $iisParam = { 'precedence' => -100000, 'comment' => 'Microsoft Internet Information Server', 'node-display-name' => 'MS IIS', }; my @iisTemplates; if( $devdetails->hasCap( 'msFtpStats' ) ) { push( @iisTemplates, 'MicrosoftWindows::microsoft-iis-ftp-stats' ); } if( $devdetails->hasCap( 'msHttpStats' ) ) { push( @iisTemplates, 'MicrosoftWindows::microsoft-iis-http-stats' ); } my $iisNode = $cb->addSubtree( $devNode, 'MS_IIS', $iisParam, \@iisTemplates ); } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/Thomson_xDSL.pm0000644000175000017500000000453413131663307017064 00000000000000# Copyright (C) 2011 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Technicolor Thomson xDSL gateways # Only interface indexing and naming is handled here. package Torrus::DevDiscover::Thomson_xDSL; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'Thomson_xDSL'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( 'thomson_xDSL_products' => '1.3.6.1.4.1.2863.405', ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'thomson_xDSL_products', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { return 0; } $devdetails->setCap('interfaceIndexingPersistent'); &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, { 'BRG' => { 'ifType' => 6, # ethernetCsmacd 'ifDescr' => '^BRG:' } }); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $data = $devdetails->data(); my $session = $dd->session(); $data->{'nameref'}{'ifSubtreeName'} = 'ifNameT'; $data->{'nameref'}{'ifReferenceName'} = 'ifName'; $data->{'nameref'}{'ifNick'} = 'ifIndex'; $data->{'nameref'}{'ifNodeid'} = 'ifIndex'; $data->{'nameref'}{'ifComment'} = undef; $data->{'param'}{'snmp-oids-per-pdu'} = 10; return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/CiscoIOS.pm0000644000175000017500000006571313131663307016164 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # Cisco IOS devices discovery package Torrus::DevDiscover::CiscoIOS; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'CiscoIOS'} = { 'sequence' => 510, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( # CISCO-PRODUCTS-MIB 'ciscoLS1010' => '1.3.6.1.4.1.9.1.107', # CISCO-IMAGE-MIB 'ciscoImageTable' => '1.3.6.1.4.1.9.9.25.1.1', # CISCO-ENHANCED-IMAGE-MIB 'ceImageTable' => '1.3.6.1.4.1.9.9.249.1.1.1', # OLD-CISCO-MEMORY-MIB 'bufferElFree' => '1.3.6.1.4.1.9.2.1.9.0', # CISCO-IPSEC-FLOW-MONITOR-MIB 'cipSecGlobalHcInOctets' => '1.3.6.1.4.1.9.9.171.1.3.1.4.0', # CISCO-BGP4-MIB 'cbgpPeerAddrFamilyName' => '1.3.6.1.4.1.9.9.187.1.2.3.1.3', 'cbgpPeerAcceptedPrefixes' => '1.3.6.1.4.1.9.9.187.1.2.4.1.1', 'cbgpPeerPrefixAdminLimit' => '1.3.6.1.4.1.9.9.187.1.2.4.1.3', # CISCO-CAR-MIB 'ccarConfigType' => '1.3.6.1.4.1.9.9.113.1.1.1.1.3', 'ccarConfigAccIdx' => '1.3.6.1.4.1.9.9.113.1.1.1.1.4', 'ccarConfigRate' => '1.3.6.1.4.1.9.9.113.1.1.1.1.5', 'ccarConfigLimit' => '1.3.6.1.4.1.9.9.113.1.1.1.1.6', 'ccarConfigExtLimit' => '1.3.6.1.4.1.9.9.113.1.1.1.1.7', 'ccarConfigConformAction' => '1.3.6.1.4.1.9.9.113.1.1.1.1.8', 'ccarConfigExceedAction' => '1.3.6.1.4.1.9.9.113.1.1.1.1.9', # CISCO-VPDN-MGMT-MIB 'cvpdnSystemTunnelTotal' => '1.3.6.1.4.1.9.10.24.1.1.4.1.2', # CISCO-WAN-3G-MIB 'c3gStandard' => '1.3.6.1.4.1.9.9.661.1.1.1.1', # CISCO-PORT-QOS-MIB 'cportQosDropPkts' => '1.3.6.1.4.1.9.9.189.1.3.2.1.7', ); # Not all interfaces are normally needed to monitor. # You may override the interface filtering in devdiscover-siteconfig.pl: # redefine $Torrus::DevDiscover::CiscoIOS::interfaceFilter # or define $Torrus::DevDiscover::CiscoIOS::interfaceFilterOverlay our $interfaceFilter; our $interfaceFilterOverlay; my %ciscoInterfaceFilter; if( not defined( $interfaceFilter ) ) { $interfaceFilter = \%ciscoInterfaceFilter; } # Key is some unique symbolic name, does not mean anything # ifType is the number to match the interface type # ifDescr is the regexp to match the interface description %ciscoInterfaceFilter = ( 'Null0' => { 'ifType' => 1, # other 'ifDescr' => '^Null' }, 'E1 N/N/N' => { 'ifType' => 18, # ds1 'ifDescr' => '^E1' }, 'Virtual-AccessN' => { 'ifType' => 23, # ppp 'ifDescr' => '^Virtual-Access' }, 'LoopbackN' => { 'ifType' => 24, # softwareLoopback 'ifDescr' => '^Loopback' }, 'SerialN:N-Bearer Channel' => { 'ifType' => 81, # ds0, Digital Signal Level 0 'ifDescr' => '^Serial.*Bearer\s+Channel' }, 'Voice Encapsulation (POTS) Peer: N' => { 'ifType' => 103 # voiceEncap }, 'Voice Over IP Peer: N' => { 'ifType' => 104 # voiceOverIp }, 'ATMN/N/N.N-atm subif' => { 'ifType' => 134, # atmSubInterface 'ifDescr' => '^ATM[0-9\/]+\.[0-9]+\s+subif' }, 'BundleN' => { 'ifType' => 127, # docsCableMaclayer 'ifDescr' => '^Bundle' }, 'EOBCN/N' => { 'ifType' => 53, # propVirtual 'ifDescr' => '^EOBC' }, 'FIFON/N' => { 'ifType' => 53, # propVirtual 'ifDescr' => '^FIFO' }, 'vfc' => { 'ifType' => 56, # virtualFibreChannel 'ifDescr' => '^vfc' }, ); our %tunnelType = ( # CISCO-VPDN-MGMT-MIB Tunnel Types '1' => 'L2F', '2' => 'L2TP', '3' => 'PPTP' ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $devdetails->isDevType('CiscoGeneric') ) { return 0; } # first, try to find IOS or IOS XR in sysDescr my $sysDescr = $devdetails->snmpVar($dd->oiddef('sysDescr')); my $found = 0; if( defined($sysDescr) and index( $sysDescr, 'Cisco IOS Software' ) >= 0 ) { $found = 1; } elsif( defined($sysDescr) and index( $sysDescr, 'Cisco IOS XR Software' ) >= 0 ) { $found = 1; $devdetails->setCap('CiscoIOSXR'); } elsif( defined($sysDescr) and index( $sysDescr, 'Cisco NX-OS' ) >= 0 ) { # nexus implements the class-based qoS MIB, so we treat it as # an IOS device $found = 1; $devdetails->setCap('CiscoNXOS'); } else { # fall back to software image table if( $dd->checkSnmpTable('ciscoImageTable') ) { $found = 1; } elsif( $dd->checkSnmpTable('ceImageTable') ) { $found = 1; $devdetails->setCap('CiscoIOSXR'); } } if( not $found ) { return 0; } # On some Layer3 switching devices, VlanXXX interfaces give some # useful stats, while on others the stats are not relevant at all if( $devdetails->paramDisabled('CiscoIOS::enable-vlan-interfaces') ) { $interfaceFilter->{'VlanN'} = { 'ifType' => 53, # propVirtual 'ifDescr' => '^Vlan\d+' }; } # same thing with unrouted VLAN interfaces if( $devdetails->paramDisabled ('CiscoIOS::enable-unrouted-vlan-interfaces')) { $interfaceFilter->{'unrouted VLAN N'} = { 'ifType' => 53, # propVirtual 'ifDescr' => '^unrouted\s+VLAN\s+\d+' }; } # sometimes we want Dialer interface stats if( $devdetails->paramDisabled('CiscoIOS::enable-dialer-interfaces') ) { $interfaceFilter->{'DialerN'} = { 'ifType' => 23, # ppp 'ifDescr' => '^Dialer' }; $interfaceFilter->{'DialerN_ML'} = { 'ifType' => 108, # pppMultilinkBundle 'ifDescr' => '^Dialer' }; } &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, $interfaceFilter); if( defined( $interfaceFilterOverlay ) ) { &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, $interfaceFilterOverlay); } $devdetails->setCap('interfaceIndexingManaged'); if( $devdetails->hasCap('CiscoNXOS') or $devdetails->paramEnabled('CiscoIOS::ifindex-persist') ) { $devdetails->setCap('interfaceIndexingPersistent'); } return 1; } my %ccarConfigTypeTranslation = ( 1 => 'all', 2 => 'quickAcc', 3 => 'standardAcc' ); my %ccarActionTranslation = ( 1 => 'drop', 2 => 'xmit', 3 => 'continue', 4 => 'precedXmit', 5 => 'precedCont' ); sub discover { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); # fixing the interface indexing and referencing schema $data->{'nameref'}{'ifSubtreeName'} = 'ifDescrT'; $data->{'nameref'}{'ifReferenceName'} = 'ifDescr'; $data->{'nameref'}{'ifNick'} = 'ifNameT'; $data->{'nameref'}{'ifComment'} = 'ifAlias'; # Old mkroutercfg used cisco-interface-counters if( $Torrus::DevDiscover::CiscoIOS::useCiscoInterfaceCounters ) { foreach my $interface ( values %{$data->{'interfaces'}} ) { $interface->{'hasHCOctets'} = 0; $interface->{'hasOctets'} = 0; push( @{$interface->{'templates'}}, 'CiscoIOS::cisco-interface-counters' ); } } if( $devdetails->paramEnabled('CiscoIOS::enable-membuf-stats') ) { # Old Memory Buffers, if we have bufferElFree we assume # the rest as they are "required" if( $dd->checkSnmpOID('bufferElFree') ) { $devdetails->setCap('old-ciscoMemoryBuffers'); push( @{$data->{'templates'}}, 'CiscoIOS::old-cisco-memory-buffers' ); } } if( $devdetails->paramDisabled('CiscoIOS::disable-ipsec-stats') ) { if( $dd->checkSnmpOID('cipSecGlobalHcInOctets') ) { $devdetails->setCap('ciscoIPSecGlobalStats'); push( @{$data->{'templates'}}, 'CiscoIOS::cisco-ipsec-flow-globals' ); } if( $dd->oidBaseMatch ( 'ciscoLS1010', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { $data->{'param'}{'snmp-oids-per-pdu'} = 10; } } if( $devdetails->paramDisabled('CiscoIOS::disable-bgp-stats') ) { my $peerTable = $dd->walkSnmpTable('cbgpPeerAcceptedPrefixes'); if( scalar(keys %{$peerTable}) > 0 ) { $devdetails->setCap('CiscoBGP'); my $limitsTable = $dd->walkSnmpTable('cbgpPeerPrefixAdminLimit'); $data->{'cbgpPeers'} = {}; # retrieve AS numbers for neighbor peers Torrus::DevDiscover::RFC1657_BGP4_MIB::discover($dd, $devdetails); # list of indices for peers that are not IPv4 Unicast my @nonV4Unicast; # Number of peers for each AS my %asNumbers; foreach my $INDEX ( keys %{$peerTable} ) { my ($a1, $a2, $a3, $a4, $afi, $safi) = split(/\./, $INDEX); my $peerIP = join('.', $a1, $a2, $a3, $a4); my $peer = { 'peerIP' => $peerIP, 'addrFamily' => 'IPv4 Unicast' }; if( $afi != 1 and $safi != 1 ) { push( @nonV4Unicast, $INDEX ); } { my $desc = $devdetails->paramString ('peer-ipaddr-description-' . join('_', split('\.', $peerIP))); if( $desc ne '' ) { $peer->{'description'} = $desc; } } my $peerAS = $data->{'bgpPeerAS'}{$peerIP}; if( defined( $peerAS ) ) { $peer->{'peerAS'} = $data->{'bgpPeerAS'}{$peerIP}; $asNumbers{$peer->{'peerAS'}}++; my $desc = $devdetails->paramString ('bgp-as-description-' . $peerAS); if( $desc ne '' ) { if( defined( $peer->{'description'} ) ) { Warn('Conflicting descriptions for peer ' . $peerIP); } $peer->{'description'} = $desc; } } else { Error('Cannot find AS number for BGP peer ' . $peerIP); next; } if( defined( $peer->{'description'} ) ) { $peer->{'description'} .= ' '; } $peer->{'description'} .= '[' . $peerIP . ']'; $peer->{'prefixLimit'} = $limitsTable->{$INDEX}; $data->{'cbgpPeers'}{$INDEX} = $peer; } if( scalar( @nonV4Unicast ) > 0 ) { my $addrFamTable = $dd->walkSnmpTable('cbgpPeerAddrFamilyName'); foreach my $INDEX ( @nonV4Unicast ) { my $peer = $data->{'cbgpPeers'}{$INDEX}; my $fam = $addrFamTable->{$INDEX}; $peer->{'addrFamily'} = $fam; $peer->{'otherAddrFamily'} = 1; $peer->{'description'} .= ' ' . $fam; } } # Construct the subtree names from AS, peer IP, and address # family foreach my $INDEX ( keys %{$data->{'cbgpPeers'}} ) { my $peer = $data->{'cbgpPeers'}{$INDEX}; my $subtreeName = 'AS' . $peer->{'peerAS'}; if( $asNumbers{$peer->{'peerAS'}} > 1 ) { $subtreeName .= '_' . $peer->{'peerIP'}; } if( $peer->{'otherAddrFamily'} ) { my $fam = $data->{'cbgpPeers'}{$INDEX}{'addrFamily'}; $fam =~ s/\W/_/g; $subtreeName .= '_' . $fam; } $peer->{'subtreeName'} = $subtreeName; } } } if( $devdetails->paramDisabled('CiscoIOS::disable-car-stats') ) { my $ccarConfigType = $dd->walkSnmpTable('ccarConfigType'); if( scalar(keys %{$ccarConfigType}) > 0 ) { $devdetails->setCap('CiscoCAR'); $data->{'ccar'} = {}; my $ccarConfigAccIdx = $dd->walkSnmpTable('ccarConfigAccIdx'); my $ccarConfigRate = $dd->walkSnmpTable('ccarConfigRate'); my $ccarConfigLimit = $dd->walkSnmpTable('ccarConfigLimit'); my $ccarConfigExtLimit = $dd->walkSnmpTable('ccarConfigExtLimit'); my $ccarConfigConformAction = $dd->walkSnmpTable('ccarConfigConformAction'); my $ccarConfigExceedAction = $dd->walkSnmpTable('ccarConfigExceedAction'); while( my($INDEX, $confType) = each %{$ccarConfigType} ) { my ($ifIndex, $dir, $carIndex) = split(/\./, $INDEX); my $interface = $data->{'interfaces'}{$ifIndex}; if( not defined($interface) or $interface->{'excluded'} ) { next; } my $car = { 'ifIndex' => $ifIndex, 'direction' => $dir, 'carIndex' => $carIndex }; $car->{'configType'} = $ccarConfigTypeTranslation{ $ccarConfigType->{$INDEX} }; $car->{'accIdx'} = $ccarConfigAccIdx->{$INDEX}; $car->{'rate'} = $ccarConfigRate->{$INDEX}; $car->{'limit'} = $ccarConfigLimit->{$INDEX}; $car->{'extLimit'} = $ccarConfigExtLimit->{$INDEX}; $car->{'conformAction'} = $ccarActionTranslation{ $ccarConfigConformAction->{$INDEX} }; $car->{'exceedAction'} = $ccarActionTranslation{ $ccarConfigExceedAction->{$INDEX} }; $data->{'ccar'}{$INDEX} = $car; } } } if( $devdetails->paramDisabled('CiscoIOS::disable-vpdn-stats') ) { if( $dd->checkSnmpTable( 'cvpdnSystemTunnelTotal' ) ) { # Find the Tunnel type my $cvpdnSystemTunnelTotal = $dd->walkSnmpTable('cvpdnSystemTunnelTotal'); if( scalar(keys %{$cvpdnSystemTunnelTotal}) > 0 ) { $devdetails->setCap('ciscoVPDN'); # VPDN indexing: 1: l2f, 2: l2tp, 3: pptp foreach my $typeIndex (keys %{$cvpdnSystemTunnelTotal}) { Debug("CISCO-VPDN-MGMT-MIB: found Tunnel type " . $tunnelType{$typeIndex} ); $data->{'ciscoVPDN'}{$typeIndex} = $tunnelType{$typeIndex}; } } } } if( $devdetails->paramDisabled('CiscoIOS::disable-3g-stats') ) { my $table = $dd->walkSnmpTable('c3gStandard'); while( my( $phy, $val ) = each %{$table} ) { if( $val == 2 ) { $devdetails->setCap('Cisco3G'); my $phyName = $data->{'entityPhysical'}{$phy}{'name'}; if( not defined( $phyName ) ) { $phyName = 'Cellular Modem'; } $data->{'cisco3G'}{$phy} = { 'name' => $phyName, 'standard' => 'gsm', }; } else { Warn('CISCO-WAN-3G-MIB: CDMA statistics are ' . 'not yet implemented'); } } my $tokenset = $devdetails->paramString('CiscoIOS::3g-stats-tokenset'); if( $tokenset ne '') { $data->{'cisco3G_tokenset'} = $tokenset; } } if( $devdetails->paramDisabled('CiscoIOS::disable-port-qos-stats') ) { my $table = $dd->walkSnmpTable('cportQosDropPkts'); if( scalar(keys %{$table}) > 0 ) { $devdetails->setCap('CiscoPortQos'); $data->{'ciscoPortQos'} = {}; foreach my $qos_entry (keys %{$table}) { my($ifIndex, $direction, $qos_index) = split(/\./o, $qos_entry); $data->{'ciscoPortQos'}{$qos_entry} = { 'ifIndex' => $ifIndex, 'direction' => ($direction==1)?'ingress':'egress', 'qosidx' => $qos_index, }; } } } if( $devdetails->paramEnabled('CiscoIOS::short-device-comment') and defined($data->{'param'}{'comment'}) ) { # Remove serials from device comment # 1841 chassis, Hw Serial#: 3625140487, Hw Revision: 6.0 $data->{'param'}{'comment'} =~ s/, Hw.*//o; } return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); if( $devdetails->hasCap('CiscoBGP') ) { my $countersNode = $cb->addSubtree( $devNode, 'BGP_Prefixes', { 'node-display-name' => 'BGP Prefixes', 'comment' => 'Accepted prefixes', } ); foreach my $INDEX ( sort { $data->{'cbgpPeers'}{$a}{'subtreeName'} cmp $data->{'cbgpPeers'}{$b}{'subtreeName'} } keys %{$data->{'cbgpPeers'}} ) { my $peer = $data->{'cbgpPeers'}{$INDEX}; my $param = { 'peer-index' => $INDEX, 'peer-ipaddr' => $peer->{'peerIP'}, 'comment' => $peer->{'description'}, 'descriptive-nickname' => $peer->{'subtreeName'}, 'precedence' => 65000 - $peer->{'peerAS'} }; if( defined( $peer->{'prefixLimit'} ) and $peer->{'prefixLimit'} > 0 ) { $param->{'upper-limit'} = $peer->{'prefixLimit'}; $param->{'graph-upper-limit'} = $peer->{'prefixLimit'} * 1.03; } $cb->addLeaf ( $countersNode, $peer->{'subtreeName'}, $param, ['CiscoIOS::cisco-bgp'] ); } } if( $devdetails->hasCap('CiscoCAR') ) { my $countersNode = $cb->addSubtree( $devNode, 'CAR_Stats', { 'comment' => 'Committed Access Rate statistics', 'node-display-name' => 'CAR', }, ['CiscoIOS::cisco-car-subtree']); foreach my $INDEX ( sort keys %{$data->{'ccar'}} ) { my $car = $data->{'ccar'}{$INDEX}; my $interface = $data->{'interfaces'}{$car->{'ifIndex'}}; my $subtreeName = $interface->{$data->{'nameref'}{'ifSubtreeName'}}; $subtreeName .= ($car->{'direction'} == 1) ? '_IN':'_OUT'; if( $car->{'carIndex'} > 1 ) { $subtreeName .= '_' . $car->{'carIndex'}; } my $ifParam = { 'searchable' => 'yes', 'car-direction' => $car->{'direction'}, 'car-index' => $car->{'carIndex'} }; $ifParam->{'interface-name'} = $interface->{$data->{'nameref'}{'ifReferenceName'}}; $ifParam->{'interface-nick'} = $interface->{$data->{'nameref'}{'ifNick'}}; $ifParam->{'node-display-name'} = $interface->{$data->{'nameref'}{'ifReferenceName'}}; if( defined($data->{'nameref'}{'ifComment'}) and defined($interface->{$data->{'nameref'}{'ifComment'}}) ) { $ifParam->{'comment'} = $interface->{$data->{'nameref'}{'ifComment'}}; } my $legend = sprintf("Type: %s;", $car->{'configType'}); if( $car->{'accIdx'} > 0 ) { $legend .= sprintf("Access list: %d;", $car->{'accIdx'}); } if( defined($car->{'rate'}) ) { $legend .= sprintf('Rate: %d bps;', $car->{'rate'}); } if( defined($car->{'limit'}) ) { $legend .= sprintf('Limit: %d bytes;', $car->{'limit'}); } if( defined($car->{'extLimit'}) ) { $legend .= sprintf('Ext limit: %d bytes;', $car->{'extLimit'}); } if( defined($car->{'conformAction'}) ) { $legend .= sprintf('Conform action: %s;', $car->{'conformAction'}); } if( defined($car->{'exceedAction'}) ) { $legend .= sprintf('Exceed action: %s', $car->{'exceedAction'}); } $ifParam->{'legend'} = $legend; $cb->addSubtree ( $countersNode, $subtreeName, $ifParam, ['CiscoIOS::cisco-car']); } } if( $devdetails->hasCap('ciscoVPDN') ) { my $tunnelNode = $cb->addSubtree ( $devNode, 'VPDN_Statistics', {'node-display-name' => 'VPDN Statistics', 'comment' => 'VPDN tunnel and session counters'}, [ 'CiscoIOS::cisco-vpdn-subtree' ] ); foreach my $INDEX ( sort keys %{$data->{'ciscoVPDN'}} ) { my $tunnelProtocol = $data->{'ciscoVPDN'}{$INDEX}; $cb->addSubtree( $tunnelNode, $tunnelProtocol, { 'comment' => $tunnelProtocol . ' information', 'tunIndex' => $INDEX, 'tunFile' => lc($tunnelProtocol) }, [ 'CiscoIOS::cisco-vpdn-leaf' ] ); } } if( $devdetails->hasCap('Cisco3G') ) { foreach my $phy ( sort keys %{$data->{'cisco3G'}} ) { my @templates; my $summary_leaf; if( $data->{'cisco3G'}{$phy}{'standard'} eq 'gsm' ) { push(@templates, 'CiscoIOS::cisco-3g-gsm-stats'); $summary_leaf = 'RSSI'; } my $phyName = $data->{'cisco3G'}{$phy}{'name'}; my $subtreeName = $phyName; $subtreeName =~ s/\W/_/go; my $subtree = $cb->addSubtree ( $devNode, $subtreeName, { 'node-display-name' => $phyName, 'comment' => '3G cellular statistics', 'cisco-3g-phy' => $phy, 'cisco-3g-phyname' => $phyName, '3gcell-nodeid' => 'cell//%nodeid-device%//' . $phy, 'nodeid' => '%3gcell-nodeid%', }, \@templates ); if( defined($data->{'cisco3G_tokenset'}) ) { $cb->addLeaf ($subtree, $summary_leaf, {'tokenset-member' => $data->{'cisco3G_tokenset'}}); } } } if( $devdetails->hasCap('CiscoPortQos') ) { my $subtreeNode = $cb->addSubtree ( $devNode, 'Port_QoS', {'node-display-name' => 'QoS drop statistics'} ); my $precedence = 1000; foreach my $qos_entry (sort keys %{$data->{'ciscoPortQos'}}) { my $entry = $data->{'ciscoPortQos'}{$qos_entry}; my $interface = $data->{'interfaces'}{$entry->{'ifIndex'}}; next unless defined($interface); next if $interface->{'excluded'}; my $leafName = $interface->{$data->{'nameref'}{'ifSubtreeName'}} . '_' . $entry->{'direction'} . '_drops'; my $intfName = $interface->{$data->{'nameref'}{'ifReferenceName'}}; my $intfNick = $interface->{$data->{'nameref'}{'ifNick'}}; my $params = { 'cisco-pqos-entry' => $qos_entry, 'cisco-pqos-ifnick' => $intfNick, 'cisco-pqos-direction' => $entry->{'direction'}, 'graph-legend' => 'Dropped packets', 'precedence' => $precedence--, }; $params->{'node-display-name'} = $intfName . ' ' . $entry->{'direction'} . ' drops'; $params->{'graph-title'} = $params->{'descriptive-nickname'} = '%system-id% ' . $intfName . ' ' . $entry->{'direction'} . ' drops'; $cb->addLeaf($subtreeNode, $leafName, $params, ['CiscoIOS::cisco-port-qos-packets']); } } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/Alteon.pm0000644000175000017500000001255113131663307015763 00000000000000# # Discovery module for Alteon devices # # Copyright (C) 2007 Jon Nistor # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Jon Nistor # package Torrus::DevDiscover::Alteon; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'Alteon'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; # pmodule-dependend OIDs are presented for module #1 only. # currently devices with more than one module do not exist our %oiddef = ( # ALTEON-PRIVATE-MIBS 'alteonOID' => '1.3.6.1.4.1.1872.1', 'hwPartNumber' => '1.3.6.1.4.1.1872.2.1.1.1.0', 'hwRevision' => '1.3.6.1.4.1.1872.2.1.1.2.0', 'agSoftwareVersion' => '1.3.6.1.4.1.1872.2.1.2.1.7.0', 'agEnabledSwFeatures' => '1.3.6.1.4.1.1872.2.1.2.1.25.0', 'slbCurCfgRealServerName' => '1.3.6.1.4.1.1872.2.1.5.2.1.12', 'slbNewCfgRealServerName' => '1.3.6.1.4.1.1872.2.1.5.3.1.13', 'slbCurCfgGroupName' => '1.3.6.1.4.1.1872.2.1.5.10.1.7', 'slbNewCfgGroupName' => '1.3.6.1.4.1.1872.2.1.5.11.1.10', 'slbStatPortMaintPortIndex' => '1.3.6.1.4.1.1872.2.1.8.2.1.1.1', 'slbStatVServerIndex' => '1.3.6.1.4.1.1872.2.1.8.2.7.1.3', ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'alteonOID', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { return 0; } $devdetails->setCap('interfaceIndexingPersistent'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); # Get the system info and display it in the comment my $alteonInfo = $dd->retrieveSnmpOIDs ( 'hwPartNumber', 'hwRevision', 'agSoftwareVersion', 'agEnabledSwFeatures', 'sysDescr' ); $data->{'param'}{'comment'} = $alteonInfo->{'sysDescr'} . ", Hw Serial#: " . $alteonInfo->{'hwPartNumber'} . ", Hw Revision: " . $alteonInfo->{'hwRevision'} . ", " . $alteonInfo->{'agEnabledSwFeatures'} . ", Version: " . $alteonInfo->{'agSoftwareVersion'}; # PROG: Discover slbStatVServerIndex (Virtual Server index) my $virtTable = $session->get_table ( -baseoid => $dd->oiddef('slbStatVServerIndex') ); $devdetails->storeSnmpVars( $virtTable ); foreach my $virtIndex ( $devdetails->getSnmpIndices( $dd->oiddef('slbStatVServerIndex') ) ) { Debug("Alteon::vserver Found index $virtIndex"); $data->{'VSERVER'}{$virtIndex} = 1; } # PROG: SLB Port Maintenance Statistics Table my $maintTable = $session->get_table ( -baseoid => $dd->oiddef('slbStatPortMaintPortIndex') ); $devdetails->storeSnmpVars( $maintTable ); foreach my $mIndex ( $devdetails->getSnmpIndices ( $dd->oiddef('slbStatPortMaintPortIndex') ) ) { Debug("Alteon::maintTable Index: $mIndex"); $data->{'MAINT'}{$mIndex} = 1; } return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); $cb->addTemplateApplication($devNode, 'Alteon::alteon-cpu'); $cb->addTemplateApplication($devNode, 'Alteon::alteon-mem'); $cb->addTemplateApplication($devNode, 'Alteon::alteon-packets'); $cb->addTemplateApplication($devNode, 'Alteon::alteon-sensor'); # PROG: Virtual Server information my $virtNode = $cb->addSubtree( $devNode, 'VirtualServer_Stats', { 'comment' => 'Stats per Virtual Server' }, [ 'Alteon::alteon-vserver-subtree'] ); foreach my $virtIndex ( sort {$a <=> $b } keys %{$data->{'VSERVER'}} ) { $cb->addSubtree( $virtNode, 'VirtualHost_' . $virtIndex, { 'alteon-vserver-index' => $virtIndex }, [ 'Alteon::alteon-vserver'] ); } # PROG: SLB Port Maintenance Statistics Table my $maintNode = $cb->addSubtree( $devNode, 'Port_Maintenance_Stats', { 'comment' => 'SLB port maintenance statistics' }, [ 'Alteon::alteon-maint-subtree'] ); foreach my $mIndex ( sort {$a <=> $b } keys %{$data->{'MAINT'}} ) { $cb->addSubtree( $maintNode, 'Port_' . $mIndex, { 'alteon-maint-index' => $mIndex }, [ 'Alteon::alteon-maint'] ); } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/RFC2790_HOST_RESOURCES.pm0000644000175000017500000002306513131663307017766 00000000000000# Copyright (C) 2003 Shawn Ferry, Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Shawn Ferry # Stanislav Sinyagin # Standard HOST_RESOURCES_MIB discovery, which should apply to most hosts. # The CPU indexing is not persistent, and may change after the target host # reboot. This needs a re-discover, and the old CPU usage data may be lost. package Torrus::DevDiscover::RFC2790_HOST_RESOURCES; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'RFC2790_HOST_RESOURCES'} = { 'sequence' => 100, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; # define the oids that are needed to determine support, # capabilities and information about the device our %oiddef = ( 'hrSystemUptime' => '1.3.6.1.2.1.25.1.1.0', 'hrSystemNumUsers' => '1.3.6.1.2.1.25.1.5.0', 'hrSystemProcesses' => '1.3.6.1.2.1.25.1.6.0', 'hrSystemMaxProcesses' => '1.3.6.1.2.1.25.1.7.0', 'hrMemorySize' => '1.3.6.1.2.1.25.2.2.0', 'hrStorageTable' => '1.3.6.1.2.1.25.2.3.1', 'hrStorageIndex' => '1.3.6.1.2.1.25.2.3.1.1', 'hrStorageType' => '1.3.6.1.2.1.25.2.3.1.2', 'hrStorageDescr' => '1.3.6.1.2.1.25.2.3.1.3', 'hrStorageAllocationUnits' => '1.3.6.1.2.1.25.2.3.1.4', 'hrStorageSize' => '1.3.6.1.2.1.25.2.3.1.5', 'hrStorageUsed' => '1.3.6.1.2.1.25.2.3.1.6', 'hrStorageAllocationFailures' => '1.3.6.1.2.1.25.2.3.1.7', 'hrProcessorLoad' => '1.3.6.1.2.1.25.3.3.1.2', ); our %storageDescTranslate = ( '/' => {'subtree' => 'root' } ); # storage type names from MIB my %storageTypes = ( 1 => 'Other Storage', 2 => 'Physical Memory (RAM)', 3 => 'Virtual Memory', 4 => 'Fixed Disk', 5 => 'Removable Disk', 6 => 'Floppy Disk', 7 => 'Compact Disk', 8 => 'RAM Disk', 9 => 'Flash Memory', 10 => 'Network File System' ); our $storageGraphTop; our $storageHiMark; sub checkdevtype { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); return $dd->checkSnmpOID('hrSystemUptime'); } sub discover { my $dd = shift; my $devdetails = shift; my $data = $devdetails->data(); my $session = $dd->session(); if( $dd->checkSnmpOID('hrSystemNumUsers') ) { $devdetails->setCap('hrSystemNumUsers'); } if( $dd->checkSnmpOID('hrSystemProcesses') ) { $devdetails->setCap('hrSystemProcesses'); } # hrStorage support my $hrStorageTable = $session->get_table( -baseoid => $dd->oiddef('hrStorageTable') ); if( defined( $hrStorageTable ) ) { $devdetails->storeSnmpVars( $hrStorageTable ); $data->{'hrStorage'} = {}; foreach my $INDEX ( $devdetails->getSnmpIndices($dd->oiddef('hrStorageIndex') ) ) { my $typeNum = $devdetails->snmpVar( $dd->oiddef('hrStorageType') . '.' . $INDEX ); $typeNum =~ s/^[0-9.]+\.(\d+)$/$1/; my $descr = $devdetails->snmpVar($dd->oiddef('hrStorageDescr') . '.' . $INDEX); my $used = $devdetails->snmpVar($dd->oiddef('hrStorageUsed') . '.' . $INDEX); if( defined( $used ) and $storageTypes{$typeNum} ) { my $ref = { 'param' => {}, 'templates' => [] }; $data->{'hrStorage'}{$INDEX} = $ref; my $param = $ref->{'param'}; $param->{'storage-description'} = $descr; my $comment = $storageTypes{$typeNum}; if( $descr =~ /^\// ) { $comment .= ' (' . $descr . ')'; } $param->{'comment'} = $comment; if( $storageDescTranslate{$descr}{'subtree'} ) { $descr = $storageDescTranslate{$descr}{'subtree'}; } $descr =~ s/^\///; $descr =~ s/\W/_/g; $param->{'storage-nick'} = $descr; my $units = $devdetails->snmpVar ($dd->oiddef('hrStorageAllocationUnits') . '.' . $INDEX); $param->{'collector-scale'} = sprintf('%d,*', $units); my $size = $devdetails->snmpVar ($dd->oiddef('hrStorageSize') . '.' . $INDEX); if( $size ) { if( $storageGraphTop > 0 ) { $param->{'graph-upper-limit'} = sprintf('%e', $units * $size * $storageGraphTop / 100 ); } if( $storageHiMark > 0 ) { $param->{'upper-limit'} = sprintf('%e', $units * $size * $storageHiMark / 100 ); } } push( @{ $ref->{'templates'} }, 'RFC2790_HOST_RESOURCES::hr-storage-usage' ); } } if( scalar( keys %{$data->{'hrStorage'}} ) > 0 ) { $devdetails->setCap('hrStorage'); } } # hrProcessor support { my $base = $dd->oiddef('hrProcessorLoad'); my $table = $session->get_table( -baseoid => $base ); if( defined($table) ) { $data->{'hrProcessors'} = []; my $prefixLen = length( $base ) + 1; while( my( $oid, $load ) = each %{$table} ) { push( @{$data->{'hrProcessors'}}, substr( $oid, $prefixLen )); } if( scalar( @{$data->{'hrProcessors'}} ) > 0 ) { $devdetails->setCap('hrProcessor'); } } } return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); { # Anon sub for System Performance my $subtreeName = $devdetails->paramString ('RFC2790_HOST_RESOURCES::sysperf-subtree-name'); if( $subtreeName eq '' ) { $subtreeName = 'System_Performance'; $devdetails->setParam ('RFC2790_HOST_RESOURCES::sysperf-subtree-name', $subtreeName); } my @templates = ('RFC2790_HOST_RESOURCES::hr-system-performance-subtree'); unless( $devdetails->paramEnabled('RFC2790_HOST_RESOURCES::suppress-uptime') ) { push( @templates, 'RFC2790_HOST_RESOURCES::hr-system-uptime' ); }; if( $devdetails->hasCap('hrSystemNumUsers') ) { push( @templates, 'RFC2790_HOST_RESOURCES::hr-system-num-users' ); } if( $devdetails->hasCap('hrSystemProcesses') ) { push( @templates, 'RFC2790_HOST_RESOURCES::hr-system-processes' ); } my $subtreeNode = $cb->addSubtree( $devNode, $subtreeName, {}, \@templates ); if( $devdetails->hasCap('hrProcessor') ) { foreach my $INDEX ( sort {$a<=>$b} @{$data->{'hrProcessors'}} ) { my $cpuName = 'CPU_' . $INDEX . '_Load'; my $param = { 'cpu-id' => $INDEX, 'node-display-name' => 'CPU ' . $INDEX . ' Load', 'precedence' => sprintf("%d", 1000 - $INDEX), }; $cb->addLeaf( $subtreeNode, $cpuName, $param, ['RFC2790_HOST_RESOURCES::hr-processor-load']); } } } if( $devdetails->hasCap('hrStorage') ) { # Build hrstorage subtree my $subtreeName = 'Storage_Used'; my $param = {}; my @templates = ('RFC2790_HOST_RESOURCES::hr-storage-subtree'); my $subtreeNode = $cb->addSubtree( $devNode, $subtreeName, $param, \@templates ); foreach my $INDEX ( sort {$a<=>$b} keys %{$data->{'hrStorage'}} ) { my $ref = $data->{'hrStorage'}{$INDEX}; #Display in index order, This is generally good(tm) $ref->{'param'}->{'precedence'} = sprintf("%d", 1000 - $INDEX); $cb->addLeaf( $subtreeNode, $ref->{'param'}{'storage-nick'}, $ref->{'param'}, $ref->{'templates'} ); } } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/FTOS.pm0000644000175000017500000002651113131663307015315 00000000000000# # Copyright (C) 2009 Jon Nistor # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Jon Nistor # Force10 Networks Real Time Operating System Software # # NOTE: FTOS::disable-cpu # FTOS::disable-power # FTOS::disable-temperature # FTOS::use-fahrenheit # FTOS::file-per-sensor (affects both power and temperature) package Torrus::DevDiscover::FTOS; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'FTOS'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( # FORCE10-SMI 'f10Products' => '1.3.6.1.4.1.6027.1', # F10-CHASSIS-MIB 'chType' => '1.3.6.1.4.1.6027.3.1.1.1.1.0', 'chSerialNumber' => '1.3.6.1.4.1.6027.3.1.1.1.2.0', 'chSysPowerSupplyIndex' => '1.3.6.1.4.1.6027.3.1.1.2.1.1.1', 'chSysCardSlotIndex' => '1.3.6.1.4.1.6027.3.1.1.2.3.1.1', 'chSysCardNumber' => '1.3.6.1.4.1.6027.3.1.1.2.3.1.3', 'chRpmCpuIndex' => '1.3.6.1.4.1.6027.3.1.1.3.7.1.1', # FORCE10-SYSTEM-COMPONENT-MIB 'camUsagePartDesc' => '1.3.6.1.4.1.6027.3.7.1.1.1.1.4' ); our %f10ChassisType = ( '1' => 'Force10 E1200 16-slot switch/router', '2' => 'Force10 E600 9-slot switch/router', '3' => 'Force10 E300 8-slot switch/router', '4' => 'Force10 E150 8-slot switch/router', '5' => 'Force10 E610 9-slot switch/router', '6' => 'Force10 C150 6-slot switch/router', '7' => 'Force10 C300 10-slot switch/router', '8' => 'Force10 E1200i 16-slot switch/router', '9' => 'Force10 S2410 10GbE switch', '10' => 'Force10 S2410 10GbE switch', '11' => 'Force10 S50 access switch', '12' => 'Force10 S50e access switch', '13' => 'Force10 S50v access switch', '14' => 'Force10 S50nac access switch', '15' => 'Force10 S50ndc access switch', '16' => 'Force10 S25pdc access switch', '17' => 'Force10 S25pac access switch', '18' => 'Force10 S25v access switch', '19' => 'Force10 S25n access switch' ); our %f10CPU = ( '1' => 'Control Processor', '2' => 'Routing Processor #1', '3' => 'Routing Processor #2' ); # Not all interfaces are normally needed to monitor. # You may override the interface filtering in devdiscover-siteconfig.pl: # redefine $Torrus::DevDiscover::FTOS::interfaceFilter # or define $Torrus::DevDiscover::FTOS::interfaceFilterOverlay our $interfaceFilter; our $interfaceFilterOverlay; my %ftosInterfaceFilter; if( not defined( $interfaceFilter ) ) { $interfaceFilter = \%ftosInterfaceFilter; } # Key is some unique symbolic name, does not mean anything # ifType is the number to match the interface type # ifDescr is the regexp to match the interface description %ftosInterfaceFilter = ( 'other' => { 'ifType' => 1, # other }, 'loopback' => { 'ifType' => 24, # softwareLoopback }, ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'f10Products', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { return 0; } # Systems running FTOS will have chassisType, SFTOS will not. if( not $dd->checkSnmpOID('chType') ) { return 0; } &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, $interfaceFilter); if( defined( $interfaceFilterOverlay ) ) { &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, $interfaceFilterOverlay); } $devdetails->setCap('interfaceIndexingPersistent'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); # NOTE: Comments and Serial number of device my $chassisSerial = $dd->retrieveSnmpOIDs( 'chType', 'chSerialNumber' ); if( defined( $chassisSerial ) ) { $data->{'param'}{'comment'} = $f10ChassisType{$chassisSerial->{'chType'}} . ', Hw Serial#: ' . $chassisSerial->{'chSerialNumber'}; } else { $data->{'param'}{'comment'} = "Force10 Networks switch/router"; } # PROG: CPU statistics if( $devdetails->paramDisabled('FTOS::disable-cpu') ) { # Poll table to translate the CPU Index to a Name my $ftosCpuTable = $session->get_table( -baseoid => $dd->oiddef('chRpmCpuIndex') ); $devdetails->storeSnmpVars( $ftosCpuTable ); if( defined( $ftosCpuTable ) ) { $devdetails->setCap('ftosCPU'); # Find the index of the CPU foreach my $ftosCPUidx ( $devdetails->getSnmpIndices ( $dd->oiddef('chRpmCpuIndex') ) ) { my $cpuType = $dd->oiddef('chRpmCpuIndex') . "." . $ftosCPUidx; my $cpuName = $f10CPU{$ftosCpuTable->{$cpuType}}; Debug("FTOS::CPU index $ftosCPUidx, $cpuName"); # Construct the data ... $data->{'ftosCPU'}{$ftosCPUidx} = $cpuName; } } else { Debug("FTOS::CPU No CPU information found, old sw?"); } } # END: CPU # PROG: Power Supplies if( $devdetails->paramDisabled('FTOS::disable-power') ) { # Poll table of power supplies my $ftosPSUTable = $session->get_table( -baseoid => $dd->oiddef('chSysPowerSupplyIndex') ); $devdetails->storeSnmpVars( $ftosPSUTable ); if( defined( $ftosPSUTable ) ) { $devdetails->setCap('ftosPSU'); # Find the Index of the Power Supplies foreach my $ftosPSUidx ( $devdetails->getSnmpIndices ($dd->oiddef('chSysPowerSupplyIndex')) ) { Debug("FTOS::PSU index $ftosPSUidx"); push( @{$data->{'ftosPSU'}}, $ftosPSUidx ); } } } # END: PSU # PROG: Temperature if( $devdetails->paramDisabled('FTOS::disable-sensors') ) { # Check if temperature sensors are supported my $sensorTable = $session->get_table( -baseoid => $dd->oiddef('chSysCardSlotIndex') ); $devdetails->storeSnmpVars( $sensorTable ); my $sensorCard = $session->get_table( -baseoid => $dd->oiddef('chSysCardNumber') ); $devdetails->storeSnmpVars( $sensorCard ); if( defined( $sensorTable ) ) { $devdetails->setCap('ftosSensor'); foreach my $sensorIdx ( $devdetails->getSnmpIndices ( $dd->oiddef('chSysCardSlotIndex') ) ) { my $sensor = $devdetails->snmpVar( $dd->oiddef('chSysCardNumber') . '.' . $sensorIdx ); $data->{'ftosSensor'}{$sensorIdx} = $sensor; Debug("FTOS::Sensor index $sensorIdx, card $sensor"); } } # END if: $sensorTable } # END: disable-sensors return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); # PROG: CPU processing if( $devdetails->hasCap('ftosCPU') ) { my $nodeTop = $cb->addSubtree( $devNode, 'CPU_Usage', undef, [ 'FTOS::ftos-cpu-subtree'] ); foreach my $CPUidx ( sort {$a <=> $b} keys %{$data->{'ftosCPU'}} ) { my $CPUName = $data->{'ftosCPU'}{$CPUidx}; my $subName = sprintf( 'CPU_%.2d', $CPUidx ); my $nodeCPU = $cb->addSubtree( $nodeTop, $subName, { 'comment' => $CPUName, 'cpu-index' => $CPUidx, 'cpu-name' => $CPUName }, [ 'FTOS::ftos-cpu' ] ); } } # END if ftosCPU # PROG: Power supplies if( $devdetails->hasCap('ftosPSU') ) { my $subtreeName = "Power_Supplies"; my $param = { 'comment' => 'Power supplies status', 'precedence' => -600 }; my $filePerSensor = $devdetails->paramEnabled('FTOS::file-per-sensor'); my $templates = []; $param->{'data-file'} = '%snmp-host%_power' . ($filePerSensor ? '_%power-index%':'') . '.rrd'; my $nodeTop = $cb->addSubtree( $devNode, $subtreeName, $param, $templates ); foreach my $PSUidx ( sort {$a <=> $b} @{$data->{'ftosPSU'}} ) { my $leafName = sprintf( 'power_%.2d', $PSUidx ); my $nodePSU = $cb->addLeaf( $nodeTop, $leafName, { 'power-index' => $PSUidx }, [ 'FTOS::ftos-power-supply-leaf' ]); } } # PROG: Temperature sensors if( $devdetails->hasCap('ftosSensor') ) { my $subtreeName = "Temperature_Sensors"; my $subtreeParam = {}; my $fahrenheit = $devdetails->paramEnabled('FTOS::use-fahrenheit'); my $filePerSensor = $devdetails->paramEnabled('FTOS::file-per-sensor'); $subtreeParam->{'data-file'} = '%snmp-host%_sensors' . ($filePerSensor ? '_%sensor-index%':'') . ($fahrenheit ? '_fahrenheit':'') . '.rrd'; my $subtreeNode = $cb->addSubtree( $devNode, $subtreeName, $subtreeParam, ['FTOS::ftos-temperature-subtree'] ); foreach my $sIndex ( sort {$a<=>$b} keys %{$data->{'ftosSensor'}} ) { my $leafName = sprintf( 'sensor_%.2d', $sIndex ); my $threshold = 60; # Forced value for the time being, 60 degC my $sensorCard = $data->{'ftosSensor'}{$sIndex}; if( $fahrenheit ) { $threshold = $threshold * 1.8 + 32; } my $param = { 'sensor-index' => $sIndex, 'sensor-description' => 'Module ' . $sensorCard, 'upper-limit' => $threshold }; my $templates = ['FTOS::ftos-temperature-sensor' . ($fahrenheit ? '-fahrenheit':'')]; $cb->addLeaf( $subtreeNode, $leafName, $param, $templates ); } } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/AxxessIT.pm0000644000175000017500000003026713131663307016255 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # AxxessIT Ethernet over SDH switches, also known as # Cisco ONS 15305 and 15302 (by January 2005) # Probably later Cisco will update the software and it will need # another Torrus discovery module. # Company website: http://www.axxessit.no/ # Tested with: # # Cisco ONS 15305 software release 1.1.1 # Cisco ONS 15302 package Torrus::DevDiscover::AxxessIT; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'AxxessIT'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( # AXXEDGE-MIB 'axxEdgeTypes' => '1.3.6.1.4.1.7546.1.4.1.1', 'axxEdgeWanPortMapTable' => '1.3.6.1.4.1.7546.1.4.1.2.5.1.2', 'axxEdgeWanPortMapSlotNumber' => '1.3.6.1.4.1.7546.1.4.1.2.5.1.2.1.1', 'axxEdgeWanPortMapPortNumber' => '1.3.6.1.4.1.7546.1.4.1.2.5.1.2.1.2', 'axxEdgeWanXPortMapTable' => '1.3.6.1.4.1.7546.1.4.1.2.5.1.11', 'axxEdgeWanXPortMapSlotNumber' => '1.3.6.1.4.1.7546.1.4.1.2.5.1.11.1.1', 'axxEdgeWanXPortMapPortNumber' => '1.3.6.1.4.1.7546.1.4.1.2.5.1.11.1.2', 'axxEdgeWanPortDescription' => '1.3.6.1.4.1.7546.1.4.1.2.5.1.3.1.4', 'axxEdgeWanXPortDescription' => '1.3.6.1.4.1.7546.1.4.1.2.5.1.12.1.4', 'axxEdgeEthPortMapTable' => '1.3.6.1.4.1.7546.1.4.1.2.6.1.2', 'axxEdgeEthPortMapSlotNumber' => '1.3.6.1.4.1.7546.1.4.1.2.6.1.2.1.1', 'axxEdgeEthPortMapPortNumber' => '1.3.6.1.4.1.7546.1.4.1.2.6.1.2.1.2', 'axxEdgeEthLanXPortMapTable' => '1.3.6.1.4.1.7546.1.4.1.2.6.1.4', 'axxEdgeEthLanXPortMapSlotNumber' => '1.3.6.1.4.1.7546.1.4.1.2.6.1.4.1.1', 'axxEdgeEthLanXPortMapPortNumber' => '1.3.6.1.4.1.7546.1.4.1.2.6.1.4.1.2', 'axxEdgeEthPortDescription' => '1.3.6.1.4.1.7546.1.4.1.2.6.1.3.1.4', 'axxEdgeEthLanXPortDescription' => '1.3.6.1.4.1.7546.1.4.1.2.6.1.5.1.4', 'axxEdgeDcnManagementPortMode' => '1.3.6.1.4.1.7546.1.4.1.2.3.2.1.0', 'axxEdgeDcnManagementPortIfIndex' => '1.3.6.1.4.1.7546.1.4.1.2.3.2.2.0', # AXX155E-MIB (ONS 15302) 'axx155EDevices' => '1.3.6.1.4.1.7546.1.5.1.1', 'axx155EEthPortTable' => '1.3.6.1.4.1.7546.1.5.1.2.6.1.2', 'axx155EEthPortIfIndex' => '1.3.6.1.4.1.7546.1.5.1.2.6.1.2.1.2', 'axx155EEthPortName' => '1.3.6.1.4.1.7546.1.5.1.2.6.1.2.1.3', 'axx155EEthPortType' => '1.3.6.1.4.1.7546.1.5.1.2.6.1.2.1.4', 'axx155EDcnManagementPortMode' => '1.3.6.1.4.1.7546.1.5.1.2.2.2.2.0', 'axx155EDcnManagementPortIfIndex' => '1.3.6.1.4.1.7546.1.5.1.2.2.2.3.0' ); sub checkdevtype { my $dd = shift; my $devdetails = shift; my $sysObjID = $devdetails->snmpVar( $dd->oiddef('sysObjectID') ); if( not defined($sysObjID) ) { return 0; } if( index( $sysObjID, $dd->oiddef('axxEdgeTypes') ) == 0 ) { $devdetails->setCap('axxEdge'); } elsif( index( $sysObjID, $dd->oiddef('axx155EDevices') ) == 0 ) { $devdetails->setCap('axx155E'); } else { return 0; } $devdetails->setCap('interfaceIndexingManaged'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $data = $devdetails->data(); my $session = $dd->session(); $data->{'param'}{'ifindex-map'} = '$IFIDX_IFINDEX'; $data->{'nameref'}{'ifNick'} = 'axxInterfaceNick'; $data->{'nameref'}{'ifSubtreeName'} = 'axxInterfaceNick'; $data->{'nameref'}{'ifComment'} = 'axxInterfaceComment'; $data->{'nameref'}{'ifReferenceName'} = 'axxInterfaceHumanName'; if( $devdetails->hasCap('axxEdge') ) { my %map = ( 'Wan' => { 'MapTable' => 'axxEdgeWanPortMapTable', 'MapSlotNumber' => 'axxEdgeWanPortMapSlotNumber', 'MapPortNumber' => 'axxEdgeWanPortMapPortNumber', 'Description' => 'axxEdgeWanPortDescription', 'ifNick' => 'Wan_%d_%d', 'ifHuman' => 'WAN %d/%d', 'ifComment' => 'WAN slot %d, port %d' }, 'WanX' => { 'MapTable' => 'axxEdgeWanXPortMapTable', 'MapSlotNumber' => 'axxEdgeWanXPortMapSlotNumber', 'MapPortNumber' => 'axxEdgeWanXPortMapPortNumber', 'Description' => 'axxEdgeWanXPortDescription', 'ifNick' => 'WanX_%d_%d', 'ifHuman' => 'WANX %d/%d', 'ifComment' => 'WANX slot %d, port %d' }, 'Eth' => { 'MapTable' => 'axxEdgeEthPortMapTable', 'MapSlotNumber' => 'axxEdgeEthPortMapSlotNumber', 'MapPortNumber' => 'axxEdgeEthPortMapPortNumber', 'Description' => 'axxEdgeEthPortDescription', 'ifNick' => 'Eth_%d_%d', 'ifHuman' => 'Ethernet %d/%d', 'ifComment' => 'Ethernet interface: slot %d, port %d' }, 'EthLanX' => { 'MapTable' => 'axxEdgeEthLanXPortMapTable', 'MapSlotNumber' => 'axxEdgeEthLanXPortMapSlotNumber', 'MapPortNumber' => 'axxEdgeEthLanXPortMapPortNumber', 'Description' => 'axxEdgeEthLanXPortDescription', 'ifNick' => 'EthLanX_%d_%d', 'ifHuman' => 'Ethernet LANX %d/%d', 'ifComment' => 'Ethernet LANX interface: slot %d, port %d' } ); foreach my $type ( keys %map ) { my $mapTable = $session->get_table( -baseoid => $dd->oiddef($map{$type}{'MapTable'}) ); $devdetails->storeSnmpVars( $mapTable ); my $descTable = $session->get_table( -baseoid => $dd->oiddef($map{$type}{'Description'}) ); $devdetails->storeSnmpVars( $descTable ); foreach my $ifIndex ( $devdetails-> getSnmpIndices($dd->oiddef($map{$type}{'MapSlotNumber'})) ) { my $interface = $data->{'interfaces'}{$ifIndex}; next if not defined( $interface ); my $slot = $devdetails->snmpVar ($dd->oiddef($map{$type}{'MapSlotNumber'}) .'.'. $ifIndex); my $port = $devdetails->snmpVar ($dd->oiddef($map{$type}{'MapPortNumber'}) .'.'. $ifIndex); my $desc = $devdetails->snmpVar ($dd->oiddef($map{$type}{'Description'}) .'.'. $slot .'.'. $port); $interface->{'param'}{'interface-index'} = $ifIndex; $interface->{'axxInterfaceNick'} = sprintf( $map{$type}{'ifNick'}, $slot, $port ); $interface->{'axxInterfaceHumanName'} = sprintf( $map{$type}{'ifHuman'}, $slot, $port ); $interface->{'axxInterfaceComment'} = sprintf( $map{$type}{'ifComment'}, $slot, $port ); if( defined($desc) and $desc ne '' ) { $interface->{'axxInterfaceComment'} .= ' (' . $desc . ')'; } } } # Management interface { my $result = $dd->retrieveSnmpOIDs ( 'axxEdgeDcnManagementPortMode', 'axxEdgeDcnManagementPortIfIndex'); if( defined( $result ) ) { if( $result->{'axxEdgeDcnManagementPortMode'} != 2 ) { Warning('Non-IP mode of Management port is not supported'); } else { my $ifIndex = $result->{'axxEdgeDcnManagementPortIfIndex'}; my $interface = $data->{'interfaces'}{$ifIndex}; $interface->{'param'}{'interface-index'} = $ifIndex; $interface->{'axxInterfaceNick'} = 'Management'; $interface->{'axxInterfaceHumanName'} = 'Management'; $interface->{'axxInterfaceComment'} = 'Management port'; } } } } if( $devdetails->hasCap('axx155E') ) { my $ethTable = $session->get_table( -baseoid => $dd->oiddef('axx155EEthPortTable') ); $devdetails->storeSnmpVars( $ethTable ); foreach my $port ( $devdetails-> getSnmpIndices($dd->oiddef('axx155EEthPortIfIndex')) ) { my $ifIndex = $devdetails->snmpVar ($dd->oiddef('axx155EEthPortIfIndex') .'.'. $port); my $interface = $data->{'interfaces'}{$ifIndex}; next if not defined( $interface ); my $portName = $devdetails->snmpVar ($dd->oiddef('axx155EEthPortName') .'.'. $port); my $portType = $devdetails->snmpVar ($dd->oiddef('axx155EEthPortType') .'.'. $port); $interface->{'param'}{'interface-index'} = $ifIndex; my $type = $portType == 1 ? 'Eth':'Wan'; $interface->{'axxInterfaceNick'} = sprintf( '%s_%d', $type, $port ); $interface->{'axxInterfaceHumanName'} = sprintf( '%s %d', $type, $port ); $interface->{'axxInterfaceComment'} = ''; if( defined($portName) and $portName ne '' ) { $interface->{'axxInterfaceComment'} = $portName; } } # Management interface { my $result = $dd->retrieveSnmpOIDs ( 'axx155EDcnManagementPortMode', 'axx155EDcnManagementPortIfIndex'); if( defined( $result ) ) { if( $result->{'axx155EDcnManagementPortMode'} != 2 ) { Warning('Non-IP mode of Management port is not supported'); } else { my $ifIndex = $result->{'axx155EDcnManagementPortIfIndex'}; my $interface = $data->{'interfaces'}{$ifIndex}; $interface->{'param'}{'interface-index'} = $ifIndex; $interface->{'axxInterfaceNick'} = 'Management'; $interface->{'axxInterfaceHumanName'} = 'Management'; $interface->{'axxInterfaceComment'} = 'Management port'; } } } } foreach my $ifIndex ( keys %{$data->{'interfaces'}} ) { if( not defined( $data->{'interfaces'}{$ifIndex}-> {'param'}{'interface-index'} ) ) { delete $data->{'interfaces'}{$ifIndex}; } } return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/Symmetricom.pm0000644000175000017500000000516613131663307017055 00000000000000# # Discovery module for Symmetricom # # Copyright (C) 2007 Jon Nistor # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Jon Nistor # # Symmetricom package Torrus::DevDiscover::Symmetricom; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'Symmetricom'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( # SYMM-SMI 'syncServer' => '1.3.6.1.4.1.9070.1.2.3.1.5', 'sysDescr' => '1.3.6.1.2.1.1.1.0', 'ntpSysSystem' => '1.3.6.1.4.1.9070.1.2.3.1.5.1.1.14.0', 'etcSerialNbr' => '1.3.6.1.4.1.9070.1.2.3.1.5.1.6.2.0', 'etcModel' => '1.3.6.1.4.1.9070.1.2.3.1.5.1.6.3.0', ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'syncServer', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { return 0; } $devdetails->setCap('interfaceIndexingPersistent'); $devdetails->setDevType('UcdSnmp'); # Force load Ucd return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); # SNMP: Get the system info and display it in the comment my $ntpComment = $dd->retrieveSnmpOIDs ( 'sysDescr', 'ntpSysSystem', 'etcSerialNbr', 'etcModel' ); $data->{'ntp'} = $ntpComment; $data->{'param'}{'comment'} = $ntpComment->{'ntpSysSystem'} . " " . $ntpComment->{'etcModel'} . ", Hw Serial#: " . $ntpComment->{'etcSerialNbr'}; return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); $cb->addTemplateApplication($devNode, 'Symmetricom::ntp-stats'); return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/Arista.pm0000644000175000017500000000670513131663307015770 00000000000000# # Copyright (C) 2009 Jon Nistor # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Jon Nistor # Force10 Networks Real Time Operating System Software # # NOTE: Arista::x package Torrus::DevDiscover::Arista; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'Arista'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( 'sysDescr' => '1.3.6.1.2.1.1.1.0', # Arista 'aristaProducts' => '1.3.6.1.4.1.30065.1' ); # Not all interfaces are normally needed to monitor. # You may override the interface filtering in devdiscover-siteconfig.pl: # redefine $Torrus::DevDiscover::Arista::interfaceFilter # or define $Torrus::DevDiscover::Arista::interfaceFilterOverlay our $interfaceFilter; our $interfaceFilterOverlay; my %aristaInterfaceFilter; if( not defined( $interfaceFilter ) ) { $interfaceFilter = \%aristaInterfaceFilter; } # Key is some unique symbolic name, does not mean anything # ifType is the number to match the interface type # ifDescr is the regexp to match the interface description %aristaInterfaceFilter = ( 'other' => { 'ifType' => 1, # other }, 'lag' => { 'ifType' => 161, # ieee 802.3ad LAG groups # added due to index too high }, 'loopback' => { 'ifType' => 24, # softwareLoopback }, 'vlan' => { 'ifType' => 136, # vlan # added due to index too high }, ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'aristaProducts', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { return 0; } &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, $interfaceFilter); if( defined( $interfaceFilterOverlay ) ) { &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter ($devdetails, $interfaceFilterOverlay); } $devdetails->setCap('interfaceIndexingPersistent'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); # PROG: Add comment for sysDescr my $desc = $dd->retrieveSnmpOIDs('sysDescr'); $data->{'param'}{'comment'} = $desc->{'sysDescr'}; return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/F5BigIp.pm0000644000175000017500000004461413131663307015733 00000000000000# Copyright (C) 2012 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # F5 BIG-IP versions 10.x and higher # Tested with LTM version 11.0 package Torrus::DevDiscover::F5BigIp; use strict; use warnings; use Digest::MD5 qw(md5_hex); use Torrus::Log; $Torrus::DevDiscover::registry{'F5BigIp'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( # F5-BIGIP-COMMON-MIB 'f5_bigipTrafficMgmt' => '1.3.6.1.4.1.3375.2', # F5-BIGIP-SYSTEM-MIB 'f5_sysPlatformInfoMarketingName' => '1.3.6.1.4.1.3375.2.1.3.5.2.0', 'f5_sysProductVersion' => '1.3.6.1.4.1.3375.2.1.4.2.0', 'f5_sysProductBuild' => '1.3.6.1.4.1.3375.2.1.4.3.0', 'f5_sysGlobalHostMemTotal' => '1.3.6.1.4.1.3375.2.1.1.2.20.2.0', 'f5_sysMultiHostHostId' => '1.3.6.1.4.1.3375.2.1.7.4.2.1.1', 'f5_sysMultiHostTotal' => '1.3.6.1.4.1.3375.2.1.7.4.2.1.2', 'f5_sysMultiHostCpuId' => '1.3.6.1.4.1.3375.2.1.7.5.2.1.3', 'f5_sysInterfaceName' => '1.3.6.1.4.1.3375.2.1.2.4.1.2.1.1', 'f5_sysInterfaceEnabled' => '1.3.6.1.4.1.3375.2.1.2.4.1.2.1.8', 'f5_sysInterfaceStatus' => '1.3.6.1.4.1.3375.2.1.2.4.1.2.1.17', # F5-BIGIP-LOCAL-MIB -- LTM stats 'ltmNodeAddrNumber' => '1.3.6.1.4.1.3375.2.2.4.1.1.0', 'ltmNodeAddrStatNodeName' => '1.3.6.1.4.1.3375.2.2.4.2.3.1.20', 'ltmPoolNumber' => '1.3.6.1.4.1.3375.2.2.5.1.1.0', 'ltmPoolStatName' => '1.3.6.1.4.1.3375.2.2.5.2.3.1.1', 'ltmPoolMemberStatPoolName' => '1.3.6.1.4.1.3375.2.2.5.4.3.1.1', 'ltmPoolMemberStatNodeName' => '1.3.6.1.4.1.3375.2.2.5.4.3.1.28', 'ltmPoolMemberStatPort' => '1.3.6.1.4.1.3375.2.2.5.4.3.1.4', 'ltmVirtualServNumber' => '1.3.6.1.4.1.3375.2.2.10.1.1.0', 'ltmVirtualServStatName' => '1.3.6.1.4.1.3375.2.2.10.2.3.1.1', ); my @f5_sys_oidlist = ( 'f5_sysPlatformInfoMarketingName', 'f5_sysProductVersion', 'f5_sysProductBuild', ); my $f5InterfaceFilter = { 'LOOPBACK' => { 'ifType' => 24, # softwareLoopback }, }; my %ltm_category_templates = ( 'Nodes' => ['F5BigIp::ltm-node-statistics', 'F5BigIp::f5-object-statistics'], 'Pools' => ['F5BigIp::ltm-pool-statistics', 'F5BigIp::f5-object-statistics'], 'VServers' => ['F5BigIp::ltm-vserver-statistics', 'F5BigIp::f5-object-statistics'], ); my %ltm_category_comment = ( 'Nodes' => 'Per-node statistics', 'Pools' => 'Pool statistics', 'VServers' => 'Virtual server statistics', ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'f5_bigipTrafficMgmt', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { return 0; } $devdetails->setParam('RFC2863_IF_MIB::disable-all', 'yes'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $data = $devdetails->data(); my $session = $dd->session(); $data->{'param'}{'snmp-oids-per-pdu'} = 10; my $old_maxrepetitions = $dd->{'maxrepetitions'}; $dd->{'maxrepetitions'} = 3; # Common system information { my $result = $dd->retrieveSnmpOIDs(@f5_sys_oidlist); if( defined($result) ) { my $sysref = {}; foreach my $oidname ( @f5_sys_oidlist ) { my $val = $result->{$oidname}; if( defined($val) and length($val) > 0 ) { $sysref->{$oidname} = $val; } else { $sysref->{$oidname} = 'N/A'; } } $data->{'param'}{'comment'} = $sysref->{'f5_sysPlatformInfoMarketingName'} . ', Version ' . $sysref->{'f5_sysProductVersion'} . ', Build ' . $sysref->{'f5_sysProductBuild'}; } $result = $dd->retrieveSnmpOIDs('f5_sysGlobalHostMemTotal'); if( defined($result) and $result->{'f5_sysGlobalHostMemTotal'} > 0 ) { $data->{'param'}{'f5-global-host-memtotal'} = $result->{'f5_sysGlobalHostMemTotal'}; push( @{$data->{'templates'}}, 'F5BigIp::f5-global-host' ); } if( $devdetails->paramEnabled('F5BigIp::multi-host-stats') ) { my $hostID = $dd->walkSnmpTable('f5_sysMultiHostHostId'); my $hostMem = $dd->walkSnmpTable('f5_sysMultiHostTotal'); while( my( $hINDEX, $memsize ) = each %{$hostMem} ) { $data->{'f5_host'}{$hINDEX}{'memtotal'} = $memsize; $data->{'f5_host'}{$hINDEX}{'hostid'} = $hostID->{$hINDEX}; } foreach my $hINDEX (keys %{$data->{'f5_host'}}) { my $cpus = $dd->walkSnmpTable('f5_sysMultiHostCpuId'); while( my( $cINDEX, $id ) = each %{$cpus} ) { $cINDEX = substr($cINDEX, length($hINDEX)+1); $data->{'f5_host'}{$hINDEX}{'cpu'}{$cINDEX} = $id; } } } } # 64bit traffic counters for interfaces { $data->{'f5_ports'} = {}; my $ifNames = $dd->walkSnmpTable('f5_sysInterfaceName'); # sysInterfaceEnabled: # false(0), # true(1) # sysInterfaceStatus: # up(0), # down(1), # uninitialized(3), # unpopulated(5) my $ifEnabled = $dd->walkSnmpTable('f5_sysInterfaceEnabled'); my $ifStatus = $dd->walkSnmpTable('f5_sysInterfaceStatus'); foreach my $INDEX (keys %{$ifNames}) { if( $ifEnabled->{$INDEX} == 1 and $ifStatus->{$INDEX} <= 1 ) { my $name = $ifNames->{$INDEX}; my $sortIndex = 0; my $scale = 1; foreach my $part (reverse split(/\W/, $name)) { my $x = 0; if( $part =~ /^\d+$/ ) { $x = $part; } $sortIndex += $x * $scale; $scale *= 1000; } $data->{'f5_ports'}{$INDEX} = { 'name' => $name, 'order' => $sortIndex, }; } } } # Check LTM capabilities { my $result = $dd->retrieveSnmpOIDs( 'ltmNodeAddrNumber', 'ltmPoolNumber', 'ltmVirtualServNumber'); if( defined($result->{'ltmNodeAddrNumber'}) and $result->{'ltmNodeAddrNumber'} > 0 ) { $devdetails->setCap('F5_LTM_Nodes'); } if( defined($result->{'ltmPoolNumber'}) and $result->{'ltmPoolNumber'} > 0 ) { $devdetails->setCap('F5_LTM_Pools'); } if( defined($result->{'ltmVirtualServNumber'}) and $result->{'ltmVirtualServNumber'} > 0 ) { $devdetails->setCap('F5_LTM_VServers'); } } $data->{'ltm'} = {}; if( $devdetails->hasCap('F5_LTM_Nodes') ) { my $names = $dd->walkSnmpTable('ltmNodeAddrStatNodeName'); while( my( $INDEX, $fullname ) = each %{$names} ) { if( $fullname =~ /^\/([^\/]+)\/(.+)$/o ) { my $partition = $1; my $node = $2; $data->{'ltm'}{$partition}{'Nodes'}{$node} = { 'f5-object-fullname' => $fullname, 'f5-object-nameidx' => $INDEX, 'f5-object-shortname' => $node, }; } } } if( $devdetails->hasCap('F5_LTM_Pools') ) { my $names = $dd->walkSnmpTable('ltmPoolStatName'); while( my( $INDEX, $fullname ) = each %{$names} ) { if( $fullname =~ /^\/([^\/]+)\/(.+)$/o ) { my $partition = $1; # the full name may consist of 3 parts if it's generated # by application template. We drop the middle part # (template name) my $pool = $2; if( $pool =~ /^[^\/]+\/(.+)$/ ) { $pool = $1; } $data->{'ltm'}{$partition}{'Pools'}{$pool} = { 'f5-object-fullname' => $fullname, 'f5-object-nameidx' => $INDEX, 'f5-object-shortname' => $pool, }; } } # Get the pool members my $poolnames = $dd->walkSnmpTable('ltmPoolMemberStatPoolName'); my $nodenames = $dd->walkSnmpTable('ltmPoolMemberStatNodeName'); my $ports = $dd->walkSnmpTable('ltmPoolMemberStatPort'); while( my( $INDEX, $poolname ) = each %{$poolnames} ) { if( $poolname !~ /^\/([^\/]+)\/(.+)$/o ) { next; } my $partition = $1; # the full name may consist of 3 parts if it's generated # by application template. We drop the middle part # (template name) my $pool = $2; if( $pool =~ /^[^\/]+\/(.+)$/ ) { $pool = $1; } my $nodename = $nodenames->{$INDEX}; # Node name consists of /Partition/Name if( $nodename !~ /^\/([^\/]+)\/(.+)$/o ) { next; } my $node = $2; my $port = $ports->{$INDEX}; next unless (defined($port) and $port > 0 ); $data->{'ltm_poolmembers'}{$partition}{$pool}{$node}{$port} = { 'f5-object-fullname' => join(':', $partition, $pool,$node,$port), 'f5-object-nameidx' => $INDEX, 'f5-object-shortname' => $node . ':' . $port, }; } } if( $devdetails->hasCap('F5_LTM_VServers') ) { my $names = $dd->walkSnmpTable('ltmVirtualServStatName'); while( my( $INDEX, $fullname ) = each %{$names} ) { if( $fullname =~ /^\/([^\/]+)\/(.+)$/o ) { my $partition = $1; # the full name may consist of 3 parts if it's generated # by application template. We drop the middle part # (template name) my $srv = $2; if( $srv =~ /^[^\/]+\/(.+)$/ ) { $srv = $1; } $data->{'ltm'}{$partition}{'VServers'}{$srv} = { 'f5-object-fullname' => $fullname, 'f5-object-nameidx' => $INDEX, 'f5-object-shortname' => $srv, }; } } } $dd->{'maxrepetitions'} = $old_maxrepetitions; return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); if( defined($data->{'f5_host'}) ) { foreach my $hINDEX (keys %{$data->{'f5_host'}}) { my $hostSubtree = 'Host ' . $data->{'f5_host'}{$hINDEX}{'hostid'}; my $params = { 'node-display-name' => $hostSubtree, 'comment' => 'BigIP host', 'f5-host-index' => $hINDEX, 'f5-host-memtotal' => $data->{'f5_host'}{$hINDEX}{'memtotal'}, }; $hostSubtree =~ s/\W/_/g; my $hostNode = $cb->addSubtree ( $devNode, $hostSubtree, $params, ['F5BigIp::f5-multihost-host']); my $cpusNode = $cb->addSubtree ( $hostNode, 'CPU', {}, ['F5BigIp::f5-multihost-cpu-subtree']); foreach my $cINDEX (sort {$a<=>$b} keys %{$data->{'f5_host'}{$hINDEX}{'cpu'}}) { my $id = $data->{'f5_host'}{$hINDEX}{'cpu'}{$cINDEX}; my $params = { 'f5-cpu-index' => $cINDEX, 'f5-cpu-id' => $id, }; $cb->addSubtree ( $cpusNode, $id, $params, ['F5BigIp::f5-multihost-cpu']); } } } if( defined($data->{'f5_ports'}) ) { my $statsNode = $cb->addSubtree ( $devNode, 'Interface_Counters', {}, ['F5BigIp::f5-interface-counters-subtree']); foreach my $INDEX ( sort {$data->{'f5_ports'}{$a}{'order'} <=> $data->{'f5_ports'}{$b}{'order'}} keys %{$data->{'f5_ports'}} ) { my $name = $data->{'f5_ports'}{$INDEX}{'name'}; my $ifSubtree = $name; $ifSubtree =~ s/\W/_/g; my $order = $data->{'f5_ports'}{$INDEX}{'order'}; my $nodeid = 'f5-if//%nodeid-device%//' . $name; my $params = { 'node-display-name' => $name, 'f5-interface-index' => $INDEX, 'f5-interface-name' => $name, 'nodeid-interface' => $nodeid, 'nodeid' => $nodeid, 'precedence' => (0 - $order), }; $cb->addSubtree($statsNode, $ifSubtree, $params, ['F5BigIp::f5-interface']); } } my $p_precedence = 10000; foreach my $partition (sort keys %{$data->{'ltm'}}) { $p_precedence--; my $partParams = { 'node-display-name' => $partition, 'precedence' => $p_precedence, 'comment' => 'BigIP partition', }; my $partSubtree = $partition; $partSubtree =~ s/\W+/_/g; my $partitionNode = $cb->addSubtree( $devNode, $partSubtree, $partParams ); foreach my $category (sort keys %{$data->{'ltm'}{$partition}}) { my $catParams = { 'comment' => $ltm_category_comment{$category}, }; my $categoryNode = $cb->addSubtree( $partitionNode, $category, $catParams, ['F5BigIp::f5-category-subtree'] ); foreach my $object (sort keys %{$data->{'ltm'}{$partition}{$category}}) { my $objParam = { 'node-display-name' => $object, }; my $ref = $data->{'ltm'}{$partition}{$category}{$object}; while( my($p, $v) = each %{$ref} ) { $objParam->{$p} = $v; } $objParam->{'f5-object-md5'} = md5_hex($objParam->{'f5-object-fullname'}); my $objSubtree = $object; $objSubtree =~ s/\W/_/g; $cb->addSubtree( $categoryNode, $objSubtree, $objParam, $ltm_category_templates{$category}); } } # Pool members if( defined($data->{'ltm_poolmembers'}{$partition}) and scalar(keys %{$data->{'ltm_poolmembers'}{$partition}}) > 0 ) { my $m_precedence = 1000; my $membersNode = $cb->addSubtree( $partitionNode, 'Pool_Members', { 'node-display-name' => 'Pool Members', 'comment' => 'Pool member statistics', } ); foreach my $pool (sort keys %{$data->{'ltm_poolmembers'}{$partition}}) { my $ref1 = $data->{'ltm_poolmembers'}{$partition}{$pool}; my $poolSubtree = $pool; $poolSubtree =~ s/\W/_/g; my $poolNode = $cb->addSubtree( $membersNode, $poolSubtree, { 'node-display-name' => $pool, }, ['F5BigIp::f5-category-subtree'] ); foreach my $node (sort keys %{$ref1}) { foreach my $port (sort {$a <=> $b} keys %{$ref1->{$node}}) { $m_precedence--; my $objParam = { 'node-display-name' => $node . ':' . $port, 'precedence' => $m_precedence, }; my $ref = $ref1->{$node}{$port}; while( my($p, $v) = each %{$ref} ) { $objParam->{$p} = $v; } $objParam->{'f5-object-md5'} = md5_hex($objParam->{'f5-object-fullname'}); my $objSubtree = $node . ':' . $port; $objSubtree =~ s/\W/_/g; $cb->addSubtree( $poolNode, $objSubtree, $objParam, ['F5BigIp::ltm-poolmember-statistics', 'F5BigIp::f5-object-statistics']); } } } } } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/NetApp.pm0000644000175000017500000001225513131663307015731 00000000000000# Copyright (C) 2004 Shawn Ferry # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Shawn Ferry # NetApp.com storage products package Torrus::DevDiscover::NetApp; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'NetApp'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( 'netapp' => '1.3.6.1.4.1.789', 'netapp1' => '1.3.6.1.4.1.789.1', 'netappProducts' => '1.3.6.1.4.1.789.2', # netapp product 'netapp_product' => '1.3.6.1.4.1.789.1.1', 'netapp_productVersion' => '1.3.6.1.4.1.789.1.1.2.0', 'netapp_productId' => '1.3.6.1.4.1.789.1.1.3.0', 'netapp_productModel' => '1.3.6.1.4.1.789.1.1.5.0', 'netapp_productFirmwareVersion' => '1.3.6.1.4.1.789.1.1.6.0', # netapp sysstat 'netapp_sysStat' => '1.3.6.1.4.1.789.1.2', 'netapp_sysStat_cpuCount' => '1.3.6.1.4.1.789.1.2.1.6.0', # netapp nfs 'netapp_nfs' => '1.3.6.1.4.1.789.1.3', 'netapp_nfsIsLicensed' => '1.3.6.1.4.1.789.1.3.3.1.0', # At a glance Lookup values seem to be the most common as opposed to # collecting NFS stats for v2 and v3 (and eventually v4 ) if No lookups # have been performed at discovery time we assume that vX is not in use. 'netapp_tv2cLookups' => '1.3.6.1.4.1.789.1.3.2.2.3.1.5.0', 'netapp_tv3cLookups' => '1.3.6.1.4.1.789.1.3.2.2.4.1.4.0', # netapp CIFS 'netapp_cifs' => '1.3.6.1.4.1.789.1.7', 'netapp_cifsIsLicensed' => '1.3.6.1.4.1.789.1.7.21.0', # 4 - 19 should also be interesting # particularly cluster netcache stats ); # netappFiler OBJECT IDENTIFIER ::= { netappProducts 1 } # netappNetCache OBJECT IDENTIFIER ::= { netappProducts 2 } # netappClusteredFiler OBJECT IDENTIFIER ::= { netappProducts 3 } sub checkdevtype { my $dd = shift; my $devdetails = shift; return $dd->checkSnmpTable( 'netapp' ); } sub discover { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); my $result = $dd->retrieveSnmpOIDs ( 'netapp_productModel', 'netapp_productId', 'netapp_productVersion', 'netapp_productFirmwareVersion', 'netapp_nfsIsLicensed', 'netapp_cifsIsLicensed', 'netapp_tv2cLookups', 'netapp_tv3cLookups' ); $data->{'param'}->{'comment'} = sprintf('%s %s: %s %s', $result->{'netapp_productModel'}, $result->{'netapp_productId'}, $result->{'netapp_productVersion'}, $result->{'netapp_productFirmwareVersion'}); # At a glance Lookup values seem to be the most common as opposed to # collecting NFS stats for v2 and v3 (and eventually v4 ) if No lookups # have been performed at discovery time we assume that nfsvX is not in use. if( $result->{'netapp_nfsIsLicensed'} == 2 ) { if( $result->{'netapp_tv2cLookups'} > 0 ) { $devdetails->setCap('NetApp::nfsv2'); } if( $result->{'netapp_tv3cLookups'} > 0 ) { $devdetails->setCap('NetApp::nfsv3'); } } if( $result->{'netapp_cifsIsLicensed'} == 2 ) { $devdetails->setCap('NetApp::cifs'); } return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); $cb->addParams( $devNode, $data->{'params'} ); # Add CPU Template $cb->addTemplateApplication( $devNode, 'NetApp::CPU'); # Add Misc Stats $cb->addTemplateApplication( $devNode, 'NetApp::misc'); if( $devdetails->hasCap('NetApp::nfsv2') ) { $cb->addTemplateApplication( $devNode, 'NetApp::nfsv2'); } if( $devdetails->hasCap('NetApp::nfsv3') ) { $cb->addTemplateApplication( $devNode, 'NetApp::nfsv3'); } if( $devdetails->hasCap('NetApp::cifs') ) { Debug("Would add cifs here\n"); #$cb->addTemplateApplication( $devNode, 'NetApp::cifs'); } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/RFC2670_DOCS_IF.pm0000644000175000017500000002512213131663307016656 00000000000000# Copyright (C) 2002 Stanislav Sinyagin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Stanislav Sinyagin # DOCSIS interface statistics package Torrus::DevDiscover::RFC2670_DOCS_IF; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'RFC2670_DOCS_IF'} = { 'sequence' => 100, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; $Torrus::DevDiscover::RFC2863_IF_MIB::knownSelectorActions{ 'DocsisUpSNRMonitor'} = 'RFC2670_DOCS_IF'; $Torrus::DevDiscover::RFC2863_IF_MIB::knownSelectorActions{ 'DocsisUpSNRTokenset'} = 'RFC2670_DOCS_IF'; $Torrus::DevDiscover::RFC2863_IF_MIB::knownSelectorActions{ 'DocsisUpFECCorMonitor'} = 'RFC2670_DOCS_IF'; $Torrus::DevDiscover::RFC2863_IF_MIB::knownSelectorActions{ 'DocsisUpFECUncorMonitor'} = 'RFC2670_DOCS_IF'; $Torrus::DevDiscover::RFC2863_IF_MIB::knownSelectorActions{ 'DocsisDownUtilMonitor'} = 'RFC2670_DOCS_IF'; our %oiddef = ( # DOCS-IF-MIB 'docsIfDownstreamChannelTable' => '1.3.6.1.2.1.10.127.1.1.1', 'docsIfCmtsDownChannelCounterTable' => '1.3.6.1.2.1.10.127.1.3.10', 'docsIfSigQSignalNoise' => '1.3.6.1.2.1.10.127.1.1.4.1.5', ); sub checkdevtype { my $dd = shift; my $devdetails = shift; my $session = $dd->session(); my $data = $devdetails->data(); if( $dd->checkSnmpTable( 'docsIfDownstreamChannelTable' ) ) { return 1; } return 0; } sub discover { my $dd = shift; my $devdetails = shift; my $data = $devdetails->data(); my $session = $dd->session(); if( $dd->checkSnmpTable( 'docsIfCmtsDownChannelCounterTable' ) ) { $devdetails->setCap('docsDownstreamUtil'); } my $snrTable = $dd->walkSnmpTable('docsIfSigQSignalNoise'); $data->{'docsCableMaclayer'} = []; $data->{'docsCableDownstream'} = []; $data->{'docsCableUpstream'} = []; $data->{'docsCableUpstreamPhy'} = []; foreach my $ifIndex ( sort {$a<=>$b} keys %{$data->{'interfaces'}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; my $ifType = $interface->{'ifType'}; $interface->{'docsTemplates'} = []; $interface->{'docsParams'} = {}; if( $devdetails->hasCap('interfaceIndexingPersistent') ) { $interface->{'docsParams'}{'interface-index'} = $ifIndex; } if( $ifType == 127 ) { push( @{$data->{'docsCableMaclayer'}}, $ifIndex ); } elsif( $ifType == 128 ) { push( @{$data->{'docsCableDownstream'}}, $ifIndex ); if( $devdetails->hasCap('docsDownstreamUtil') ) { push( @{$interface->{'docsTemplates'}}, 'RFC2670_DOCS_IF::docsis-downstream-util' ); } } elsif( $ifType == 129 or $ifType == 205 ) { if( defined($snrTable->{$ifIndex}) ) { push( @{$data->{'docsCableUpstream'}}, $ifIndex ); push( @{$interface->{'docsTemplates'}}, 'RFC2670_DOCS_IF::docsis-upstream-stats' ); } else { push( @{$data->{'docsCableUpstreamPhy'}}, $ifIndex ); } } } $data->{'docsConfig'} = { 'docsCableMaclayer' => { 'subtreeName' => 'Docsis_MAC_Layer', 'nodeidCategory' => 'docsmac', 'templates' => [], 'param' => { 'node-display-name' => 'DOCSIS MAC Layer', }, }, 'docsCableDownstream' => { 'subtreeName' => 'Docsis_Downstream', 'nodeidCategory' => 'docsds', 'templates' => [], 'param' => { 'node-display-name' => 'DOCSIS Downstream', }, }, 'docsCableUpstream' => { 'subtreeName' => 'Docsis_Upstream', 'nodeidCategory' => 'docsus', 'templates' => ['RFC2670_DOCS_IF::docsis-upstream-subtree'], 'param' => { 'node-display-name' => 'DOCSIS Upstream', }, }, }; if( $devdetails->paramEnabled ('RFC2670_DOCS_IF::suppress-all-cable-stats') ) { # Completely exclude all DOCSIS interfaces from any collection foreach my $category ( keys %{$data->{'docsConfig'}}, 'docsCableUpstreamPhy' ) { foreach my $ifIndex ( @{$data->{$category}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; $interface->{'excluded'} = 1; } } } if( $devdetails->paramEnabled('RFC2670_DOCS_IF::upstreams-only') ) { $data->{'docsCableMaclayer'} = []; $data->{'docsCableDownstream'} = []; } if( $devdetails->paramEnabled('RFC2670_DOCS_IF::disable-downstreams') ) { $data->{'docsCableDownstream'} = []; } if( $devdetails->hasCap('docsDownstreamUtil') and scalar(@{$data->{'docsCableDownstream'}}) > 0 ) { push( @{$data->{'docsConfig'}{'docsCableDownstream'}{'templates'}}, 'RFC2670_DOCS_IF::docsis-downstream-subtree' ); } return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); foreach my $category ( sort keys %{$data->{'docsConfig'}} ) { if( scalar( @{$data->{$category}} ) > 0 and scalar( @{$data->{'docsConfig'}{$category}{'templates'}} ) > 0 ) { # Count non-excluded interfaces my $updatedInterfaceList = []; foreach my $ifIndex ( @{$data->{$category}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; next if $interface->{'excluded'}; push( @{$updatedInterfaceList}, $ifIndex ); } $data->{$category} = $updatedInterfaceList; next if scalar( @{$data->{$category}} ) == 0; my $subtreeNode = $cb->addSubtree( $devNode, $data->{'docsConfig'}{$category}{ 'subtreeName'}, $data->{'docsConfig'}{$category}{ 'param'}, $data->{'docsConfig'}{$category}{ 'templates'}); foreach my $ifIndex ( @{$data->{$category}} ) { my $interface = $data->{'interfaces'}{$ifIndex}; my $ifParam = $interface->{'docsParams'}; $ifParam->{'searchable'} = 'yes'; # Copy some parameters from IF-MIB discovery results foreach my $p ('interface-name', 'interface-nick', 'node-display-name') { $ifParam->{$p} = $interface->{'param'}{$p}; } my $comment = $interface->{'param'}{'comment'}; if( defined($comment) and $comment ne '' ) { $ifParam->{'comment'} = $comment; } $ifParam->{'nodeid-docsif'} = $data->{'docsConfig'}{$category}{'nodeidCategory'} . '//%nodeid-device%//' . $interface->{$data->{'nameref'}{'ifNodeid'}}; $ifParam->{'nodeid'} = '%nodeid-docsif%'; my $intfNode = $cb->addSubtree ( $subtreeNode, $interface->{$data->{'nameref'}{'ifSubtreeName'}}, $ifParam, $interface->{'docsTemplates'} ); # Apply selector actions if( $category eq 'docsCableUpstream' ) { my $monitor = $interface->{'selectorActions'}{'DocsisUpSNRMonitor'}; my $tset = $interface->{'selectorActions'}{'DocsisUpSNRTokenset'}; if( defined( $monitor ) or defined( $tset ) ) { my $param = {}; if( defined( $monitor ) ) { $param->{'monitor'} = $monitor; } if( defined( $tset ) ) { $param->{'tokenset-member'} = $tset; } $cb->addLeaf( $intfNode, 'SNR', $param ); } $monitor = $interface->{'selectorActions'}{ 'DocsisUpFECCorMonitor'}; if( defined( $monitor ) ) { $cb->addLeaf( $intfNode, 'Correctable', {'monitor' => $monitor } ); } $monitor = $interface->{'selectorActions'}{ 'DocsisUpFECUncorMonitor'}; if( defined( $monitor ) ) { $cb->addLeaf( $intfNode, 'Uncorrectable', {'monitor' => $monitor } ); } } elsif( $category eq 'docsCableDownstream') { my $monitor = $interface->{'selectorActions'}{ 'DocsisDownUtilMonitor'}; if( defined( $monitor ) ) { $cb->addLeaf( $intfNode, 'UsedBytes', {'monitor' => $monitor } ); } } } } } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/Jacarta.pm0000644000175000017500000001220013131663307016075 00000000000000# Copyright (C) 2010 Roman Hochuli # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Sensor-MIBs of Jacarta iMeter-Products package Torrus::DevDiscover::Jacarta; use strict; use warnings; use Torrus::Log; $Torrus::DevDiscover::registry{'Jacarta'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; our %oiddef = ( 'jacarta' => '1.3.6.1.4.1.19011', 'sensorEntry' => '1.3.6.1.4.1.19011.2.3.1.1', 'sensorIndex' => '1.3.6.1.4.1.19011.2.3.1.1.1', 'sensorDescription' => '1.3.6.1.4.1.19011.2.3.1.1.2', 'sensorType' => '1.3.6.1.4.1.19011.2.3.1.1.3', 'sensorValue' => '1.3.6.1.4.1.19011.2.3.1.1.4', 'sensorUnit' => '1.3.6.1.4.1.19011.2.3.1.1.5', ); our %sensor_types = ( 2 => { 'template' => 'Jacarta::imeter-humi-sensor', 'max' => 'NetBotz::humi-max', }, 3 => { 'template' => 'Jacarta::imeter-temp-sensor', 'max' => 'NetBotz::dew-max', }, 5 => { 'template' => 'Jacarta::imeter-amps-sensor', 'max' => 'NetBotz::dew-max', }, ); sub checkdevtype { my $dd = shift; my $devdetails = shift; if( not $dd->oidBaseMatch ( 'jacarta', $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) ) { return 0; } $devdetails->setCap('interfaceIndexingPersistent'); return 1; } sub discover { my $dd = shift; my $devdetails = shift; my $data = $devdetails->data(); my $session = $dd->session(); $data->{'Jacarta'} = {}; my $sensorTable = $session->get_table( -baseoid => $oiddef{'sensorEntry'} ); if( not defined( $sensorTable ) ) { return 1; } $devdetails->storeSnmpVars( $sensorTable ); # store the sensor names to guarantee uniqueness my %sensorNames; foreach my $INDEX ($devdetails->getSnmpIndices( $oiddef{'sensorIndex'} )) { my $sensorType = $devdetails->snmpVar( $oiddef{'sensorType'} . '.' . $INDEX); my $sensorName = $devdetails->snmpVar( $oiddef{'sensorDescription'} . '.' . $INDEX); if( not defined( $sensor_types{$sensorType} ) ) { Error('Sensor ' . $INDEX . ' of unknown type: ' . $sensorType); next; } if( $sensorNames{$sensorName} ) { Warn('Duplicate sensor names: ' . $sensorName); $sensorNames{$sensorName}++; } else { $sensorNames{$sensorName} = 1; } if( $sensorNames{$sensorName} > 1 ) { $sensorName .= sprintf(' %d', $INDEX); } my $leafName = $sensorName; $leafName =~ s/\W/_/g; my $param = { 'imeter-sensor-index' => $INDEX, 'node-display-name' => $sensorName, 'graph-title' => $sensorName, 'precedence' => sprintf('%d', 1000 - $INDEX) }; if( defined( $sensor_types{$sensorType}{'max'} ) ) { my $max = $devdetails->param($sensor_types{$sensorType}{'max'}); if( defined($max) and $max > 0 ) { $param->{'upper-limit'} = $max; } } $data->{'Jacarta'}{$INDEX} = { 'param' => $param, 'leafName' => $leafName, 'template' => $sensor_types{$sensorType}{'template'}}; Debug('Found Sensor ' . $INDEX . ' of type ' . $sensorType . ', named ' . $sensorName ); } return 1; } sub buildConfig { my $devdetails = shift; my $cb = shift; my $devNode = shift; my $data = $devdetails->data(); my $param = { 'node-display-name' => 'Sensors', 'comment' => 'All sensors connected via this iMeter Master', }; my $sensorTree = $cb->addSubtree( $devNode, 'Sensors', $param ); foreach my $INDEX ( sort {$a<=>$b} keys %{$data->{'Jacarta'}} ) { my $ref = $data->{'Jacarta'}{$INDEX}; $cb->addLeaf( $sensorTree, $ref->{'leafName'}, $ref->{'param'}, [$ref->{'template'}] ); } return; } 1; # Local Variables: # mode: perl # indent-tabs-mode: nil # perl-indent-level: 4 # End: torrus-3.00/lib/Torrus/DevDiscover/EmpireSystemedge.pm0000644000175000017500000010530313131663307020012 00000000000000# Copyright (C) 2003-2012 Shawn Ferry, Roman Hochuli # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # Shawn Ferry # Roman Hochuli package Torrus::DevDiscover::EmpireSystemedge; use strict; use Torrus::Log; use Data::Dumper; $Torrus::DevDiscover::registry{'EmpireSystemedge'} = { 'sequence' => 500, 'checkdevtype' => \&checkdevtype, 'discover' => \&discover, 'buildConfig' => \&buildConfig }; # define the oids that are needed to determine support, # capabilities and information about the device our %oiddef = ( 'empire' => '1.3.6.1.4.1.546', 'sysedge_opmode' => '1.3.6.1.4.1.546.1.1.1.17.0', 'empireSystemType' => '1.3.6.1.4.1.546.1.1.1.12.0', # Empire Cpu Table 'empireCpuStatsTable' => '1.3.6.1.4.1.546.13.1.1', 'empireCpuStatsIndex' => '1.3.6.1.4.1.546.13.1.1.1', 'empireCpuStatsDescr' => '1.3.6.1.4.1.546.13.1.1.2', # Empire Cpu Totals 'empireCpuTotalWait' => '1.3.6.1.4.1.546.13.5.0', # Empire Swap Counters 'empireNumPageSwapIns' => '1.3.6.1.4.1.546.1.1.7.8.18.0', # Empire Load Average 'empireLoadAverage' => '1.3.6.1.4.1.546.1.1.7.8.26.0', # Empire Device Table and Oids 'empireDevTable' => '1.3.6.1.4.1.546.1.1.1.7.1', 'empireDevIndex' => '1.3.6.1.4.1.546.1.1.1.7.1.1', 'empireDevMntPt' => '1.3.6.1.4.1.546.1.1.1.7.1.3', 'empireDevBsize' => '1.3.6.1.4.1.546.1.1.1.7.1.4', 'empireDevTblks' => '1.3.6.1.4.1.546.1.1.1.7.1.5', 'empireDevType' => '1.3.6.1.4.1.546.1.1.1.7.1.10', 'empireDevDevice' => '1.3.6.1.4.1.546.1.1.1.7.1.2', # Empire Device Stats Table and Oids 'empireDiskStatsTable' => '1.3.6.1.4.1.546.12.1.1', 'empireDiskStatsIndex' => '1.3.6.1.4.1.546.12.1.1.1', 'empireDiskStatsHostIndex' => '1.3.6.1.4.1.546.12.1.1.9', 'hrDeviceDescr' => '1.3.6.1.2.1.25.3.2.1.3', # Empire Performance and related oids 'empirePerformance' => '1.3.6.1.4.1.546.1.1.7', 'empireNumTraps' => '1.3.6.1.4.1.546.1.1.7.8.15.0', # Empire Process Stats 'empireRunq' => '1.3.6.1.4.1.546.1.1.7.8.4.0', 'empireDiskWait' => '1.3.6.1.4.1.546.1.1.7.8.5.0', 'empirePageWait' => '1.3.6.1.4.1.546.1.1.7.8.6.0', 'empireSwapActive' => '1.3.6.1.4.1.546.1.1.7.8.7.0', 'empireSleepActive' => '1.3.6.1.4.1.546.1.1.7.8.8.0', # Empire Extensions NTREGPERF 'empireNTREGPERF' => '1.3.6.1.4.1.546.5.7', 'empireDnlc' => '1.3.6.1.4.1.546.1.1.11', 'empireRpc' => '1.3.6.1.4.1.546.8.1', 'empireNfs' => '1.3.6.1.4.1.546.8.2', 'empireMon' => '1.3.6.1.4.1.546.6.1.1', 'empirePmon' => '1.3.6.1.4.1.546.15.1.1', 'empireLog' => '1.3.6.1.4.1.546.11.1.1', # Empire Service Response Extension 'empireSvcTable' => '1.3.6.1.4.1.546.16.6.10.1', 'empireSvcIndex' => '1.3.6.1.4.1.546.16.6.10.1.1', 'empireSvcDescr' => '1.3.6.1.4.1.546.16.6.10.1.2', 'empireSvcType' => '1.3.6.1.4.1.546.16.6.10.1.3', 'empireSvcTotRespTime' => '1.3.6.1.4.1.546.16.6.10.1.12', 'empireSvcAvailability' => '1.3.6.1.4.1.546.16.6.10.1.17', 'empireSvcConnTime' => '1.3.6.1.4.1.546.16.6.10.1.23', 'empireSvcTransTime' => '1.3.6.1.4.1.546.16.6.10.1.28', 'empireSvcThroughput' => '1.3.6.1.4.1.546.16.6.10.1.37', 'empireSvcDestination' => '1.3.6.1.4.1.546.16.6.10.1.45', ); our %storageDescTranslate = ( '/' => {'subtree' => 'root' } ); # template => 1 if specific templates for the name explicitly exist, # othewise the template used is based on ident # # Generally only hosts that have been directly observed should have # templates, the "unix" and "nt" templates are generally aiming for the # lowest common denominator. # # templates also need to be added to devdiscover-config.pl # # Templated "names" require a specific template for each of the # following base template types: #