Changeset 1265
- Timestamp:
- 11/29/06 17:55:05 (5 years ago)
- Files:
-
- people/ilmari/modularisation-branch/COPYING (modified) (1 diff)
- people/ilmari/modularisation-branch/ChangeLog (modified) (3 diffs)
- people/ilmari/modularisation-branch/Checklist (added)
- people/ilmari/modularisation-branch/INSTALL (modified) (2 diffs)
- people/ilmari/modularisation-branch/Makefile (modified) (14 diffs)
- people/ilmari/modularisation-branch/Makefile.config (modified) (3 diffs)
- people/ilmari/modularisation-branch/Makefile.config-dist (added)
- people/ilmari/modularisation-branch/Makefile.config-maint (added)
- people/ilmari/modularisation-branch/README (added)
- people/ilmari/modularisation-branch/README-apache-cgi.in (deleted)
- people/ilmari/modularisation-branch/README.api (deleted)
- people/ilmari/modularisation-branch/RELEASE (modified) (1 diff)
- people/ilmari/modularisation-branch/contrib (added)
- people/ilmari/modularisation-branch/contrib/munin-every-services-all-boxes-build-html.in (added)
- people/ilmari/modularisation-branch/dists/sunos/README (added)
- people/ilmari/modularisation-branch/monkeywrench (added)
- people/ilmari/modularisation-branch/monkeywrench/plugin-break-autoconf-die_ (added)
- people/ilmari/modularisation-branch/monkeywrench/plugin-break-autoconf-empty_ (added)
- people/ilmari/modularisation-branch/monkeywrench/plugin-break-suggest-die_ (added)
- people/ilmari/modularisation-branch/monkeywrench/plugin-break-suggest-empty_ (added)
- people/ilmari/modularisation-branch/node/Plugin.pm.in (added)
- people/ilmari/modularisation-branch/node/TODO (deleted)
- people/ilmari/modularisation-branch/node/TODO.plugins (deleted)
- people/ilmari/modularisation-branch/node/munin-node-configure-snmp.in (modified) (6 diffs)
- people/ilmari/modularisation-branch/node/munin-node-configure.in (modified) (19 diffs)
- people/ilmari/modularisation-branch/node/munin-node-simple.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/munin-node.conf.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/munin-node.conf.pod (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/munin-node.in (modified) (8 diffs)
- people/ilmari/modularisation-branch/node/munin-run.in (modified) (8 diffs)
- people/ilmari/modularisation-branch/node/node.d.aix/cpu.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.aix/df.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d.aix/iostat.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.aix/load.in (added)
- people/ilmari/modularisation-branch/node/node.d.aix/memory.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.aix/netstat.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.aix/processes.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.aix/swap.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.freebsd/df.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d.freebsd/df_inode.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d.freebsd/if_.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d.freebsd/uptime.in (added)
- people/ilmari/modularisation-branch/node/node.d.linux/acpi.in (added)
- people/ilmari/modularisation-branch/node/node.d.linux/apt.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.linux/apt_all.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.linux/cpu.in (modified) (4 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/cpuspeed.in (modified) (4 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/df.in (modified) (8 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/df_abs.in (modified) (4 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/df_inode.in (modified) (8 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/entropy.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/files_.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/forks.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/fw_conntrack.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/fw_forwarded_local.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/fw_packets.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/i2c.in (deleted)
- people/ilmari/modularisation-branch/node/node.d.linux/i2c_fan.in (deleted)
- people/ilmari/modularisation-branch/node/node.d.linux/if_.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/if_err_.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/interrupts.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.linux/ip_.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/ipmi_.in (added)
- people/ilmari/modularisation-branch/node/node.d.linux/irqstats.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/load.in (modified) (5 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/memory.in (modified) (7 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/netopia.in (deleted)
- people/ilmari/modularisation-branch/node/node.d.linux/netstat.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.linux/nfs4_client.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.linux/nfs_client.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.linux/nfsd.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.linux/open_files.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/open_inodes.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/port_.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.linux/proc_pri.in (added)
- people/ilmari/modularisation-branch/node/node.d.linux/processes.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/quota_usage_.in (added)
- people/ilmari/modularisation-branch/node/node.d.linux/swap.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.linux/threads.in (added)
- people/ilmari/modularisation-branch/node/node.d.linux/uptime.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/users.in (deleted)
- people/ilmari/modularisation-branch/node/node.d.linux/vlan_.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d.linux/yum.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/cpu.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/df.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/df_inode.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/forks.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/if_.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/if_errcoll_.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/interrupts.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/iostat.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/iostat_ops.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/irqstats.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/load.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/memory.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/memory_pools.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/memory_types.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/netstat.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/nfs_client.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/nfsd.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/open_files.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/processes.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/sensors_.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/swap.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/uptime.in (added)
- people/ilmari/modularisation-branch/node/node.d.netbsd/vmstat.in (added)
- people/ilmari/modularisation-branch/node/node.d.sunos/df.in (added)
- people/ilmari/modularisation-branch/node/node.d.sunos/df_inode.in (added)
- people/ilmari/modularisation-branch/node/node.d.sunos/fs_df.in (deleted)
- people/ilmari/modularisation-branch/node/node.d.sunos/fs_inodes.in (deleted)
- people/ilmari/modularisation-branch/node/node.d.sunos/if_.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d.sunos/if_errcoll_.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d.sunos/io_busy_.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.sunos/io_bytes_.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.sunos/io_ops_.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.sunos/load.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.sunos/memory.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.sunos/paging_in.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.sunos/paging_out.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.sunos/processes.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d.sunos/uptime.in (added)
- people/ilmari/modularisation-branch/node/node.d/README (deleted)
- people/ilmari/modularisation-branch/node/node.d/acpi.in (deleted)
- people/ilmari/modularisation-branch/node/node.d/amavis.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/apc_envunit_.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d/cmc_tc_sensor_.in (added)
- people/ilmari/modularisation-branch/node/node.d/courier_.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d/courier_mta_mailqueue.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/cupsys_pages.in (modified) (7 diffs)
- people/ilmari/modularisation-branch/node/node.d/df.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/df_inode.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/digitemp_.in (added)
- people/ilmari/modularisation-branch/node/node.d/exim_mailqueue.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/exim_mailqueue_alt.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/exim_mailstats.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/foldingathome.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/foldingathome_rank.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/foldingathome_wu.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d/hddtemp.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/id.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/ipac-ng.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/lpstat.in (added)
- people/ilmari/modularisation-branch/node/node.d/mbmon_.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/multiping.in (added)
- people/ilmari/modularisation-branch/node/node.d/multips.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/munin_graph.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/munin_update.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/mysql_bytes.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/mysql_isam_space_.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d/mysql_queries.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/mysql_slowqueries.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/mysql_threads.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/named.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/netopia.in (added)
- people/ilmari/modularisation-branch/node/node.d/ntp_.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/ntp_kernel_err.in (added)
- people/ilmari/modularisation-branch/node/node.d/ntp_kernel_pll_freq.in (added)
- people/ilmari/modularisation-branch/node/node.d/ntp_kernel_pll_off.in (added)
- people/ilmari/modularisation-branch/node/node.d/ntp_states.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/nutups_.in (added)
- people/ilmari/modularisation-branch/node/node.d/perdition.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/ping_.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/node/node.d/postfix_mailqueue.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/postfix_mailstats.in (modified) (4 diffs)
- people/ilmari/modularisation-branch/node/node.d/ps_.in (modified) (4 diffs)
- people/ilmari/modularisation-branch/node/node.d/psu_.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/qmailscan-simple.in (added)
- people/ilmari/modularisation-branch/node/node.d/qmailscan.in (added)
- people/ilmari/modularisation-branch/node/node.d/samba.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/sendmail_mailqueue.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/sendmail_mailstats.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/sendmail_mailtraffic.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/node/node.d/snmp__if_.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/snmp__rdp_users.in (added)
- people/ilmari/modularisation-branch/node/node.d/snmp__uptime.in (added)
- people/ilmari/modularisation-branch/node/node.d/snmp__winload.in (added)
- people/ilmari/modularisation-branch/node/node.d/snmp__winmem.in (added)
- people/ilmari/modularisation-branch/node/node.d/spamstats.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/squid_cache.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/squid_icp.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/squid_requests.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/squid_traffic.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/node.d/tomcat_access.in (added)
- people/ilmari/modularisation-branch/node/node.d/tomcat_jvm.in (added)
- people/ilmari/modularisation-branch/node/node.d/tomcat_threads.in (added)
- people/ilmari/modularisation-branch/node/node.d/tomcat_volume.in (added)
- people/ilmari/modularisation-branch/node/node.d/users.in (added)
- people/ilmari/modularisation-branch/node/node.d/vmstat.in (modified) (1 diff)
- people/ilmari/modularisation-branch/node/plugin.sh.in (added)
- people/ilmari/modularisation-branch/node/plugins.history.in (modified) (2 diffs)
- people/ilmari/modularisation-branch/resources (added)
- people/ilmari/modularisation-branch/resources/apache-cgi.conf.in (added)
- people/ilmari/modularisation-branch/resources/apache-passwd.conf.in (added)
- people/ilmari/modularisation-branch/resources/favicon.ico (added)
- people/ilmari/modularisation-branch/resources/linux-cron.d_munin-node.in (added)
- people/ilmari/modularisation-branch/resources/linux-cron.d_munin.in (added)
- people/ilmari/modularisation-branch/resources/solaris-init.d_munin-node.in (added)
- people/ilmari/modularisation-branch/server/TODO (deleted)
- people/ilmari/modularisation-branch/server/VeraMono.ttf (added)
- people/ilmari/modularisation-branch/server/munin-cgi-graph.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/server/munin-cron.pod (modified) (2 diffs)
- people/ilmari/modularisation-branch/server/munin-graph.in (modified) (30 diffs)
- people/ilmari/modularisation-branch/server/munin-htaccess (deleted)
- people/ilmari/modularisation-branch/server/munin-htaccess.in (added)
- people/ilmari/modularisation-branch/server/munin-html.in (modified) (10 diffs)
- people/ilmari/modularisation-branch/server/munin-limits.in (modified) (3 diffs)
- people/ilmari/modularisation-branch/server/munin-update.in (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
people/ilmari/modularisation-branch/COPYING
r864 r1265 1 GNU GENERAL PUBLIC LICENSE 2 Version 2, June 1991 1 Munin - a network-wide graphing framework 3 2 4 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 Everyone is permitted to copy and distribute verbatim copies 7 of this license document, but changing it is not allowed. 3 Copyright (C) 2002-2006 Jimmy Olsen, et al. 8 4 9 Preamble 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; version 2 dated June, 1991. 10 8 11 The licenses for most software are designed to take away your 12 freedom to share and change it. By contrast, the GNU General Public 13 License is intended to guarantee your freedom to share and change free 14 software--to make sure the software is free for all its users. This 15 General Public License applies to most of the Free Software 16 Foundation's software and to any other program whose authors commit to 17 using it. (Some other Free Software Foundation software is covered by 18 the GNU Library General Public License instead.) You can apply it to 19 your programs, too. 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 20 13 21 When we speak of free software, we are referring to freedom, not 22 price. Our General Public Licenses are designed to make sure that you 23 have the freedom to distribute copies of free software (and charge for 24 this service if you wish), that you receive source code or can get it 25 if you want it, that you can change the software or use pieces of it 26 in new free programs; and that you know you can do these things. 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 27 17 28 To protect your rights, we need to make restrictions that forbid 29 anyone to deny you these rights or to ask you to surrender the rights. 30 These restrictions translate to certain responsibilities for you if you 31 distribute copies of the software, or if you modify it. 18 Includes the font Bitstream Vera Mono, which is under the following license: 32 19 33 For example, if you distribute copies of such a program, whether 34 gratis or for a fee, you must give the recipients all the rights that 35 you have. You must make sure that they, too, receive or can get the 36 source code. And you must show them these terms so they know their 37 rights. 20 Copyright (C) 2003 Bitstream, Inc. 21 All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. 38 22 39 We protect your rights with two steps: (1) copyright the software, and 40 (2) offer you this license which gives you legal permission to copy, 41 distribute and/or modify the software. 23 Permission is hereby granted, free of charge, to any person obtaining a 24 copy of the fonts accompanying this license ("Fonts") and associated 25 documentation files (the "Font Software"), to reproduce and distribute 26 the Font Software, including without limitation the rights to use, copy, 27 merge, publish, distribute, and/or sell copies of the Font Software, and 28 to permit persons to whom the Font Software is furnished to do so, 29 subject to the following conditions: 42 30 43 Also, for each author's protection and ours, we want to make certain 44 that everyone understands that there is no warranty for this free 45 software. If the software is modified by someone else and passed on, we 46 want its recipients to know that what they have is not the original, so 47 that any problems introduced by others will not reflect on the original 48 authors' reputations. 31 The above copyright and trademark notices and this permission notice 32 shall be included in all copies of one or more of the Font Software 33 typefaces. 49 34 50 Finally, any free program is threatened constantly by software51 patents. We wish to avoid the danger that redistributors of a free52 program will individually obtain patent licenses, in effect making the 53 program proprietary. To prevent this, we have made it clear that any 54 patent must be licensed for everyone's free use or not licensed at all.35 The Font Software may be modified, altered, or added to, and in 36 particular the designs of glyphs or characters in the Fonts may be 37 modified and additional glyphs or characters may be added to the Fonts, 38 only if the fonts are renamed to names not containing either the words 39 "Bitstream" or the word "Vera". 55 40 56 The precise terms and conditions for copying, distribution and 57 modification follow. 58 59 GNU GENERAL PUBLIC LICENSE 60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 41 This License becomes null and void to the extent applicable to Fonts or 42 Font Software that has been modified and is distributed under the 43 "Bitstream Vera" names. 61 44 62 0. This License applies to any program or other work which contains 63 a notice placed by the copyright holder saying it may be distributed 64 under the terms of this General Public License. The "Program", below, 65 refers to any such program or work, and a "work based on the Program" 66 means either the Program or any derivative work under copyright law: 67 that is to say, a work containing the Program or a portion of it, 68 either verbatim or with modifications and/or translated into another 69 language. (Hereinafter, translation is included without limitation in 70 the term "modification".) Each licensee is addressed as "you". 45 The Font Software may be sold as part of a larger software package but 46 no copy of one or more of the Font Software typefaces may be sold by 47 itself. 71 48 72 Activities other than copying, distribution and modification are not 73 covered by this License; they are outside its scope. The act of 74 running the Program is not restricted, and the output from the Program 75 is covered only if its contents constitute a work based on the 76 Program (independent of having been made by running the Program). 77 Whether that is true depends on what the Program does. 49 THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 50 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 51 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 52 COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL 53 BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR 54 OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, 55 OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR 56 OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT 57 SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. 78 58 79 1. You may copy and distribute verbatim copies of the Program's 80 source code as you receive it, in any medium, provided that you 81 conspicuously and appropriately publish on each copy an appropriate 82 copyright notice and disclaimer of warranty; keep intact all the 83 notices that refer to this License and to the absence of any warranty; 84 and give any other recipients of the Program a copy of this License 85 along with the Program. 86 87 You may charge a fee for the physical act of transferring a copy, and 88 you may at your option offer warranty protection in exchange for a fee. 89 90 2. You may modify your copy or copies of the Program or any portion 91 of it, thus forming a work based on the Program, and copy and 92 distribute such modifications or work under the terms of Section 1 93 above, provided that you also meet all of these conditions: 94 95 a) You must cause the modified files to carry prominent notices 96 stating that you changed the files and the date of any change. 97 98 b) You must cause any work that you distribute or publish, that in 99 whole or in part contains or is derived from the Program or any 100 part thereof, to be licensed as a whole at no charge to all third 101 parties under the terms of this License. 102 103 c) If the modified program normally reads commands interactively 104 when run, you must cause it, when started running for such 105 interactive use in the most ordinary way, to print or display an 106 announcement including an appropriate copyright notice and a 107 notice that there is no warranty (or else, saying that you provide 108 a warranty) and that users may redistribute the program under 109 these conditions, and telling the user how to view a copy of this 110 License. (Exception: if the Program itself is interactive but 111 does not normally print such an announcement, your work based on 112 the Program is not required to print an announcement.) 113 114 These requirements apply to the modified work as a whole. If 115 identifiable sections of that work are not derived from the Program, 116 and can be reasonably considered independent and separate works in 117 themselves, then this License, and its terms, do not apply to those 118 sections when you distribute them as separate works. But when you 119 distribute the same sections as part of a whole which is a work based 120 on the Program, the distribution of the whole must be on the terms of 121 this License, whose permissions for other licensees extend to the 122 entire whole, and thus to each and every part regardless of who wrote it. 123 124 Thus, it is not the intent of this section to claim rights or contest 125 your rights to work written entirely by you; rather, the intent is to 126 exercise the right to control the distribution of derivative or 127 collective works based on the Program. 128 129 In addition, mere aggregation of another work not based on the Program 130 with the Program (or with a work based on the Program) on a volume of 131 a storage or distribution medium does not bring the other work under 132 the scope of this License. 133 134 3. You may copy and distribute the Program (or a work based on it, 135 under Section 2) in object code or executable form under the terms of 136 Sections 1 and 2 above provided that you also do one of the following: 137 138 a) Accompany it with the complete corresponding machine-readable 139 source code, which must be distributed under the terms of Sections 140 1 and 2 above on a medium customarily used for software interchange; or, 141 142 b) Accompany it with a written offer, valid for at least three 143 years, to give any third party, for a charge no more than your 144 cost of physically performing source distribution, a complete 145 machine-readable copy of the corresponding source code, to be 146 distributed under the terms of Sections 1 and 2 above on a medium 147 customarily used for software interchange; or, 148 149 c) Accompany it with the information you received as to the offer 150 to distribute corresponding source code. (This alternative is 151 allowed only for noncommercial distribution and only if you 152 received the program in object code or executable form with such 153 an offer, in accord with Subsection b above.) 154 155 The source code for a work means the preferred form of the work for 156 making modifications to it. For an executable work, complete source 157 code means all the source code for all modules it contains, plus any 158 associated interface definition files, plus the scripts used to 159 control compilation and installation of the executable. However, as a 160 special exception, the source code distributed need not include 161 anything that is normally distributed (in either source or binary 162 form) with the major components (compiler, kernel, and so on) of the 163 operating system on which the executable runs, unless that component 164 itself accompanies the executable. 165 166 If distribution of executable or object code is made by offering 167 access to copy from a designated place, then offering equivalent 168 access to copy the source code from the same place counts as 169 distribution of the source code, even though third parties are not 170 compelled to copy the source along with the object code. 171 172 4. You may not copy, modify, sublicense, or distribute the Program 173 except as expressly provided under this License. Any attempt 174 otherwise to copy, modify, sublicense or distribute the Program is 175 void, and will automatically terminate your rights under this License. 176 However, parties who have received copies, or rights, from you under 177 this License will not have their licenses terminated so long as such 178 parties remain in full compliance. 179 180 5. You are not required to accept this License, since you have not 181 signed it. However, nothing else grants you permission to modify or 182 distribute the Program or its derivative works. These actions are 183 prohibited by law if you do not accept this License. Therefore, by 184 modifying or distributing the Program (or any work based on the 185 Program), you indicate your acceptance of this License to do so, and 186 all its terms and conditions for copying, distributing or modifying 187 the Program or works based on it. 188 189 6. Each time you redistribute the Program (or any work based on the 190 Program), the recipient automatically receives a license from the 191 original licensor to copy, distribute or modify the Program subject to 192 these terms and conditions. You may not impose any further 193 restrictions on the recipients' exercise of the rights granted herein. 194 You are not responsible for enforcing compliance by third parties to 195 this License. 196 197 7. If, as a consequence of a court judgment or allegation of patent 198 infringement or for any other reason (not limited to patent issues), 199 conditions are imposed on you (whether by court order, agreement or 200 otherwise) that contradict the conditions of this License, they do not 201 excuse you from the conditions of this License. If you cannot 202 distribute so as to satisfy simultaneously your obligations under this 203 License and any other pertinent obligations, then as a consequence you 204 may not distribute the Program at all. For example, if a patent 205 license would not permit royalty-free redistribution of the Program by 206 all those who receive copies directly or indirectly through you, then 207 the only way you could satisfy both it and this License would be to 208 refrain entirely from distribution of the Program. 209 210 If any portion of this section is held invalid or unenforceable under 211 any particular circumstance, the balance of the section is intended to 212 apply and the section as a whole is intended to apply in other 213 circumstances. 214 215 It is not the purpose of this section to induce you to infringe any 216 patents or other property right claims or to contest validity of any 217 such claims; this section has the sole purpose of protecting the 218 integrity of the free software distribution system, which is 219 implemented by public license practices. Many people have made 220 generous contributions to the wide range of software distributed 221 through that system in reliance on consistent application of that 222 system; it is up to the author/donor to decide if he or she is willing 223 to distribute software through any other system and a licensee cannot 224 impose that choice. 225 226 This section is intended to make thoroughly clear what is believed to 227 be a consequence of the rest of this License. 228 229 8. If the distribution and/or use of the Program is restricted in 230 certain countries either by patents or by copyrighted interfaces, the 231 original copyright holder who places the Program under this License 232 may add an explicit geographical distribution limitation excluding 233 those countries, so that distribution is permitted only in or among 234 countries not thus excluded. In such case, this License incorporates 235 the limitation as if written in the body of this License. 236 237 9. The Free Software Foundation may publish revised and/or new versions 238 of the General Public License from time to time. Such new versions will 239 be similar in spirit to the present version, but may differ in detail to 240 address new problems or concerns. 241 242 Each version is given a distinguishing version number. If the Program 243 specifies a version number of this License which applies to it and "any 244 later version", you have the option of following the terms and conditions 245 either of that version or of any later version published by the Free 246 Software Foundation. If the Program does not specify a version number of 247 this License, you may choose any version ever published by the Free Software 248 Foundation. 249 250 10. If you wish to incorporate parts of the Program into other free 251 programs whose distribution conditions are different, write to the author 252 to ask for permission. For software which is copyrighted by the Free 253 Software Foundation, write to the Free Software Foundation; we sometimes 254 make exceptions for this. Our decision will be guided by the two goals 255 of preserving the free status of all derivatives of our free software and 256 of promoting the sharing and reuse of software generally. 257 258 NO WARRANTY 259 260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 REPAIR OR CORRECTION. 269 270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 POSSIBILITY OF SUCH DAMAGES. 279 280 END OF TERMS AND CONDITIONS 281 282 How to Apply These Terms to Your New Programs 283 284 If you develop a new program, and you want it to be of the greatest 285 possible use to the public, the best way to achieve this is to make it 286 free software which everyone can redistribute and change under these terms. 287 288 To do so, attach the following notices to the program. It is safest 289 to attach them to the start of each source file to most effectively 290 convey the exclusion of warranty; and each file should have at least 291 the "copyright" line and a pointer to where the full notice is found. 292 293 <one line to give the program's name and a brief idea of what it does.> 294 Copyright (C) <year> <name of author> 295 296 This program is free software; you can redistribute it and/or modify 297 it under the terms of the GNU General Public License as published by 298 the Free Software Foundation; version 2 dated June, 1991. 299 300 This program is distributed in the hope that it will be useful, 301 but WITHOUT ANY WARRANTY; without even the implied warranty of 302 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 303 GNU General Public License for more details. 304 305 You should have received a copy of the GNU General Public License 306 along with this program; if not, write to the Free Software 307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 308 309 310 Also add information on how to contact you by electronic and paper mail. 311 312 If the program is interactive, make it output a short notice like this 313 when it starts in an interactive mode: 314 315 Gnomovision version 69, Copyright (C) year name of author 316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 This is free software, and you are welcome to redistribute it 318 under certain conditions; type `show c' for details. 319 320 The hypothetical commands `show w' and `show c' should show the appropriate 321 parts of the General Public License. Of course, the commands you use may 322 be called something other than `show w' and `show c'; they could even be 323 mouse-clicks or menu items--whatever suits your program. 324 325 You should also get your employer (if you work as a programmer) or your 326 school, if any, to sign a "copyright disclaimer" for the program, if 327 necessary. Here is a sample; alter the names: 328 329 Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 332 <signature of Ty Coon>, 1 April 1989 333 Ty Coon, President of Vice 334 335 This General Public License does not permit incorporating your program into 336 proprietary programs. If your program is a subroutine library, you may 337 consider it more useful to permit linking proprietary applications with the 338 library. If this is what you want to do, use the GNU Library General 339 Public License instead of this License. 59 Except as contained in this notice, the names of Gnome, the Gnome 60 Foundation, and Bitstream Inc., shall not be used in advertising or 61 otherwise to promote the sale, use or other dealings in this Font 62 Software without prior written authorization from the Gnome Foundation 63 or Bitstream Inc., respectively. For further information, contact: 64 <fonts@gnome.org>. people/ilmari/modularisation-branch/ChangeLog
r1262 r1265 1 -*- text -*- 1 2 munin (repository) 2 3 … … 6 7 * Move Perl modules to {node,server}/lib/. 7 8 * Server: Display the time period in the title of the comparison pages. 8 * Node: Make it possible to run plugins with group root. 9 * Merge changes from 1.2.3->1.2.4. Some of the following entries may not 10 apply. 9 10 munin (1.3.3, r910-r1236) 11 12 It's very likely that the entries for 1.3.3 contain some duplicates. 13 In part because it's been going on for more than a year, in part 14 because a large part has been constructed from the svn commit log. 15 16 * Linux plugins: Use @@GOODSH@@ (posix-shell) there too 17 * linux/vlan: Better autoconf messages 18 * Solaris plugins: bring them @@GOODSH@@ and some elementary civilization 19 * sunos memory: Make autoconf'able 20 * Bring the goodness og @@GOODSH@@ to the generic plugins 21 * node.d/df and df_inode plugins: Rewrite like the last 20 years of shell 22 enhancments happened 23 * munin monitoring plugins: Make them auto-installing 24 * ntp_ and ntp_states plugins: Insert graph_category, make them "auto" 25 and invent category "time" as well 26 * ntp_kernel_* plugins: Not ntpdc's were created equal, autodetect better 27 * munin-cgi-graph: Patch to limit number of concurrent rrdgraph processes 28 * munin-html: Do not generate height/width attributes when in cgi mode 29 * munin-html: Log runtime - like with munin-graph etc. 30 * users plugin: Make vehicle for *STACK draw types 31 * munin-graph: Support draw types AREASTACK and LINESTACK which is not 32 sensitive to order like LINE/STACK and AREA/STACK 33 * INSTALL: Document what to do first when working with a svn checkout 34 * munin-graph: Simplify colour processing 35 * Makefile: Remove build before rebuilding it 36 * users plugin: Further fixing. Make testbed for field.colour and 37 graph_printf 38 * munin-graph/Munin.pm: Support graph_printf 39 * users plugin: Move to platform independent directory 40 * users plugin: change familiy to auto, make generic 41 * linux/memory: Further adjustments w.r.t. correct handling of vmalloc_used 42 * Fix typo "contigious" 43 * munin-node-simple: Fix @@ variable typos 44 * SunOS df plugins: use @@GOODSH@@ 45 * Define GOODSH and BASH in Makefile.config to be used by shell plugins 46 * exim_* plugins: Problems with "which exim" on Solaris corrected 47 * Put "host" thing in munin-node.conf template config 48 * munin-node docs: Mention two most importand Net::Server config options. 49 * Linux df* plugins: Configurable filesystem-type exclution. cds by defaut 50 * plugin.sh: Utility functions for shell plugins 51 * Munin::Plugin: Utility functions for perl plugins 52 * Sample plugins: Convert to use plugin.sh and Munin::Plugin 53 * Makefile: Install utility files 54 * Munin-run/node: Put most @@ config params from install time into 55 plugin environment. This means that plugins can access 56 @@PLUGSTATE@@ as $MUNIN_PLUGSTATE, and so on. 57 * df* plugins on all architectures: Make fieldnames comply to charset 58 restrictions 59 * Makefile: Install platform-specific plugins after generic plugins so 60 that the former override the latter ones 61 * Munin-graph: Installed kluge for rrd 1.2 to make lines narrower to 62 compensate for crayon-effect. 63 * Munin-update: Add code to interpret Scientific notation (3E-20) for 64 RRD so plugins don't have to 65 * Bring SunOS df plugin names into line with other platforms 66 * Make SunOS df plugins auto/autoconf 67 * Linux/memory plugin: Remove warning on overcommit 68 * Partial audit of correct magicmarkers in generic and linux plugins 69 * Multiple plugins: Correct autoconf/suggest action slightly 70 * lpstat: New plugin for print queue depths 71 * Munin-node-configure: Make more robust, make it present plugin 72 errors and exit with error if there are any. Write testcases and 73 node-monkeywrench target in Makefile to test the error handling. 74 * munin-run: Make --debug messages consistent wrt STDERR/STDOUT and 75 prefix with # to make them obvious to users and munin-node-configure 76 * Makefile: Create plugin state directory with correct ownership and 77 permissions 78 * port_ plugin did not use @@PLUGSTATE@@ for plugin state 79 * ipmi plugin: Incorrect handeling of 'autoconf' method 80 * YUM plugin did not autoconf correctly 81 * install-node-plugins now installs all plugins in the distribution - 82 no matter if they existed already - how else do we get bugfixed 83 plugins installed? 84 * Inform about ruthless installation practices in INSTALL document 85 * Add maintainer version of Makefile.config - and stop it from being 86 distributed as the actual Makefile.config by accident 87 * Add favicon.ico file and install 88 * Add other convinience features for the maintainer to Makefile 89 * linux/fw_forwarded_local: Removed arbitrary max settings (trac #149) 90 * Contributed plugins for netbsd 91 * New ntpdc based ntp plugins to show kernel params 92 * New plugin: Multiping shows multiple ping results in one graph (trac #109) 93 * munin-node: Fix depreciated environment setting messages (trac #377) 94 * Document what graph_strategy cgi does (wiki docs, trac #98) 95 * Add a possibly helpful readme file to dists/sunos 96 * Contrib: (updated) hack to generate pages of each-service-on-every-host 97 * Munin.pm: Fix uninitialized value problem in lock reading code. 98 * linux/irqstats plugin: Fix bug related to different /proc/interupts 99 format on Sparc hardware (trac #436) 100 * Added init script for Solaris in resources directory 101 * Add uptime plugin for solaris (trac #419) 102 * Squid plugins: Add timeout to http connection call 103 * Correct years of (C) in snmp__winmem 104 * nutups_: new plugin for ups checking through "nut". 105 * munin-html: Split on /\s+/ instead of / / to ensure more robust handling 106 of user input 107 * Fix rrd 1.2 font size problem causing line wrap (#104) 108 * Fold in contributed hack to generate single service comparative pages 109 * Node: Clear up some operator presidence causing problems in perl 5.8.7 110 * Update copyright years and put copyright info into the new README file 111 * Install a .htaccess file by default and document it 112 * Move surfboard plugin, not Linux specific. I suspect this plugin is 113 redundant and snmp__if_ can do the same job 114 * Bugfix to support notify_alias at service level 115 * Put configuration-file snippets into resource directory and use install 116 @@ substitutions in them 117 * Makefile: Better dependencies 118 * Add digitemp and yum plugins 119 * Make munin-node-configure-snmp die gracefully with a potentially useful 120 error message if Net::SNMP->session() fails. Patch helpfully provided by 121 Cyril Bouthors <cyb@debian.org>, thanks! 122 * New AIX load plugin 123 * Plugins from Lars Strand: linux/threads linux/proc_pri 124 * New version of linux/if_ plugin that also handles mii-tool dependent 125 interfaces and handles absence of tools better. 126 * linux/memory: warn -> warning 127 * postfix/mailstats: sort keys instead of keys, prettyer that way 128 * Windows SNMP plugins: Memory and cpuload plugins seems pretty broken 129 reinstate other versions. 130 * New SNMP lugins: snmp__rdp_users and snmp__winload 131 * Change global headers limit to 16 or longer labels - 20 was too much 132 even with rrd 1.0 133 * linux/memory: Saner values on 64 bit machines - ticket #119 134 * SNMP based uptime grapher - ticket #141 135 * Linux/load: Make warn/crit levels configurable by environment (ticket #44) 136 * Aix plugins: Better graph_categories 137 * New plugin: qmailscan by David Obando, lists viruses found by name 138 * New plugins: freebsd/uptime, linux/quota_usage, snmp: cmc_tc_sensor 139 r1054 | janl | 2006-08-25 01:31:44 +0200 (fre, 25 aug 2006) | 2 lines 140 * Linux/apt: Better counting: Debian #314610, Munin #92 141 * New plugins for Tomcat from runesk 142 * Applied patch to allow _aggregated graph 143 * spamstats plugin: Check if logfile exists before reading 144 * Delete obsolete plugins: i2c* 145 * ACPI plugin is linux specific 146 * linux/cpu: Various fixes relating to 1000Hz machines, closing #228. 147 * Applied field.colour patch by munin@iambitter.org, ticket #54 148 * New plugin: IPMI plugin added 149 * apc_envunit_ plugin: Remove hard coded defaults that overrode 150 configuration. 151 * freebsd/vmstat: Avoid calling sysctl through $PATH. That variable is 152 changed on process restart. 153 * Get rid of undefined variable warnings in mailscanner - patch by 154 dz@426.ch (trac #227) 155 * cups plugin: No @ in field names (#66, #70) 156 * sendmail_mailqueue plugins: Follow symlinks (#102) 157 * hddtemp_smartctl: different attribute ID for temperature (#81) 158 * ps_ plugin: Counted grep as well as the process 159 * New plugin: cpuspeed for linux. 160 * Linux/multips: wrong category of multips (#103) 161 * Munin-node/run: Set LC_ALL to C to avoid locale changes to program output 162 * Linux/cpu plugin: Scale to >10 CPUs (trac #37) 163 * Linux/df: Rewritten df plugins in perl. The old plugins were extremely 164 slow on busy system due to massive forking 165 * sendmail_mqueue: (#65) wrong seek call 166 * munin-update: (#39) incorrect error handling when opening STATS handle 167 * New plugin: Linux/nfs4_client: should be folded with nfs_client when we 168 get multigraph 169 * node/munin-run: Inserted missing \n 170 * linux/nfs_client: Fixed input processing inefficiency 171 * linux/nfsd: Ditto 172 * linux/fw_forwarded_local: Ditto 173 * ps_ plugin: pgrep? /usr/bin/pgrep! 174 * sendmail_mailqueue plugin: Replaced a $mspqueue too many 175 * Synced most rpm specfile changes from Fedora package into unstable tree 176 * A RedHat specific sendmail plugin config file 177 * Add testing framework and some tests for munin-run. 178 * Updated to final 1.2.4 version [merged change r98r984 from 179 /branches/1.2-stable 180 * Change copyright notice in programs to mention the GNU *General* 181 Public License, Expand on "no warranty". Mention COPYING and 182 http://www.fsf.org/licensing/licenses/gpl.txt. 183 Extend copyright to 2005. 184 * Fix generic/mysql_isam_space_ to pass user-specified mysqlshow 185 options first. 186 * Fix generic/ntp_ to report seconds instead of milliseconds. 187 * Fix handling of 'update no' on services in munin-update. 188 * Log warning about nodes without addresses in munin-update. 189 * SNMP plugins no longer report host_name when checking localhost. 190 * Remade the horizontal logo 191 * Added two svg versions of the logo: original and horizontal 192 * Merged debian packaging changes from 1.2 193 [changes r615:920 from /branches/1.2-stable/dists/debian and 194 r855:891 from /branches/debian/sarge/dists/debian] 195 * Added support for summing values from log lines. 196 * Correct munin-limits pod. 197 * Tuned logging. 198 * Added support for huge rrd files. 199 * Changed paths in Makefile wrt move from cvs to svn. 200 * Make it possible to run plugins with group root. 11 201 * Plugins: "exists $ARGV[0]" does not work with perl < 5.6.0. use 12 202 "defined $ARGV[0]". … … 14 204 * Dists: Merged changes from Debian Etch package. See 15 205 dists/debian/changelog. 16 * Main: Correct munin-limits pod documentation.17 206 * Server: filter a trivial error message from RRDtool (Deb#326061) 18 207 * Server: A patch from trunk that makes munin-limits eat stdout/err from the 19 208 contact.foo.command option in munin.conf. (Deb#301196) 20 * Server: make munin-graph deal with RRDtool 1.0.x and 1.2.x.21 209 * Server: Fix thinko in category_order in munin-html.in. 22 * Server: Fix handling of 'update no' on services.23 * Server: Log warning about nodes without addresses.24 210 * Node: Prevent list command from polluting the node list. 25 * Plugins: Fix tempfile creation by using the best method available on a given26 platform. (amavis, courier_, perdition)211 * Plugins: Fix tempfile creation by using the best method available on a 212 given platform. (amavis, courier_, perdition) 27 213 * Plugins: Fix to support the Linux cciss driver in the iostat plugin. 28 214 * Plugins: squid_requests: Put the CDEF back that computes misses. 29 215 * Plugins: postfix_mailvolume: Fix bad exit code test for `which postconf`. 30 216 * Plugins: hddtemp_smartctl: Fix bugs on Solaris. Revert back to using -A 31 (attributes) rather than -a (all). That can be specified through the32 args_$dev mechanism. THIS CAN BREAK EXISTING SETUPS!217 (attributes) rather than -a (all). That can be specified through the 218 args_$dev mechanism. THIS CAN BREAK EXISTING SETUPS! 33 219 * Plugins: samba: Make location of smbstatus program configurable. 34 Streamline computation of foo.value. Correct typos and a thinko. Add35 configurable "ignoreipcshare". Make awk program a lot more complicated to36 deal with variations of smbstatus output. Quote error message with37 parentheseis.220 Streamline computation of foo.value. Correct typos and a thinko. Add 221 configurable "ignoreipcshare". Make awk program a lot more complicated to 222 deal with variations of smbstatus output. Quote error message with 223 parentheseis. 38 224 * Plugins: smart_: Allow to query several drives on the same 3ware card. 39 Correct a bug when '-i' was not listed in smartargs. Don't fail if40 no value was obtained for hard drive model. Minor enhancements and41 minor bug fixes from Nicolas STRANSKY <Nico@neo-lan.net>. smartctl exit42 code is a value composed of bits. Allow more than one to be turned on43 simultaneously by using the exit code itself rather than the log2 of it.225 Correct a bug when '-i' was not listed in smartargs. Don't fail if 226 no value was obtained for hard drive model. Minor enhancements and 227 minor bug fixes from Nicolas STRANSKY <Nico@neo-lan.net>. smartctl exit 228 code is a value composed of bits. Allow more than one to be turned on 229 simultaneously by using the exit code itself rather than the log2 of it. 44 230 * Plugins: perdition: Add missing backquote on mktempfile line. Support 45 IMAPS and POP3S protocols.231 IMAPS and POP3S protocols. 46 232 * Plugins (FreeBSD): if_, if_errcoll_: Shift field numbers in awk for 47 interfaces that have no MAC address.233 interfaces that have no MAC address. 48 234 * Plugins (Solaris): fs_df, fs_inodes: Allow '-' in mountpoints. 49 235 * Plugins (Solaris): processes: Replaced numerous calls to various programs 50 with a single awk program.236 with a single awk program. 51 237 * Plugins (Solaris): netstat: "exists $ARGV[0]" does not work with perl < 52 5.6.0. use "defined $ARGV[0]".238 5.6.0. use "defined $ARGV[0]". 53 239 * Plugins (Solaris): memory: Rewrite the value computation as a single nawk 54 program. Support scale factor "K" (gives values < 1).240 program. Support scale factor "K" (gives values < 1). 55 241 * Plugins (Linux): port_: Correct offset error in TCP6 code. 56 242 * Plugins (Linux): if_: Simplify awk program greatly, suggested by 57 243 Nicolai Langfeldt <janl@linpro.no> 244 * Plugins: Added plugin generic/digitemp_. 245 * Plugins: Added plugin linux/yum. 246 * Node: use Sys::Hostname::hostname()+gethostbyname() instead of 247 Net::Domain::hostfqdn() in order to determine the fully-qualified host 248 name of the host. The latter appears to be brain-damaged, see 249 <http://bugs.debian.org/275024> for background (Deb#307462, Trac#89). 58 250 59 251 munin (1.3.2) people/ilmari/modularisation-branch/INSTALL
r864 r1265 1 Munin consists of the main programs, and a node. The node runs on each of 2 the machines you want to collect data from. The main programs does the 3 collecting, draws the graphs, and creates the HTML pages. 1 IF you're working on a SVN checkout: 4 2 5 To install the main programs: 3 - cp Makefile.config-dist Makefile.conf 4 5 This overwrites the maintainers copy of Makefile.conf. 6 7 8 9 Munin consists of the main (central server) programs, and the node 10 program and the associated plugins. The node runs on each of the 11 machines you want to collect data from. The main programs does the 12 collecting, draws the graphs, and creates the HTML pages. 13 14 To install the main programs (you might want to install a node first, 15 that way there is data to collect): 6 16 7 17 - edit Makefile.config 8 18 - create the user "munin" 9 19 - make install-main 10 - create a cron-entry to run "munin-cron" as the user "munin" every 5 11 minutes 12 - if you want to use the dynamic graphs, configure the cgi directory 13 (an example for apache can be found in README-apache-cgi). 20 21 - In your HTMLDIR/munin you will now find a .htaccess file 22 looking for passwords in CONFDIR/munin-htpasswd. Install 23 the users you need in munin-htpasswd with the htpasswd 24 command. Check that authentication is required, if it's not 25 please refer to build/resources/apache-passwd.conf. 26 27 The .htaccess file may not be accessed unless you have the 28 right AllowOverride in the central Apache configuration. 29 This may fix that (see also 30 build/resources/apache-passwd.conf): 31 32 <Location /munin> 33 AllowOverride AuthConfig Limit 34 </Location> 35 36 If you already have a .htaccess file in HTMLDIR it will not 37 be overwritten. 38 39 If you prefer that munin be openly available make the 40 .htaccess file empty ( : >.htaccess ) - that way it will 41 not be overwritten later. 42 43 - create a cron-entry to run "munin-cron" as the user "munin" 44 every 5 minutes. You might find cron files for your system 45 under the build/dists subdirectory, or perhaps in the 46 build/resources directory. 47 48 - if you want to use the dynamic graphs: Configure the cgi 49 directory, you will find a apache config example in 50 build/resources. NOTE: Dynamic graphs are not exactly 51 perfect. Se also http://munin.projects.linpro.no/wiki/CgiHowto 14 52 15 53 To install the documentation: … … 18 56 - make install-doc install-man 19 57 20 To install the client:58 To install a node: 21 59 22 60 - edit Makefile.config 23 61 - create the group "munin" 24 - make install-node install-node-plugins 25 - decide which plugins to use (quick auto-solution: 26 "munin-node-configure --shell | sh") 27 - start the client (you probably want an init-script for this) 62 - make install-node install-node-plugins (NOTE: This installs 63 all plugins in the distribution, no matter what you already 64 have, if you want to save some plugins you've installed yourself 65 or have customized please make a backup copy). 66 - decide which plugins to use. The quick auto-plug-and-play 67 solution: 68 munin-node-configure --shell --families=contrib,auto | sh -x 69 70 - start the node agent. You probably want an init-script for 71 this and you might find a good one under build/dists 28 72 29 73 Notes about node plugins 30 ------------------------ --74 ------------------------ 31 75 32 76 "make install-node-plugins" installs the plugins in LIBDIR (defined in 33 77 Makefile.config). Put the ones you want to use (or better yet, create 34 softlinks) in CONFDIR/ client.d/ . An easy way to do this, is the program35 "munin-node-configure", using the parameter "--shell". It will then 36 suggest commands to do this.78 softlinks) in CONFDIR/plugins/ . An easy way to do this, is the 79 program "munin-node-configure", using the parameter "--shell". It will 80 then suggest commands to do this. 37 81 38 Some of the plugins require some configuration to get running. An 39 example configuration file is found in the file "plugins.conf"; 82 Some of the plugins require some configuration to get running. Some 83 example configuration files (plugins.conf) is found under the 84 build/dists directory. 40 85 41 Many OSes and releases thereof have different ways of gathering data. A 42 lot of OSes still have none. If you create plugins for a system which is 43 not already in the package, please send us a copy of them, so we can add 44 them for others to use. We'd also be happy if you sent us any new plugins 45 on systems already in the package. 46 86 Many OSes and releases thereof have different ways of gathering data. 87 A lot of OSes still have none. If you create plugins for an OS/system 88 which is not already in the package, please send us a copy of them, so 89 we can add them for others to use. We'd also be happy if you sent us 90 any new plugins on systems already in the package. people/ilmari/modularisation-branch/Makefile
r1045 r1265 1 #! /usr/bin/make -f 2 3 DEFAULTS = Makefile.config 4 CONFIG = Makefile.config 5 6 include $(DEFAULTS) 7 include $(CONFIG) 1 # Gnu make only. Seriously. 2 # $Id$ 3 4 # Defaults/paths from this file 5 include Makefile.config 8 6 9 7 RELEASE = $(shell cat RELEASE) … … 11 9 INSTALL = ./install-sh 12 10 DIR = $(shell /bin/pwd | sed 's/^.*\///') 11 INFILES = $(shell find . -name '*.in') 12 PLUGINS = $(wildcard node/node.d.$(OSTYPE)/* node/node.d/*) 13 MANCENTER = "Munin Documentation" 14 MAN8 = node/munin-node node/munin-run \ 15 node/munin-node-configure-snmp \ 16 node/munin-node-configure \ 17 server/munin-graph server/munin-update \ 18 server/munin-limits server/munin-html 19 PODMAN8 = server/munin-cron 20 PODMAN5 = server/munin.conf node/munin-node.conf 13 21 14 22 default: build 15 23 16 install: install-main install-node install-node-plugins install-doc install-man 24 install: install-main install-node install-node-plugins install-man 25 26 uninstall: uninstall-main 27 28 # This removes the installed config so that the next install-pass installs 29 # a new config. Target suitable for maintainers 30 unconfig: 31 rm -f $(HTMLDIR)/.htaccess 32 rm -f $(CONFDIR)/munin.conf 17 33 18 34 install-main: build … … 31 47 $(CHOWN) $(USER) $(LOGDIR) $(STATEDIR) $(RUNDIR) $(HTMLDIR) $(DBDIR) 32 48 33 for p in build/server/*.tmpl; do \49 for p in build/server/*.tmpl; do \ 34 50 $(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/ ; \ 35 51 done … … 37 53 $(INSTALL) -m 0644 server/style.css $(CONFDIR)/templates/ 38 54 $(INSTALL) -m 0644 server/definitions.html $(CONFDIR)/templates/ 39 55 $(INSTALL) -m 0755 server/VeraMono.ttf $(LIBDIR)/ 56 $(INSTALL) -m 0644 resources/favicon.ico $(HTMLDIR)/ 57 test -f $(HTMLDIR)/.htaccess || $(INSTALL) -m 0644 build/server/munin-htaccess $(HTMLDIR)/.htaccess 40 58 test -f "$(CONFDIR)/munin.conf" || $(INSTALL) -m 0644 build/server/munin.conf $(CONFDIR)/ 41 42 59 $(INSTALL) -m 0755 build/server/munin-cron $(BINDIR)/ 43 44 60 $(INSTALL) -m 0755 build/server/munin-update $(LIBDIR)/ 45 61 $(INSTALL) -m 0755 build/server/munin-graph $(LIBDIR)/ … … 47 63 $(INSTALL) -m 0755 build/server/munin-limits $(LIBDIR)/ 48 64 $(INSTALL) -m 0755 build/server/munin-cgi-graph $(CGIDIR)/ 49 50 65 $(INSTALL) -m 0644 build/server/lib/Munin.pm $(PERLLIB)/ 66 67 uninstall-main: build 68 for p in build/server/*.tmpl; do \ 69 rm -f $(CONFDIR)/templates/"$$p" ; \ 70 done 71 rm -f $(CONFDIR)/templates/logo.png 72 rm -f $(CONFDIR)/templates/style.css 73 rm -f $(CONFDIR)/templates/definitions.html 74 rm -f $(HTMLDIR)/.htaccess 75 76 rm -f $(CONFDIR)/munin.conf 77 78 rm -f $(BINDIR)/munin-cron 79 80 rm -f $(LIBDIR)/munin-update 81 rm -f $(LIBDIR)/munin-graph 82 rm -f $(LIBDIR)/munin-html 83 rm -f $(LIBDIR)/munin-limits 84 rm -f $(CGIDIR)/munin-cgi-graph 85 86 rm -f $(PERLLIB)/Munin.pm 87 -rmdir $(CONFDIR)/templates 88 -rmdir $(CONFDIR) 89 -rmdir $(LIBDIR) 90 -rmdir $(BINDIR) 91 92 -rmdir $(LOGDIR) 93 -rmdir $(STATEDIR) 94 -rmdir $(HTMLDIR) 95 -rmdir $(DBDIR) 96 -rmdir $(CGIDIR) 51 97 52 98 install-node: build install-node-non-snmp install-node-snmp 53 99 echo Done. 54 100 101 uninstall-node: uninstall-node-non-snmp uninstall-node-snmp 102 echo Undone. 103 55 104 install-node-snmp: build 56 105 $(INSTALL) -m 0755 build/node/munin-node-configure-snmp $(SBINDIR)/ 106 107 uninstall-node-snmp: build 108 rm -f $(SBINDIR)/munin-node-configure-snmp 109 -rmdir $(SBINDIR) 57 110 58 111 install-node-non-snmp: build … … 76 129 $(INSTALL) -m 0755 build/node/munin-run $(SBINDIR)/ 77 130 78 install-node-plugins: build 79 for p in build/node/node.d.$(OSTYPE)/* build/node/node.d/*; do \ 80 if test -f "$$p" ; then \ 81 family=`sed -n 's/^#%# family=\(.*\)$$/\1/p' $$p`; \ 82 test "$$family" || family=contrib; \ 83 if echo $(INSTALL_PLUGINS) | grep $$family >/dev/null; then \ 84 test -f "$(LIBDIR)/plugins/`basename $$p`" \ 85 || $(INSTALL) -m 0755 $$p $(LIBDIR)/plugins/; \ 86 fi; \ 87 fi \ 88 done 131 uninstall-node-non-snmp: build 132 rm -f $(SBINDIR)/munin-node 133 rm -f $(SBINDIR)/munin-node-configure 134 rm -f $(CONFDIR)/munin-node.conf 135 rm -f $(SBINDIR)/munin-run 136 -rmdir $(CONFDIR)/plugin-conf.d 137 -rmdir $(CONFDIR) 138 -rmdir $(SBINDIR) 139 140 # ALWAYS DO THE OS SPECIFIC PLUGINS LAST! THAT WAY THEY OVERWRITE THE 141 # GENERIC ONES 142 install-node-plugins: build $(PLUGINS) Makefile Makefile.config 143 for p in build/node/node.d/* build/node/node.d.$(OSTYPE)/* ; do \ 144 if test -f "$$p" ; then \ 145 family=`sed -n 's/^#%# family=\(.*\)$$/\1/p' $$p`; \ 146 test "$$family" || family=contrib; \ 147 if echo $(INSTALL_PLUGINS) | \ 148 grep $$family >/dev/null; then \ 149 echo Installing $$p; \ 150 $(INSTALL) -m 0755 $$p $(LIBDIR)/plugins/; \ 151 fi; \ 152 fi \ 153 done 154 -mkdir -p $(PLUGSTATE) 155 $(CHOWN) $(PLUGINUSER):$(GROUP) $(PLUGSTATE) 156 $(CHMOD) 0664 $(PLUGSTATE) 89 157 $(INSTALL) -m 0644 build/node/plugins.history $(LIBDIR)/plugins/ 158 $(INSTALL) -m 0644 build/node/plugin.sh $(LIBDIR)/plugins/ 159 mkdir -p $(PERLLIB)/Munin 160 $(INSTALL) -m 0644 build/node/Plugin.pm $(PERLLIB)/Munin/ 90 161 91 162 mkdir -p $(PERLLIB)/Munin/Plugin … … 94 165 $(INSTALL) -m 0644 build/node/lib/Munin/Node/Runner.pm $(PERLLIB)/Munin/Node/ 95 166 96 #TODO: 97 #configure plugins. 98 99 install-man: build-man 167 uninstall-node-plugins: build $(PLUGINS) 168 for p in build/node/node.d.$(OSTYPE)/* build/node/node.d/*; do \ 169 rm -f $(LIBDIR)/plugins/`basename $$p` \ 170 done 171 rm -f $(LIBDIR)/plugins/plugins.history 172 rm -f $(LIBDIR)/plugins/plugin.sh 173 174 #TODO: 175 #configure plugins. 176 177 install-man: build-man Makefile Makefile.config 100 178 mkdir -p $(MANDIR)/man1 $(MANDIR)/man5 $(MANDIR)/man8 101 179 $(INSTALL) -m 0644 build/doc/munin-node.conf.5 $(MANDIR)/man5/ … … 111 189 $(INSTALL) -m 0644 build/doc/munin-cron.8 $(MANDIR)/man8/ 112 190 191 uninstall-man: build-man 192 rm -f $(MANDIR)/man5/munin-node.conf.5 193 rm -f $(MANDIR)/man5/munin.conf.5 194 rm -f $(MANDIR)/man8/munin-node.8 195 rm -f $(MANDIR)/man8/munin-node-configure.8 196 rm -f $(MANDIR)/man8/munin-node-configure-snmp.8 197 rm -f $(MANDIR)/man8/munin-run.8 198 rm -f $(MANDIR)/man8/munin-graph.8 199 rm -f $(MANDIR)/man8/munin-update.8 200 rm -f $(MANDIR)/man8/munin-limits.8 201 rm -f $(MANDIR)/man8/munin-html.8 202 rm -f $(MANDIR)/man8/munin-cron.8 203 -rmdir $(MANDIR)/man1 $(MANDIR)/man5 $(MANDIR)/man8 $(MANDIR) 204 113 205 install-doc: build-doc 114 mkdir -p $(DOCDIR) 115 $(INSTALL) -m 0644 build/doc/munin-doc.html $(DOCDIR)/ 116 $(INSTALL) -m 0644 build/doc/munin-doc.pdf $(DOCDIR)/ 117 $(INSTALL) -m 0644 build/doc/munin-doc.txt $(DOCDIR)/ 118 $(INSTALL) -m 0644 build/doc/munin-faq.html $(DOCDIR)/ 119 $(INSTALL) -m 0644 build/doc/munin-faq.pdf $(DOCDIR)/ 120 $(INSTALL) -m 0644 build/doc/munin-faq.txt $(DOCDIR)/ 121 $(INSTALL) -m 0644 README.* $(DOCDIR)/ 206 mkdir -p $(DOCDIR)/resources 207 $(INSTALL) -m 0644 README $(DOCDIR)/ 122 208 $(INSTALL) -m 0644 COPYING $(DOCDIR)/ 123 $(INSTALL) -m 0644 build/README-apache-cgi $(DOCDIR)/ 124 $(INSTALL) -m 0644 node/node.d/README $(DOCDIR)/README.plugins 209 $(INSTALL) -m 0644 build/resources/* $(DOCDIR)/resources 210 211 uninstall-doc: build-doc 212 rm -rf $(DOCDIR) 125 213 126 214 build: build-stamp 127 215 128 build-stamp: 129 @for file in `find . -type f -name '*.in'`; do \ 216 # Recursive pattern rule needed. 217 # %: %.in Makefile Makefile.config 218 219 build-stamp: $(INFILES) Makefile Makefile.config 220 touch build-stamp 221 rm -rf build 222 @for file in $(INFILES); do \ 130 223 destname=`echo $$file | sed 's/.in$$//'`; \ 131 echo Generating $$destname..;\224 echo Generating build/$$destname..; \ 132 225 mkdir -p build/`dirname $$file`; \ 133 226 sed -e 's|@@PREFIX@@|$(PREFIX)|g' \ … … 144 237 -e 's|@@PERL@@|$(PERL)|g' \ 145 238 -e 's|@@PERLLIB@@|$(PERLLIB)|g' \ 146 -e 's|@@PYTHON@@|$(PYTHON)|g' \147 -e 's|@@OSTYPE@@|$(OSTYPE)|g' \239 -e 's|@@PYTHON@@|$(PYTHON)|g' \ 240 -e 's|@@OSTYPE@@|$(OSTYPE)|g' \ 148 241 -e 's|@@HOSTNAME@@|$(HOSTNAME)|g' \ 149 242 -e 's|@@MKTEMP@@|$(MKTEMP)|g' \ … … 154 247 -e 's|@@GROUP@@|$(GROUP)|g' \ 155 248 -e 's|@@PLUGINUSER@@|$(PLUGINUSER)|g' \ 249 -e 's|@@GOODSH@@|$(GOODSH)|g' \ 250 -e 's|@@BASH@@|$(BASH)|g' \ 156 251 $$file > build/$$destname; \ 157 252 done 158 touch build-stamp 159 160 build-doc: build-doc-stamp 253 254 build-doc: build-doc-stamp Makefile Makefile.config 161 255 162 256 build-doc-stamp: 257 touch build-doc-stamp 163 258 mkdir -p build/doc 164 -htmldoc munin-doc-base.html > build/doc/munin-doc.html 165 -htmldoc -t pdf --webpage build/doc/munin-doc.html > build/doc/munin-doc.pdf 166 -html2text -style pretty -nobs build/doc/munin-doc.html > build/doc/munin-doc.txt 167 168 -htmldoc munin-faq-base.html > build/doc/munin-faq.html 169 -htmldoc -t pdf --webpage build/doc/munin-faq.html > build/doc/munin-faq.pdf 170 -html2text -style pretty -nobs build/doc/munin-faq.html > build/doc/munin-faq.txt 171 172 touch build-doc-stamp 173 174 build-man: build-man-stamp 175 176 build-man-stamp: build 259 260 build-man: build-man-stamp 261 262 build-man-stamp: build Makefile Makefile.config 263 touch build-man-stamp 177 264 mkdir -p build/doc 178 pod2man --section=8 --release=$(RELEASE) --center="Munin Documentation" \ 179 build/node/munin-node > build/doc/munin-node.8 180 pod2man --section=8 --release=$(RELEASE) --center="Munin Documentation" \ 181 build/node/munin-run > build/doc/munin-run.8 182 pod2man --section=8 --release=$(RELEASE) --center="Munin Documentation" \ 183 build/node/munin-node-configure-snmp > build/doc/munin-node-configure-snmp.8 184 pod2man --section=8 --release=$(RELEASE) --center="Munin Documentation" \ 185 build/node/munin-node-configure > build/doc/munin-node-configure.8 186 pod2man --section=8 --release=$(RELEASE) --center="Munin Documentation" \ 187 build/server/munin-graph > build/doc/munin-graph.8 188 pod2man --section=8 --release=$(RELEASE) --center="Munin Documentation" \ 189 build/server/munin-update > build/doc/munin-update.8 190 pod2man --section=8 --release=$(RELEASE) --center="Munin Documentation" \ 191 build/server/munin-limits > build/doc/munin-limits.8 192 pod2man --section=8 --release=$(RELEASE) --center="Munin Documentation" \ 193 build/server/munin-html > build/doc/munin-html.8 194 pod2man --section=8 --release=$(RELEASE) --center="Munin Documentation" \ 195 server/munin-cron.pod > build/doc/munin-cron.8 196 pod2man --section=5 --release=$(RELEASE) --center="Munin Documentation" \ 197 server/munin.conf.pod > build/doc/munin.conf.5 198 pod2man --section=5 --release=$(RELEASE) --center="Munin Documentation" \ 199 node/munin-node.conf.pod > build/doc/munin-node.conf.5 200 201 touch build-man-stamp 265 for f in $(MAN8); do \ 266 pod2man --section=8 --release=$(RELEASE) --center=$(MANCENTER) build/"$$f" > build/doc/`basename $$f`.8; \ 267 done 268 for f in $(PODMAN8); do \ 269 pod2man --section=8 --release=$(RELEASE) --center=$(MANCENTER) "$$f".pod > build/doc/`basename $$f .pod`.8; \ 270 done 271 for f in $(PODMAN5); do \ 272 pod2man --section=5 --release=$(RELEASE) --center=$(MANCENTER) "$$f".pod > build/doc/`basename $$f .pod`.5; \ 273 done 274 202 275 203 276 deb: 277 (! grep MAINTAINER Makefile.config) 204 278 -rm debian 205 279 -ln -s dists/debian … … 207 281 208 282 rpm-pre: 283 (! grep MAINTAINER Makefile.config) 209 284 @for file in `find dists/redhat/ -type f -name '*.in'`; do \ 210 285 destname=`echo $$file | sed 's/.in$$//'`; \ … … 225 300 226 301 suse-pre: 302 (! grep MAINTAINER Makefile.config) 227 303 @for file in `find dists/suse/ -type f -name '*.in'`; do \ 228 304 destname=`echo $$file | sed 's/.in$$//'`; \ … … 259 335 260 336 source_dist: clean 261 (cd ..; ln -s $(DIR) munin-$(VERSION)) 337 (! grep MAINTAINER Makefile.config) 338 (cd .. && ln -s $(DIR) munin-$(VERSION)) 262 339 tar -C .. --dereference --exclude .svn -cvzf ../munin_$(RELEASE).tar.gz munin-$(VERSION)/ 340 (cd .. && rm munin-$(VERSION)) 263 341 264 342 ifeq ($(MAKELEVEL),0) … … 281 359 ln -s $< $@ 282 360 361 node-monkeywrench: install-node 362 rm -rf $(CONFDIR)/plugins 363 rm -rf $(LIBDIR)/plugins 364 mkdir -p $(LIBDIR)/plugins 365 mkdir -p $(CONFDIR)/plugins 366 cp monkeywrench/plugin-break*_ $(LIBDIR)/plugins/ 367 $(SBINDIR)/munin-node-configure --suggest 368 echo 'Done?' 369 283 370 t/install: 284 371 $(MAKE) clean install-node install-node-plugins CONFIG=t/Makefile.config INSTALL_PLUGINS=test people/ilmari/modularisation-branch/Makefile.config
r1012 r1265 1 # MAINTAINER VERSION OF Makefile.config 2 # -*- Makefile -*- 3 # 4 # This file is rigged to overwrite the a debian munin-package as that 5 # is what janl uses. 6 # 7 # $Id$ 8 1 9 # This file specifies where Munin will look for things after you've 2 10 # run 'make' in the source directory. Modify it to suit your needs. … … 5 13 # a shadow tree during make install. 6 14 7 # 8 # the base of the Munin installation. 9 # 10 PREFIX = $(DESTDIR)/opt/munin 15 # Include the default config 16 include Makefile.config-dist 11 17 12 # Where Munin keeps its configurations (server.conf, client.conf, ++) 13 CONFDIR = $(DESTDIR)/etc/opt/munin 18 # Then override 14 19 15 # Server only - where to put munin-cron 16 BINDIR = $(PREFIX)/bin 17 18 # Client only - where to put munin-node, munin-node-configure, and munin-run 19 SBINDIR = $(PREFIX)/sbin 20 21 # Where to put text and html documentation 22 DOCDIR = $(PREFIX)/doc 23 24 # Where to put man pages 25 MANDIR = $(PREFIX)/man 20 PREFIX = $(DESTDIR)/usr 21 CONFDIR = $(DESTDIR)/etc/munin 22 DOCDIR = $(PREFIX)/share/doc/munin 23 MANDIR = $(PREFIX)/share/man 26 24 27 25 # Where to put internal binaries and plugin repository 28 LIBDIR = $(PREFIX)/ lib26 LIBDIR = $(PREFIX)/share/munin 29 27 30 28 # Server only - Output directory 31 HTMLDIR = $(PREFIX)/var/www32 CGIDIR = $(HTMLDIR)/ cgi29 HTMLDIR = /var/www/munin 30 CGIDIR = $(HTMLDIR)/../cgi 33 31 34 32 # Client only - Where to put RRD files and other intenal data 35 DBDIR = $(DESTDIR)/var/ opt/munin33 DBDIR = $(DESTDIR)/var/lib/munin 36 34 37 35 # Client only - Where plugins should put their states. Must be writable by … … 52 50 PYTHON = /usr/bin/env python 53 51 52 # A modern shell. We're not looking for arrays, but $() and other modern 53 # stuff is expected. 54 # Linux: /bin/bash 55 # SunOS/Solaris: /usr/xpg4/bin/sh or /bin/ksh 56 # In general: bash or ksh will work 57 GOODSH = /bin/bash 58 59 # Path of bash for bash specific plugins 60 BASH = /bin/bash 61 54 62 # Server only - Where to install the perl libraries 55 PERLLIB = $(DESTDIR)$(shell $(PERL) -V:sitelib | cut -d = -f2 | sed "s/[\';]//g")63 PERLLIB = $(DESTDIR)$(shell $(PERL) -V:sitelib | cut -d"'" -f2) 56 64 57 65 # Client only - Install plugins for this architecture people/ilmari/modularisation-branch/RELEASE
r1045 r1265 1 s napshot1 svn-trunk people/ilmari/modularisation-branch/node/munin-node-configure-snmp.in
r1012 r1265 1 1 #!@@PERL@@ -w 2 2 # 3 # Copyright (C) 2004 Jimmy Olsen3 # Copyright (C) 2004-2006 Jimmy Olsen 4 4 # 5 5 # This program is free software; you can redistribute it and/or … … 17 17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 18 # 19 #20 19 21 20 use strict; … … 63 62 "snmpversion=s" => \$snmpver, 64 63 "community=s" => \$community, 65 "newer=s" => \$newer64 "newer=s" => \$newer # Seems unused 66 65 ); 67 66 … … 87 86 --servicedir <dir> Override plugin dir [$servicedir] 88 87 --libdir <dir> Override plugin lib [$libdir] 89 88 --snmpversion <ver> Override SNMP version [$snmpver] 89 --community <str> Override SNMP community [$community] 90 90 91 91 "; … … 100 100 Written by Jimmy Olsen 101 101 102 Copyright (C) 2004-200 5Jimmy Olsen102 Copyright (C) 2004-2006 Jimmy Olsen 103 103 104 104 This is free software released under the GNU General Public License. There … … 166 166 ); 167 167 $session->translate (0); 168 die $error if $error; 168 169 169 170 if (!defined ($session)) people/ilmari/modularisation-branch/node/munin-node-configure.in
r1012 r1265 1 1 #!@@PERL@@ -w 2 # -*- perl -*- 2 3 # 3 # Copyright (C) 200 4 Jimmy Olsen4 # Copyright (C) 2003-2006 Jimmy Olsen, Nicolai Langfeldt. 4 5 # 5 6 # This program is free software; you can redistribute it and/or … … 17 18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 19 # 19 # Program to suggest configurations and configuration changes. 20 # 20 # Program to suggest what plugins to use and not 21 21 22 22 $| = 1; # Flush after every write to stdout … … 24 24 use strict; 25 25 use Getopt::Long; 26 # use Data::Dumper; 26 27 27 28 my $version = "@@VERSION@@"; … … 46 47 my $do_version = 0; 47 48 my $newer = undef; 49 my $debugopt = '--debug'; # Pass --debug to children or not 50 my @errors = (); 51 my $exiterror = 1; 48 52 49 53 $do_error = 1 unless GetOptions ( 50 54 "help" => \$do_usage, 51 55 "shell!" => \$shell, 56 "exitnoterror!" => \$exiterror, 52 57 "debug!" => \$debug, 53 58 "suggest!" => \$suggest, … … 79 84 --suggest Show suggestions instead of status 80 85 --shell Show shell commands (implies --suggest) 86 --exitnoterror Do not consider non-zero exit-value as error 81 87 --remove-also Also show rm-commands when doing --shell 82 88 --newer <version> Only show suggestions related to plugins newer … … 86 92 --snmpcommunity <comm> Set SNMP community [public] 87 93 94 By default this program shows which plugins are activated on the 95 system. If you specify --suggest it will present a table of plugins 96 that will probably work (according to the plugins autoconf command). 97 If you specify --shell shell commands to install those same plugins 98 will be printed. These can be reviewed or piped directly into a shell 99 to install the plugins. 100 88 101 "; 89 102 … … 97 110 Written by Jimmy Olsen 98 111 99 Copyright (C) 2003-200 5Jimmy Olsen112 Copyright (C) 2003-2006 Jimmy Olsen 100 113 101 114 This is free software released under the GNU General Public License. There … … 110 123 if (defined $newer and (!$shell or $removes)) 111 124 { 112 print "Fatal: --newer only supported along with --shell.\n";125 print STDERR "Fatal: --newer only supported along with --shell.\n"; 113 126 exit 2; 114 127 } 115 128 116 if (!@families) 117 { 129 if (@families) { 130 @families = split /,/ , $families[0]; 131 } else { 118 132 if (@snmp) 119 133 { … … 131 145 } 132 146 133 @families = split (/,/, join (',', @families)); 134 @snmp = split (/,/, join (',', @snmp)); 147 # Normalize input in case it was taken from commandline? 148 # This seems like a noop no matter what went before. 149 # @families = split (/,/, join (',', @families)); 150 # @snmp = split (/,/, join (',', @snmp)); 135 151 136 152 if (@snmp and !$shell) 137 153 { 138 print "Fatal: --snmp only supported along with --shell.\n";154 print STDERR "Fatal: --snmp only supported along with --shell.\n"; 139 155 exit 3; 140 156 } … … 158 174 foreach my $plug (sort keys %{$plugins}) 159 175 { 176 # print "New plugin: ", Dumper $plugins->{$plug},"\n"; 177 160 178 next unless defined $plugins->{$plug}->{'family'}; 161 179 next unless (grep (/^$plugins->{$plug}->{'family'}$/, @families)); … … 282 300 &normal ($plug, $now, ""); 283 301 } 284 285 }286 }287 } 302 } 303 } 304 } 305 288 306 289 307 if (@snmp and $shell) … … 297 315 push (@params, "--snmpversion", $snmpver) if defined $snmpver; 298 316 push (@params, "--community", $snmpcomm) if defined $snmpcomm; 299 push (@params, "--debug") if $debug;317 push (@params, $debugopt) if $debug; 300 318 push (@params, @snmp); 319 print "# executing: ",join(' ',@params),"\n" if $debug; 301 320 exec (@params); 302 321 # NOTREACHED … … 317 336 } 318 337 338 if (@errors) { 339 print STDERR "# There were some errors:\n"; 340 print STDERR "# ",join("\n# ",@errors),"\n"; 341 342 exit 1; 343 } 344 319 345 sub link_remove 320 346 { … … 347 373 } 348 374 349 sub get_installed 350 { 375 sub get_installed { 351 376 (my $ps, my $dir) = @_; 352 377 353 print " DEBUG:Opening \"$dir\" for reading...\n" if $debug;354 opendir (DIR, $dir) or die "Could not open \"$dir\" for reading: $! ";378 print "# Opening \"$dir\" for reading...\n" if $debug; 379 opendir (DIR, $dir) or die "Could not open \"$dir\" for reading: $!\n"; 355 380 my @installed = readdir (DIR); 381 print "# Found ",scalar(@installed)," files\n" if $debug; 356 382 close (DIR); 357 383 358 foreach my $inst (@installed) 359 { 384 foreach my $inst (@installed) { 360 385 my $realfile = undef; 361 386 … … 365 390 $realfile =~ s/^.+\///; 366 391 367 print " DEBUG:Checking file: $inst..." if $debug;392 print "# Checking file: $inst..." if $debug; 368 393 if ($realfile =~ /_$/) # Wildcard plugin... 369 394 { 370 print " $realfile..." if $debug;395 print "# $realfile..." if $debug; 371 396 (my $wild = $inst) =~ s/^$realfile//; 372 print " $wild..." if $debug;397 print "# $wild..." if $debug; 373 398 push @{$ps->{$realfile}->{'suggest'}}, $wild; 374 399 } … … 381 406 } 382 407 383 sub get_plugins 384 { 385 (my $ps, my $dir) = @_; 386 my %versions = (); 387 388 if (defined $newer and -f "$dir/plugins.history") 389 { 390 if (open (HIST, "$dir/plugins.history")) 391 { 392 my @slurp = <HIST>; 393 my $reached_version = 0; 394 my $ver = "0.0.0"; 395 close (HIST); 396 my $uname = lc `uname`; 397 chomp $uname; 398 399 foreach my $line (@slurp) 400 { 401 chomp $line; 402 $line =~ s/#.*//g; 403 $line =~ s/^\s+//g; 404 $line =~ s/\s+$//g; 405 next unless $line =~ /\S/; 406 407 if ($line =~ /^\[([^\]]+)\]$/) 408 { 409 $ver = $1; 410 print "Setting version to \"$ver\".\n" if $debug; 411 if ($ver eq $newer) 412 { 413 $reached_version = 1; 408 sub get_plugins { 409 (my $ps, my $dir) = @_; 410 my %versions = (); 411 412 if (defined $newer and -f "$dir/plugins.history") { 413 if (open (HIST, "$dir/plugins.history")) { 414 my @slurp = <HIST>; 415 my $reached_version = 0; 416 my $ver = "0.0.0"; 417 close (HIST); 418 my $uname = lc `uname`; 419 chomp $uname; 420 421 foreach my $line (@slurp) { 422 chomp $line; 423 $line =~ s/#.*//g; 424 $line =~ s/^\s+//g; 425 $line =~ s/\s+$//g; 426 next unless $line =~ /\S/; 427 428 if ($line =~ /^\[([^\]]+)\]$/) { 429 $ver = $1; 430 print "# Setting version to \"$ver\".\n" if $debug; 431 if ($ver eq $newer) { 432 $reached_version = 1; 433 } elsif ($reached_version) { 434 $reached_version++; 435 } 436 } elsif ($reached_version < 2) { 437 next; 438 } elsif ($line =~ /^([^\/]+)\/(.+)$/) { 439 if ($uname eq $1) { 440 $ps->{$2}->{'version'} = $ver; 441 print "# - Adding plugin '$2' to version tree ", 442 "($ver)...\n" if $debug; 443 } 444 } elsif ($line =~ /^(.+)$/) { 445 $ps->{$1}->{'version'} = $ver; 446 print "# - Adding plugin \"$1\" to version tree ", 447 "($ver)...\n" if $debug; 448 } 449 } 450 } else { 451 warn "Warning: Could not open \"$dir/plugins.history\": $!\n"; 452 } 453 } 454 455 print "# Opening \"$dir\" for reading...\n" if $debug; 456 opendir (DIR, $dir) or die "Could not open \"$dir\" for reading: $!\n"; 457 my @plugins = readdir (DIR); 458 print "# Found ",scalar(@plugins)," files\n" if $debug; 459 close (DIR); 460 461 foreach my $plug (@plugins) { 462 my $path = "$dir/$plug"; 463 next if $plug =~ /^\./; 464 print "# Considering $dir/$plug for checking\n" if $debug; 465 # If anyone ever uses a relative symlink this will break so bad 466 $path = readlink($path) and 467 $path = $path =~ /^\// ? $path : "$dir/$path" 468 while -l $path; 469 if (!-f $path) { 470 print "# File is not a file\n" if $debug; 471 next; 472 } 473 if (!-x _) { 474 print "# File is not executable\n" if $debug; 475 next; 476 } 477 if ($plug =~ /~$/ or # Emacs droppings 478 $plug =~ /.bak$/ or # Backup file 479 $plug =~ /.swp$/) { # Vi droppings 480 print "# File is a backup/leftover file\n" if $debug; 481 next; 482 } 483 484 $ps->{$plug}->{'family'} = "contrib"; # Set default family... 485 486 print "# Checking plugin: $plug..." if $debug; 487 if (! open (FILE, "$dir/$plug")) { 488 warn "WARNING: Could not open file '$dir/$plug' for reading $!.". 489 "Skipping.\n"; 490 next; 491 } 492 while (<FILE>) { 493 chomp; 494 if (/#%#\s+family\s*=\s*(\S+)\s*$/) { 495 $ps->{$plug}->{'family'} = $1; 496 print "# $1..." if $debug; 497 } elsif (/#%#\s+capabilities\s*=\s*(.+)$/) { 498 foreach my $cap (split (/\s+/, $1)) { 499 $ps->{$plug}->{'capability'}->{$cap} = 1; 500 print "# $cap..." if $debug; 501 } 502 } 503 } 504 close (FILE); 505 506 unless (grep (/^$ps->{$plug}->{'family'}$/, @families)) { 507 print "\n" if $debug; 508 next; 509 } 510 if ($ps->{$plug}->{'family'} eq "auto" and defined $newer and 511 !defined $ps->{$plug}->{'version'}) { 512 print "\n" if $debug; 513 next; 514 } 515 516 517 if ($ps->{$plug}->{'capability'}->{'autoconf'}) { 518 519 my $gotjunk=0; # Seen junk? 520 521 my @cmd=("$bindir/munin-run"); 522 push(@cmd,$debugopt) if $debug; 523 push(@cmd,"--servicedir",$libdir, $plug, "autoconf"); 524 525 print "\n# Running: ",join(' ',@cmd),"\n" if $debug; 526 527 my $fork = open (PLUG, "-|"); 528 529 if ($fork == -1) { 530 die "ERROR: Unable to fork: $!\n" 531 } elsif ($fork == 0) { # Child 532 close (STDERR); 533 open (STDERR, ">&STDOUT"); 534 exec (@cmd); 535 } else { 536 # The join map we used here before was somehow 537 # fragile. This construct is possible to 538 # debug.L 539 540 my @pr = (); # Plugin response 541 542 # IFF the plugin exits with non-zero exit code we will 543 # not use it no matter what. Instead we report it as 544 # an error. This is to be able to tell a error free 545 # execution from a erronous one. 546 # 547 # Also, if the plugin outputs junk we handle that as 548 # an error. 549 550 while (<PLUG>) { 551 chomp; 552 if (m/^yes$/ or m/^no(\s+.*)?$/) { 553 # Some recognized response 554 print "# Got yes/no: $_\n" if $debug; 555 push(@pr,$_); 556 } elsif (m/^#/) { 557 # Likely debug output from munin-run 558 print "# munin-run says: $_\n" if $debug; 559 } else { 560 # Something else 561 push(@errors,"Got from $plug: $_"); 562 print "# Got junk: $_\n" if $debug; 563 $gotjunk=1; 564 } 565 } 566 567 $ps->{$plug}->{'defaultreason'}=join(' ',@pr); 568 569 # Do we have a yes? 570 if ($ps->{$plug}->{'defaultreason'} =~ m/yes/) { 571 $ps->{$plug}->{'default'} = "yes" 572 } else { 573 $ps->{$plug}->{'default'} = "no" 574 } 575 } 576 close (PLUG); 577 my $pluges = $?; 578 my $plugexit = $?>>8; 579 my $plugsig = $? & 127; 580 581 # Override to no if there were errors. 582 if ($pluges and !$exiterror) { 583 push(@errors, 584 "Non-zero exit value from $plug: $plugexit/$plugsig"); 585 print "# Non-zero exit value from $plug: $plugexit/$plugsig\n" 586 if $debug; 587 } 588 if ($? or $gotjunk) { 589 $ps->{$plug}->{'default'} = "no"; 590 } 591 print "# ",$ps->{$plug}->{'default'} if $debug; 592 } 593 594 if ($ps->{$plug}->{'capability'}->{'suggest'}) { 595 596 my @sugg = (); 597 598 if (exists $ps->{$plug}->{'default'} and 599 $ps->{$plug}->{'default'} eq "yes") { 600 601 my @cmd=("$bindir/munin-run"); 602 # Debug here breaks stuff. 603 # push(@cmd,$debugopt) if $debug; 604 push(@cmd,"--servicedir",$libdir, $plug, "suggest"); 605 606 print "\n# Running: ",join(' ',@cmd),"\n" if $debug; 607 608 my $fork = open (PLUG, "-|"); 609 610 if ($fork == -1) { 611 die "ERROR: Unable to fork: $!\n" 612 } elsif ($fork == 0) { # Child 613 # We would redirect stderr, but with suggest 614 # it's hard to sort errors from the suggestions 615 # as we have no idea what the suggestions might 616 # be. 617 exec (@cmd); 618 } else { 619 # Fragile loop, blah blah (se above) 620 621 622 while (<PLUG>) { 623 chomp; 624 if (m/^#/) { 625 # debug output from munin-run 626 print "# Got junk: $_\n" if $debug; 627 } else { 628 # This ought to be a suggestion. 629 print "# Got suggestion: $_\n" if $debug; 630 push(@sugg,$_); 414 631 } 415 elsif ($reached_version) 416 { 417 $reached_version++; 418 } 419 } 420 elsif ($reached_version < 2) 421 { 422 next; 423 } 424 elsif ($line =~ /^([^\/]+)\/(.+)$/) 425 { 426 if ($uname eq $1) 427 { 428 $ps->{$2}->{'version'} = $ver; 429 print "-- Adding plugin \"$2\" to version tree ($ver)...\n" if $debug; 430 } 431 } 432 elsif ($line =~ /^(.+)$/) 433 { 434 $ps->{$1}->{'version'} = $ver; 435 print "-- Adding plugin \"$1\" to version tree ($ver)...\n" if $debug; 436 } 437 } 438 } 439 else 440 { 441 warn "Warning: Could not open \"$dir/plugins.history\": $!"; 442 } 443 } 444 445 print "DEBUG: Opening \"$dir\" for reading...\n" if $debug; 446 opendir (DIR, $dir) or die "Could not open \"$dir\" for reading: $!"; 447 my @plugins = readdir (DIR); 448 close (DIR); 449 450 foreach my $plug (@plugins) 451 { 452 my $path = "$dir/$plug"; 453 $path = readlink($path) and $path = $path =~ /^\// ? $path : "$dir/$path" while -l $path; 454 next unless -f $path; 455 next unless -x _; 456 457 next if $plug =~ /^\./; 458 459 $ps->{$plug}->{'family'} = "contrib"; # Set default family... 460 461 print "DEBUG: Checking plugin: $plug..." if $debug; 462 if (! open (FILE, "$dir/$plug")) 463 { 464 warn "WARNING: Could not open file \"$dir/$plug\" for reading ($!). Skipping."; 465 next; 466 } 467 while (<FILE>) 468 { 469 chomp; 470 if (/#%#\s+family\s*=\s*(\S+)\s*$/) 471 { 472 $ps->{$plug}->{'family'} = $1; 473 print "$1..." if $debug; 474 } 475 elsif (/#%#\s+capabilities\s*=\s*(.+)$/) 476 { 477 foreach my $cap (split (/\s+/, $1)) 478 { 479 $ps->{$plug}->{'capability'}->{$cap} = 1; 480 print "$cap..." if $debug; 481 } 482 } 483 } 484 close (FILE); 485 486 unless (grep (/^$ps->{$plug}->{'family'}$/, @families)) { 487 print "\n" if $debug; 488 next; 489 } 490 if ($ps->{$plug}->{'family'} eq "auto" and defined $newer and 491 !defined $ps->{$plug}->{'version'}) { 492 print "\n" if $debug; 493 next; 494 } 495 496 if ($ps->{$plug}->{'capability'}->{'autoconf'}) 497 { 498 my $fork = open (PLUG, "-|"); 499 500 if ($fork == -1) 501 { 502 die "ERROR: Unable to fork: $!" 503 } 504 elsif ($fork == 0) # Child 505 { 506 close (STDERR); 507 open (STDERR, ">&STDOUT"); 508 exec ("$bindir/munin-run", "--servicedir", $libdir, $plug, "autoconf"); 509 } 510 else 511 { 512 $ps->{$plug}->{'defaultreason'} = join (' ', map {chomp; $_} <PLUG>); 513 } 514 close (PLUG); 515 if ($?) 516 { 517 $ps->{$plug}->{'default'} = "no"; 518 } 519 else 520 { 521 $ps->{$plug}->{'default'} = "yes"; 522 } 523 print $ps->{$plug}->{'default'}, ":", $ps->{$plug}->{'defaultreason'}, "..." if $debug; 524 } 525 526 if ($ps->{$plug}->{'capability'}->{'suggest'}) 527 { 528 if (exists $ps->{$plug}->{'default'} and 529 $ps->{$plug}->{'default'} eq "yes") 530 { 531 my $fork = open (PLUG, "-|"); 532 533 if ($fork == -1) 534 { 535 die "ERROR: Unable to fork: $!" 536 } 537 elsif ($fork == 0) # Child 538 { 539 exec ("$bindir/munin-run", "--servicedir", $libdir, $plug, "suggest"); 540 } 541 else 542 { 543 push (@{$ps->{$plug}->{'suggest'}}, split (/\s+/, join (' ', map {chomp; $_} <PLUG>))); 544 } 545 close (PLUG); 546 if ($?) 547 { 548 $ps->{$plug}->{'suggest'} = ""; 549 } 550 print join (' ', @{$ps->{$plug}->{'suggest'}}) if $debug; 551 552 } 553 } 554 555 print "\n" if $debug; 556 } 557 return $ps; 632 } 633 } 634 close (PLUG); 635 if ($?) { 636 @sugg = (); 637 print "# Plugin exit code: $? - voiding suggestions\n" 638 if $debug; 639 } 640 641 @{$ps->{$plug}->{'suggest'}} = @sugg; 642 643 if ($debug) { 644 print "# Suggested: ", 645 join (' ', @{$ps->{$plug}->{'suggest'}}),"\n"; 646 647 print "# ERROR: empty suggest from $plug\n" 648 if !@sugg; 649 } 650 651 push(@errors,"ERROR: empty suggest from $plug") 652 unless @sugg; 653 } 654 } 655 print "\n" if $debug; 656 } 657 # print Dumper $ps; 658 return $ps; 558 659 } 559 660 … … 582 683 =item B<< --debug >> 583 684 584 View debug information (very verbose) 685 Print debug information (very verbose). All debugging output is 686 printed on STDOUT but each line is prefixed with '#'. Only errors are 687 printed on STDERR. 585 688 586 689 =item B<< --config <file> >> … … 653 756 =head1 AUTHORS 654 757 655 Jimmy Olsen .758 Jimmy Olsen, Nicolai Langfeldt 656 759 657 760 =head1 BUGS … … 661 764 =head1 COPYRIGHT 662 765 663 Copyright © 2003 Jimmy Olsen766 Copyright (C) 2003-2006 Jimmy Olsen, Nicolai Langfeldt. 664 767 665 768 This is free software; see the source for copying conditions. There is people/ilmari/modularisation-branch/node/munin-node-simple.in
r1045 r1265 29 29 $| = 1; 30 30 31 my $clientdir = "@@CONF IDR@@/node.d";32 my $conffile = "@@CONF IDR@@/node-simple.conf";31 my $clientdir = "@@CONFDIR@@/node.d"; 32 my $conffile = "@@CONFDIR@@/node-simple.conf"; 33 33 my $version = "@@VERSION@@"; 34 34 people/ilmari/modularisation-branch/node/munin-node.conf.in
r864 r1265 36 36 allow ^127\.0\.0\.1$ 37 37 38 # uncomment this to only listen on the loopback/localhost interface 39 # 40 # host 127.0.0.1 41 people/ilmari/modularisation-branch/node/munin-node.conf.pod
r864 r1265 15 15 by using the module. 16 16 17 Additional options: 17 The following options are of special interest: 18 19 =over 5 20 21 =item B<< allow RE >> 22 23 IP based access list is implemented through this. The statement may be 24 repeated many times. It's important to note that it's actually a 25 regular expression after the keyword so to allow localhost it must be 26 written like this: 27 28 allow ^127\.0\.0\.1$ 29 30 =item B<< host IP >> 31 32 The IP number of the interface munin-node should listen on. By 33 default munin-node listens to all interfaces. To make munin-node 34 listen only on the localhost interface - making it unavailable from 35 the network do this: 36 37 host 127.0.0.1 38 39 =back 40 41 =head2 Additional options: 18 42 19 43 =over 5 … … 70 94 =head1 COPYRIGHT 71 95 72 Copyright © 2002-2004 Audun Ytterdal and Jimmy Olsen / Linpro AS. 96 Copyright (C) 2002-2006 Audun Ytterdal, Jimmy Olsen, Dagfin Ilmari 97 Mansåker, Nicolai Langfeldt 73 98 74 99 This is free software; see the source for copying conditions. There is NO people/ilmari/modularisation-branch/node/munin-node.in
r1045 r1265 1 1 #!@@PERL@@ -wT 2 # -*- cperl -*- 2 3 # 3 4 # Copyright (C) 2002-2006 Audun Ytterdal, Jimmy Olsen, Tore Anderson, … … 45 46 $0 = $1; 46 47 48 # Make configuration settings available at runtime. 49 $ENV{'MUNIN_PREFIX'} = '@@PREFIX@@'; 50 $ENV{'MUNIN_CONFDIR'} = '@@CONFDIR@@'; # /etc/munin,/etc/opt/munin or such 51 $ENV{'MUNIN_BINDIR'} = '@@BINDIR@@'; 52 $ENV{'MUNIN_SBINDIR'} = '@@SBINDIR@@'; 53 $ENV{'MUNIN_DOCDIR'} = '@@DOCDIR@@'; 54 $ENV{'MUNIN_LIBDIR'} = '@@LIBDIR@@'; # LIBDIR/plugins contains plugin.sh 55 $ENV{'MUNIN_HTMLDIR'} = '@@HTMLDIR@@'; 56 $ENV{'MUNIN_CGIDIR'} = '@@CGIDIR@@'; 57 $ENV{'MUNIN_DBDIR'} = '@@DBDIR@@'; 58 $ENV{'MUNIN_PLUGSTATE'} = '@@PLUGSTATE@@'; # Put plugin state files here! 59 $ENV{'MUNIN_MANDIR'} = '@@MANDIR@@'; 60 $ENV{'MUNIN_LOGDIR'} = '@@LOGDIR@@'; 61 $ENV{'MUNIN_STATEDIR'} = '@@STATEDIR@@'; # This is for .pid files 62 $ENV{'MUNIN_USER'} = '@@USER@@'; # User munin runs as (mostly) 63 $ENV{'MUNIN_GROUP'} = '@@GROUP@@'; # Group ditto 64 $ENV{'MUNIN_PLUGINUSER'} = '@@PLUGINUSER@@';# Default user for plugin running 65 $ENV{'MUNIN_VERSION'} = '@@VERSION@@'; 66 $ENV{'MUNIN_PERL'} = '@@PERL@@'; 67 $ENV{'MUNIN_PERLLIB'} = '@@PERLLIB@@'; 68 $ENV{'MUNIN_GOODSH'} = '@@GOODSH@@'; 69 $ENV{'MUNIN_BASH'} = '@@BASH@@'; 70 $ENV{'MUNIN_PYTHON'} = '@@PYTHON@@'; 71 $ENV{'MUNIN_OSTYPE'} = '@@OSTYPE@@'; 72 $ENV{'MUNIN_HOSTNAME'} = '@@HOSTNAME@@'; 73 $ENV{'MUNIN_MKTEMP'} = '@@MKTEMP@@'; 74 47 75 @ISA = qw(Net::Server::Fork); 48 76 my @ORIG_ARGV = @ARGV; 49 77 my %services; 50 78 my %nodes; 51 my $servicedir=" $CONFDIR/plugins";52 my $sconfdir=" $CONFDIR/plugin-conf.d";53 my $conffile=" $CONFDIR/munin-node.conf";79 my $servicedir="@@CONFDIR@@/plugins"; 80 my $sconfdir="@@CONFDIR@@/plugin-conf.d"; 81 my $conffile="@@CONFDIR@@/munin-node.conf"; 54 82 my $FQDN=""; 55 83 my $do_usage = 0; … … 57 85 my $do_version = 0; 58 86 my $VERSION=$Muninnode::VERSION; 59 my $defuser = getpwnam ( $PLUGINUSER);60 my $defgroup= getgrnam ( $GROUP);87 my $defuser = getpwnam ("@@PLUGINUSER@@"); 88 my $defgroup= getgrnam ("@@GROUP@@"); 61 89 my $paranoia= 0; 62 90 my @ignores = (); … … 184 212 185 213 MyPackage->run(conf_file => $conffile, 186 pid_file => " $STATEDIR/munin-node.pid");214 pid_file => "@@STATEDIR@@/munin-node.pid"); 187 215 exit; 188 216 … … 213 241 my $hostname; 214 242 eval { 215 require Net::Domain;216 $hostname = Net::Domain::hostfqdn();243 require Sys::Hostname; 244 $hostname = (gethostbyname(Sys::Hostname::hostname()))[0]; 217 245 }; 218 246 return $hostname if $hostname; … … 285 313 sub list_services { 286 314 my $node = $_[0] || $FQDN; 287 net_write join " ", grep { &has_access ($_); } keys %{$nodes{$node}} if exists $nodes{$node}; 315 net_write( join( " ", 316 grep( { &has_access ($_); } keys %{$nodes{$node}} ) 317 ) ) 318 if exists $nodes{$node}; 288 319 #print join " ", keys %{$nodes{$node}}; 289 320 net_write ("\n"); … … 542 573 $key = &get_var (\%sconf, "tls_private_key") 543 574 unless defined $key; 544 $key = " $CONFDIR/munin-node.pem" unless defined $key;575 $key = "@@CONFDIR@@/munin-node.pem" unless defined $key; 545 576 $cert = &get_var (\%sconf, "tls_certificate") 546 577 unless defined $cert; 547 $cert = " $CONFDIR/munin-node.pem" unless defined $cert;578 $cert = "@@CONFDIR@@/munin-node.pem" unless defined $cert; 548 579 $mode = &get_var (\%sconf, 'tls'); 549 580 $mode = "auto" unless defined $mode and length $mode; … … 927 958 elsif (/^\s*env\s+([^=\s]+)\s*=\s*(.+)$/) 928 959 { 960 # $sconf->{$service}{'env'}{$1} = $2; 961 # net_write ("Saving $service->env->$1 = $2...\n") if $DEBUG; 962 warn "Warning: Deprecated format in \"$dir/$file\" under \"[$service]\" (\"env $1=$2\" should be rewritten to \"env.$1 $2. Ignored.\")."; 963 } 964 elsif (/^\s*env\.(\S+)\s+(.+)$/) 965 { 929 966 $sconf->{$service}{'env'}{$1} = $2; 930 967 net_write ("Saving $service->env->$1 = $2...\n") if $DEBUG; 931 warn "Warning: Deprecated format in \"$dir/$file\" under \"[$service]\" (\"env $1=$2\" should be rewritten to \"env.$1 $2\").";932 }933 elsif (/^\s*env\.(\S+)\s+(.+)$/)934 {935 $sconf->{$service}{'env'}{$1} = $2;936 net_write ("Saving $service->env->$1 = $2...\n") if $DEBUG;937 968 } 938 969 elsif (/^\s*(\w+)\s+(.+)$/) 939 970 { 940 $sconf->{$service}{'env'}{"lrrd_$1"} = $2;941 net_write ("Saving $service->env->lrrd_$1 = $2...\n") if $DEBUG;942 warn "Warning: Deprecated format in \"$dir/$file\" under \"[$service]\" (\"$1 $2\" should be rewritten to \"env lrrd_$1=$2\").";971 # $sconf->{$service}{'env'}{"lrrd_$1"} = $2; 972 # net_write ("Saving $service->env->lrrd_$1 = $2...\n") if $DEBUG; 973 warn "Warning: Deprecated format in \"$dir/$file\" under \"[$service]\" (\"$1 $2\" should be rewritten to \"env.$1 $2. Ignored.\")."; 943 974 } 944 975 elsif (/\S/) people/ilmari/modularisation-branch/node/munin-run.in
r1264 r1265 1 1 #!@@PERL@@ -wT 2 # 3 # Copyright (C) 2004 Jimmy Olsen 2 # -*- perl -*- 3 4 # Copyright (C) 2004-2006 4 5 # 5 6 # This program is free software; you can redistribute it and/or … … 16 17 # along with this program; if not, write to the Free Software 17 18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 #19 19 # 20 20 # $Id$ … … 29 29 foreach my $key (keys %ENV) 30 30 { 31 if ($ENV{$key} =~ /^(.*)$/) 32 { 31 if ($ENV{$key} =~ /^(.*)$/) { 33 32 $ENV{$key} = $1; 34 } 35 else 36 { 33 } else { 37 34 delete $ENV{$key}; 38 35 } … … 51 48 help)) 52 49 or $config->{help} = 1; 50 51 $0 =~ /^(.*)$/; # for some strange reason won't "$0 = $0;" work. 52 $0 = $1; 53 54 # Make configuration settings available at runtime. 55 $ENV{'MUNIN_PREFIX'} = '@@PREFIX@@'; 56 $ENV{'MUNIN_CONFDIR'} = '@@CONFDIR@@'; # /etc/munin,/etc/opt/munin or such 57 $ENV{'MUNIN_BINDIR'} = '@@BINDIR@@'; 58 $ENV{'MUNIN_SBINDIR'} = '@@SBINDIR@@'; 59 $ENV{'MUNIN_DOCDIR'} = '@@DOCDIR@@'; 60 $ENV{'MUNIN_LIBDIR'} = '@@LIBDIR@@'; # LIBDIR/plugins contains plugin.sh 61 $ENV{'MUNIN_HTMLDIR'} = '@@HTMLDIR@@'; 62 $ENV{'MUNIN_CGIDIR'} = '@@CGIDIR@@'; 63 $ENV{'MUNIN_DBDIR'} = '@@DBDIR@@'; 64 $ENV{'MUNIN_PLUGSTATE'} = '@@PLUGSTATE@@'; # Put plugin state files here! 65 $ENV{'MUNIN_MANDIR'} = '@@MANDIR@@'; 66 $ENV{'MUNIN_LOGDIR'} = '@@LOGDIR@@'; 67 $ENV{'MUNIN_STATEDIR'} = '@@STATEDIR@@'; # This is for .pid files 68 $ENV{'MUNIN_USER'} = '@@USER@@'; # User munin runs as (mostly) 69 $ENV{'MUNIN_GROUP'} = '@@GROUP@@'; # Group ditto 70 $ENV{'MUNIN_PLUGINUSER'} = '@@PLUGINUSER@@';# Default user for plugin running 71 $ENV{'MUNIN_VERSION'} = '@@VERSION@@'; 72 $ENV{'MUNIN_PERL'} = '@@PERL@@'; 73 $ENV{'MUNIN_PERLLIB'} = '@@PERLLIB@@'; 74 $ENV{'MUNIN_GOODSH'} = '@@GOODSH@@'; 75 $ENV{'MUNIN_BASH'} = '@@BASH@@'; 76 $ENV{'MUNIN_PYTHON'} = '@@PYTHON@@'; 77 $ENV{'MUNIN_OSTYPE'} = '@@OSTYPE@@'; 78 $ENV{'MUNIN_HOSTNAME'} = '@@HOSTNAME@@'; 79 $ENV{'MUNIN_MKTEMP'} = '@@MKTEMP@@'; 80 53 81 54 82 if ($config->{help}) … … 137 165 =item B< --debug > 138 166 139 View debug messages. 167 Print debug messages. Debug messages are sent to both STDOUT and are 168 prefixed with "#" (this makes it easier for other parts of munin to 169 use munin-run and still have --debug on). Only errors go to STDERR. 140 170 141 171 =item B< --version > … … 147 177 =head1 DESCRIPTION 148 178 149 Munin's node is a daemon that Munin connects to fetch data. This data is 150 stored in .rrd-files, and later graphed and htmlified. It's designed to 151 let it be very easy to graph new datasources. 152 153 munin-run is a small perlscript to run the plugins used by the munin-node 154 daemon from the command line. 155 156 For more information, see the documentation section at L<http://munin.sf.net/>. 179 Munin-node is a daemon that Munin connects to fetch data. This data 180 is stored in .rrd-files on the central server , and later graphed and 181 htmlified. 182 183 munin-run is a perlscript to run the plugins used by the munin-node 184 daemon from the command line. It's helpful to debug plugins as they 185 are run the same way with the same user and same environment settings 186 as within the munin-node. 187 188 For more information, see the documentation section at 189 L<http://munin.sf.net/>. 157 190 158 191 =head1 FILES … … 170 203 =head1 AUTHORS 171 204 172 Audun Ytterdal, Jimmy Olsen, and Tore Anderson. 205 Audun Ytterdal, Jimmy Olsen, Tore Anderson, Nicolai Langfeldt, 206 Dagfinn Ilmari MannsÃ¥ker. 173 207 174 208 =head1 BUGS … … 180 214 =head1 COPYRIGHT 181 215 182 Copyright © 2002 Audun Ytterdal, Jimmy Olsen, and Tore Anderson / Linpro AS. 216 Copyright (C) 2002-2006 Audun Ytterdal, Jimmy Olsen, Tore Anderson, 217 Nicolai Langfeldt, Dagfinn Ilmari MannsÃ¥ker / Linpro AS. 183 218 184 219 This is free software; see the source for copying conditions. There is people/ilmari/modularisation-branch/node/node.d.aix/cpu.in
r1012 r1265 61 61 print "graph_vlabel %\n"; 62 62 print "graph_scale no\n"; 63 print "graph_category system\n"; 63 64 print "system.label system\n"; 64 65 print "system.type GAUGE\n"; people/ilmari/modularisation-branch/node/node.d.aix/df.in
r1012 r1265 24 24 #%# capabilities=autoconf 25 25 26 27 28 29 26 if [ "$1" = "autoconf" ]; then 30 27 echo yes … … 37 34 echo 'graph_args --upper-limit 100 -l 0' 38 35 echo 'graph_vlabel %' 36 echo 'graph_category disk' 37 echo 'graph_scale no' 39 38 df -P -k | sed 1d | grep -v "//" | grep -v "nfs" | while read i; do 40 39 name=`echo $i | sed 's/[\/.-]/_/g'| awk '{ print $6 }'` people/ilmari/modularisation-branch/node/node.d.aix/iostat.in
r1012 r1265 61 61 print "graph_args --base 1024 -l 0\n"; 62 62 print "graph_vlabel KB / \${graph_period}\n"; 63 print "graph_category disk\n"; 63 64 my(@info) = getDiskIO("disk only"); 64 65 my($line); people/ilmari/modularisation-branch/node/node.d.aix/memory.in
r1012 r1265 62 62 print "graph_title Memory usage\n"; 63 63 print "graph_order inuse free pinned swap\n"; 64 print "graph_category system\n"; 64 65 print "inuse.label inuse\n"; 65 66 print "inuse.draw AREA\n"; people/ilmari/modularisation-branch/node/node.d.aix/netstat.in
r1012 r1265 46 46 print "graph_args -l 0 --base 1000\n"; 47 47 print "graph_vlabel requests connections per \${graph_period}\n"; 48 print "graph_category network\n"; 48 49 print "requests.label requests\n"; 49 50 print "requests.type COUNTER\n"; people/ilmari/modularisation-branch/node/node.d.aix/processes.in
r1012 r1265 55 55 print "graph_args --base 1000 -l 0 \n"; 56 56 print "graph_vlabel number of processes\n"; 57 print "graph_category processes\n"; 57 58 print "global.label global\n"; 58 59 print "global.draw LINE2\n"; people/ilmari/modularisation-branch/node/node.d.aix/swap.in
r1012 r1265 51 51 print "graph_title Swap usage\n"; 52 52 print "graph_order used total\n"; 53 print "graph_category system\n"; 53 54 print "used.label used\n"; 54 55 print "used.draw STACK\n"; people/ilmari/modularisation-branch/node/node.d.freebsd/df.in
r1012 r1265 14 14 #%# capabilities=autoconf 15 15 16 MAXLABEL=2017 18 16 if [ "$1" = "autoconf" ]; then 19 17 echo yes … … 27 25 echo 'graph_vlabel %' 28 26 echo 'graph_category disk' 27 echo 'graph_scale no' 29 28 echo 'graph_info This graph shows disk usage on the machine.' 30 29 mfs=0 … … 35 34 esac 36 35 echo -n "$name.label " 37 echo $i | awk "{ 38 dir=\$6; 39 if (length(dir) <= $MAXLABEL) 40 print dir 41 else 42 printf (\"...%s\n\", substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3)) 43 print \"$name.info \" \$6 \" -> \" \$1; 44 }" 36 echo $i | awk '{ print $6 }' 45 37 echo "$name.warning 92" 46 38 echo "$name.critical 98" people/ilmari/modularisation-branch/node/node.d.freebsd/df_inode.in
r1012 r1265 13 13 #%# family=auto 14 14 #%# capabilities=autoconf 15 16 MAXLABEL=2017 15 18 16 print_values() { … … 43 41 echo 'graph_vlabel %' 44 42 echo 'graph_category disk' 43 echo 'graph_scale no' 45 44 echo 'graph_info This graph shows the inode usage for the partitions of types that use inodes.' 46 45 /bin/df -P -i -t noprocfs,devfs,fdescfs,linprocfs,nfs | tail +2 | grep -v "//" | awk " … … 57 56 gsub(/[^a-zA-Z0-9_]/, \"_\", name) 58 57 } 59 if (length(dir) <= $MAXLABEL) 60 print name \".label \" dir 61 else 62 printf (\"%s.label ...%s\n\", name, substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3)) 58 print name \".label \" dir 63 59 print name \".info \" dir \" -> \" \$1 64 60 print name \".warning 92\" people/ilmari/modularisation-branch/node/node.d.freebsd/if_.in
r1012 r1265 7 7 # 8 8 # ...will monitor eth0. 9 # 10 # To aggregate all network interfaces on the system (except lo0), 11 # link if_aggregated to this file. 9 12 # 10 13 # Any device found in /usr/bin/netstat can be monitored. … … 56 59 echo "obytes.info Traffic sent (+) and received (-) on the $INTERFACE network interface." 57 60 exit 0 58 fi ;61 fi 59 62 60 /usr/bin/netstat -i -b -I $INTERFACE | awk ' 63 if [ "$INTERFACE" = "aggregated" ]; then 64 /usr/bin/netstat -i -b | grep -v '^lo' | awk ' 65 BEGIN { rsum = 0; osum = 0; } 66 /<Link#[0-9]*>/ { 67 if (NF == 10) { 68 rsum += $6; osum += $9; 69 } else { 70 rsum += $7; osum += $10; 71 } 72 } 73 END { 74 printf "rbytes.value %i\n", rsum; 75 printf "obytes.value %i\n", osum; 76 }' 77 78 else 79 /usr/bin/netstat -i -b -I $INTERFACE | awk ' 61 80 /<Link#[0-9]*>/ { 62 81 if (NF == 10) { … … 68 87 } 69 88 }' 89 fi people/ilmari/modularisation-branch/node/node.d.linux/apt.in
r1012 r1265 163 163 } 164 164 } 165 if (/^\d+\s(?:packages )?upgraded,\s\d+\snewly installed, \d+ to remove and (\d+)\s+not upgraded/) 166 { 165 if (/^\d+\supgraded,\s\d+\snewly installed, \d+ to remove and (\d+) not upgraded/) { 167 166 $hold = $1; 168 167 } people/ilmari/modularisation-branch/node/node.d.linux/apt_all.in
r1012 r1265 119 119 } 120 120 } 121 if (/^\d+\s packages upgraded,\s\d+\snewly installed, \d+ to remove and (\d+)not upgraded/)121 if (/^\d+\supgraded,\s\d+\snewly installed, \d+ to remove and (\d+) not upgraded/) 122 122 { 123 123 $hold = $1; people/ilmari/modularisation-branch/node/node.d.linux/cpu.in
r1045 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor CPU usage. … … 27 27 # 28 28 # $Id$ 29 30 29 31 30 if [ "$1" = "autoconf" ]; then … … 108 107 echo "iowait.max $MAX" 109 108 echo 'iowait.type DERIVE' 110 echo 'iowait.info CPU time spent waiting for I/O operations to finish '109 echo 'iowait.info CPU time spent waiting for I/O operations to finish when there is nothing else to do.' 111 110 echo 'irq.label irq' 112 111 echo 'irq.draw STACK' … … 130 129 fi 131 130 131 # Note: Counters/derive need to report integer values. Also we need 132 # to avoid 10e+09 and the like %.0f should do this. 132 133 133 134 if [ ! -z "$extinfo" ]; then 134 awk -v hz=$HZ '/^cpu / { print "user.value " $2*100/hz "\nnice.value " $3*100/hz "\nsystem.value " $4*100/hz "\nidle.value " $5*100/hz "\niowait.value " $6*100/hz "\nirq.value " $7*100/hz "\nsoftirq.value "$8*100/hz }' < /proc/stat135 awk -v hz=$HZ '/^cpu / { printf "user.value %.0f\nnice.value %.0f\nsystem.value %.0f\nidle.value %.0f\niowait.value %.0f\nirq.value %.0f\nsoftirq.value %.0f\n", $2*100/hz, $3*100/hz, $4*100/hz, $5*100/hz, $6*100/hz, $7*100/hz, $8*100/hz }' < /proc/stat 135 136 else 136 awk -v hz=$HZ '/^cpu / { print "user.value " $2*100/hz "\nnice.value " $3*100/hz "\nsystem.value " $4*100/hz "\nidle.value "$5*100/hz }' < /proc/stat137 awk -v hz=$HZ '/^cpu / { printf "user.value %.0f\nnice.value %.0f\nsystem.value %.0f\nidle.value %.0f\n", $2*100/hz, $3*100/hz, $4*100/hz, $5*100/hz }' < /proc/stat 137 138 fi people/ilmari/modularisation-branch/node/node.d.linux/cpuspeed.in
r1045 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor CPU speed … … 29 29 if [ "$1" = "config" ]; then 30 30 cat <<EOF 31 graph_title CPU frequency scaling '31 graph_title CPU frequency scaling 32 32 graph_args --base 1000 -r --lower-limit 0 33 33 graph_vlabel Hz 34 34 graph_scale yes 35 This graph shows at what speeds the CPUs are running35 graph_info This graph shows at what speeds the CPUs are running 36 36 graph_category system 37 37 EOF … … 39 39 for c in /sys/devices/system/cpu/cpu*; do 40 40 N=${c##*/cpu} 41 MAXHZ=$( <$c/cpufreq/cpuinfo_max_freq)41 MAXHZ=$(cat $c/cpufreq/cpuinfo_max_freq) 42 42 cat <<EOF 43 43 cpu$N.label CPU $N 44 44 cpu$N.max $MAXHZ 45 cpu$N.min $( <$c/cpufreq/cpuinfo_min_freq)45 cpu$N.min $(cat $c/cpufreq/cpuinfo_min_freq) 46 46 cpu$N.type GAUGE 47 47 EOF … … 56 56 for c in /sys/devices/system/cpu/cpu*; do 57 57 N=${c##*/cpu} 58 echo "cpu$N.value $( <$c/cpufreq/scaling_cur_freq)"58 echo "cpu$N.value $(cat $c/cpufreq/scaling_cur_freq)" 59 59 done people/ilmari/modularisation-branch/node/node.d.linux/df.in
r1045 r1265 1 #!/usr/bin/perl 1 #!@@PERL@@ 2 # -*- perl -*- 2 3 # 3 4 # Plugin to monitor disk usage. Rewrite based on original shell-based version 4 # 5 # 5 6 # Parameters understood: 6 7 # … … 8 9 # autoconf (optional - used by munin-config) 9 10 # 10 # $Log$ 11 # Environment 12 # exclude: space separated list if fs types to exclude. 13 # iso9660 by default 14 # 15 # $Id$ 11 16 # 12 17 # Magic markers (optional - used by munin-config and installation … … 17 22 18 23 use strict; 24 use Munin::Plugin; 19 25 20 my $MAXLABEL=25;26 my %mounts; 21 27 22 # Read /proc/mounts23 my %mounts;24 28 open (MOUNTS,"/proc/mounts") or die "Could not /proc/mounts for reading."; 25 29 while (<MOUNTS>) { … … 31 35 close MOUNTS; 32 36 37 my $exclude=$ENV{'exclude'} || 'iso9660'; 38 my $dfopts = "-P -l ".join(' -x ',('',split('\s+',$exclude))); 39 33 40 sub print_values() { 34 41 35 42 # Read from df 36 open (DF," /bin/df -P -l |") or die "Could not open pipe from /bin/df, $!";43 open (DF,"df $dfopts |") or die "Could not open pipe from df, $!"; 37 44 <DF>; # Skip the header 38 45 while (<DF>) { … … 43 50 my $fs=$mounts{$6}; 44 51 my $ps=$5; 45 my $name= $1;46 52 my $name=clean_fieldname($1); 53 47 54 $ps =~ s/\%//; 48 $name =~ s/\//_/g; 49 print $name . ".value " . $ps . "\n"; 55 print $name, ".value ", $ps, "\n"; 50 56 } 51 57 } 52 58 close DF; 59 die "Error executing df. Exit code $?\n" if $?; 53 60 } 54 61 55 62 if ( $ARGV[0] eq "autoconf" ) { 56 if (`perl $0` eq "" ) { 57 print "no\n"; 58 exit 1; 59 } 60 elsif ( `uname -s` eq "SunOS\n" ) { 61 print "no\n"; 62 exit 1; 63 } 64 else { 65 print "yes\n"; 66 exit 0; 67 } 63 if (`@@PERL@@ $0` eq "" ) { 64 print "no\n"; 65 exit 1; 66 } else { 67 print "yes\n"; 68 exit 0; 69 } 68 70 } 69 71 … … 74 76 print "graph_args --upper-limit 100 -l 0\n"; 75 77 print "graph_vlabel %\n"; 76 78 print "graph_scale no\n"; 79 print "graph_category disk\n"; 80 77 81 # Read from df 78 open (DF," /bin/df -P -l |") or die "Unable to open pipe from /bin/df";82 open (DF,"df $dfopts |") or die "Unable to open pipe from df: $!"; 79 83 <DF>; # Skip the header 80 84 while (<DF>) { … … 85 89 my $fs=$mounts{$6}; 86 90 my $dir=$6; 87 my $name= $1;88 91 my $name=clean_fieldname($1); 92 89 93 # Create and print labels 90 $name =~ s/\//_/g; 91 print $name . ".label "; 92 if ( length($dir) <= $MAXLABEL ) { 93 print $dir . "\n"; 94 } 95 else { 96 printf ("...%s\n", substr ($dir, length($dir)-$MAXLABEL+4,$MAXLABEL-3)); 97 } 98 94 print $name, ".label ", $dir, "\n"; 95 96 # FIXME: These ought to be tunable 99 97 print "$name.warning 92\n"; 100 98 print "$name.critical 98\n"; … … 102 100 } 103 101 close DF; 102 die "Error executing df. Exit code $?\n" if $?; 104 103 exit 0; 105 104 } people/ilmari/modularisation-branch/node/node.d.linux/df_abs.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Script to monitor absolute disk usage. … … 8 8 # autoconf (optional - used by munin-config) 9 9 # 10 # Environment 11 # exclude: space separated list if fs types to exclude. 12 # iso9660 by default 13 # 10 14 # Magic markers (optional - used by munin-config and installation 11 15 # scripts): 16 # 17 # $Id$ 12 18 # 13 19 #%# family=manual 14 20 #%# capabilities=autoconf 15 21 16 MAXLABEL=20 17 MAXNAME=15 22 . $MUNIN_LIBDIR/plugins/plugin.sh 18 23 19 24 if [ "$1" = "autoconf" ]; then … … 22 27 fi 23 28 24 clean_name() { 25 echo $1 | sed 's/[\/.-]/_/g; s/^_dev\(_mapper\)\?_//'| awk "{ 26 if (length(\$1) > $MAXNAME) 27 print substr(\$1, length(\$1)-$MAXNAME+1) 28 else 29 print \$1 30 }" 31 } 29 exclude=${exclude:-iso9660} 30 31 exclude=$(echo $exclude | sed -e 's/ +/ -x /g' -e 's/^/-x /') 32 32 33 33 if [ "$1" = "config" ]; then … … 38 38 echo 'graph_category disk' 39 39 echo 'graph_total Total' 40 df -P -l -x none -x unknown | sed 1d | grep -v "//" | while read i; do 41 name=`clean_name $i` 42 echo -n "$name.label " 43 echo $i | awk "{ 44 dir=\$6 45 if (length(dir) <= $MAXLABEL) 46 print dir 47 else 48 printf (\"...%s\n\", substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3)) 49 }" 50 echo "$name.cdef $name,1024,*" 51 size=`echo $i | awk '{print $2}'` 52 echo "$name.warning $((size / 100 * 92))" 53 echo "$name.critical $((size / 100 * 98))" 40 df -P -l $exclude | sed 1d | grep -v "//" | 41 while read dev size used avail cap mnt; do 42 name="$(clean_fieldname $dev)" 43 echo "$name.label $mnt" 44 echo "$name.cdef $name,1024,*" 45 echo "$name.warning $((size * 92 / 100))" 46 echo "$name.critical $((size * 98 / 100))" 54 47 done 55 48 exit 0 56 49 fi 57 50 58 df -P -l -x unknown -x none| sed 1d | grep -v "//" | while read i; do 59 name=`clean_name $i` 60 echo -n "$name.value " 61 echo $i | awk '{ print $3 }' 51 df -P -l $exclude | sed 1d | grep -v "//" | 52 while read dev size used avail cap mnt; do 53 echo "$(clean_fieldname $dev).value $used" 62 54 done people/ilmari/modularisation-branch/node/node.d.linux/df_inode.in
r1045 r1265 1 #!/usr/bin/perl 1 #!@@PERL@@ 2 # -*- perl -*- 2 3 # 3 # Plugin to monitor inode-usage. Rewrite based on original shell-based version 4 # 4 # Plugin to monitor inode-usage. Rewrite based on original shell-based 5 # version 6 # 5 7 # Parameters understood: 6 8 # … … 8 10 # autoconf (optional - used by munin-config) 9 11 # 10 # $Log$ 12 # Environment 13 # exclude: space separated list if fs types to exclude. 14 # iso9660 by default 15 # 16 # $Id$ 11 17 # 12 18 # Magic markers (optional - used by munin-config and installation … … 17 23 18 24 use strict; 19 20 my $MAXLABEL=25; 25 use Munin::Plugin; 21 26 22 27 # Read /proc/mounts … … 31 36 close MOUNTS; 32 37 38 my $exclude=$ENV{'exclude'} || 'iso9660'; 39 my $dfopts = "-P -l -i ".join(' -x ',('',split('\s+',$exclude))); 40 33 41 sub print_values() { 34 42 35 43 # Read from df 36 open (DF," /bin/df -P -l -i |") or die "Could not open pipe from /bin/df,$!";44 open (DF,"df $dfopts |") or die "Could not open pipe from df: $!"; 37 45 <DF>; # Skip the header 38 46 while (<DF>) { … … 42 50 if ( /^(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\S+)\s+(\S+)/ ) { 43 51 my $fs=$mounts{$6}; 52 next if $fs eq "reiserfs"; 53 44 54 my $ps=$5; 45 my $name=$1; 46 next if $fs eq "reiserfs"; 47 55 my $name=clean_fieldname($1); 56 48 57 $ps =~ s/\%//; 49 $name =~ s/\//_/g; 58 50 59 print $name . ".value " . $ps . "\n"; 51 60 } 52 61 } 53 62 close DF; 63 die "Error executing df. Exit code $?\n" if $?; 54 64 } 55 65 56 66 if ( $ARGV[0] eq "autoconf" ) { 57 if (` perl$0` eq "" ) {67 if (`@@PERL@@ $0` eq "" ) { 58 68 print "no\n"; 59 69 exit 1; 60 } 61 elsif ( `uname -s` eq "SunOS\n" ) { 62 print "no\n"; 63 exit 1; 64 } 65 else { 70 } else { 66 71 print "yes\n"; 67 72 exit 0; … … 75 80 print "graph_args --upper-limit 100 -l 0\n"; 76 81 print "graph_vlabel %\n"; 77 82 print "graph_scale no\n"; 83 print "graph_category disk\n"; 84 78 85 # Read from df 79 open (DF," /bin/df -P -l -i |") or die "Unable to open pipe from /bin/df";86 open (DF,"df $dfopts |") or die "Unable to open pipe from df: $!"; 80 87 <DF>; # Skip the header 81 88 while (<DF>) { … … 85 92 if ( /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/ ) { 86 93 my $fs=$mounts{$6}; 94 next if $fs eq "reiserfs"; 95 87 96 my $dir=$6; 88 my $name= $1;89 97 my $name=clean_fieldname($1); 98 90 99 # Create and print labels 91 $name =~ s/\//_/g; 92 next if $fs eq "reiserfs"; 93 print $name . ".label "; 94 if ( length($dir) <= $MAXLABEL ) { 95 print $dir . "\n"; 96 } 97 else { 98 printf ("...%s\n", substr ($dir, length($dir)-$MAXLABEL+4,$MAXLABEL-3)); 99 } 100 100 print "$name.label $dir\n"; 101 101 print "$name.warning 92\n"; 102 102 print "$name.critical 98\n"; … … 104 104 } 105 105 close DF; 106 die "Error executing df. Exit code $?\n" if $?; 106 107 exit 0; 107 108 } people/ilmari/modularisation-branch/node/node.d.linux/entropy.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor available entropy … … 11 11 #%# capabilities=autoconf 12 12 13 14 15 13 if [ "$1" = "autoconf" ]; then 16 14 if [ -r /proc/sys/kernel/random/entropy_avail ]; then … … 22 20 fi 23 21 fi 24 25 22 26 23 if [ "$1" = "config" ]; then people/ilmari/modularisation-branch/node/node.d.linux/files_.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the number of open files in the system. … … 14 14 #%# capabilities=autoconf 15 15 16 17 PROC=`basename $0 | sed 's/^files_//g'` 18 TMPFILE="@@PLUGSTATE@@/munin-files_${PROC}.state" 16 PROC=${0##*/files_} 17 TMPFILE="$MUNIN_PLUGSTATE/munin-files_${PROC}.state" 19 18 20 19 if [ "$1" = "autoconf" ]; then … … 23 22 exit 0 24 23 else 25 echo no24 echo "no (no lsof)" 26 25 exit 1 27 26 fi people/ilmari/modularisation-branch/node/node.d.linux/forks.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the number of forks per second on the machine. … … 12 12 #%# family=auto 13 13 #%# capabilities=autoconf 14 15 16 14 17 15 if [ "$1" = "autoconf" ]; then people/ilmari/modularisation-branch/node/node.d.linux/fw_conntrack.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # fw_conntrack: Plugin to monitor the number of tracked connections … … 10 10 # config 11 11 # autoconf 12 # 13 # NOTE: MUST RUN AS ROOT. 14 # @@CONFDIR@@/plugin-conf.d/global or other file in that dir must contain: 15 # [fw*] 16 # user root 12 17 # 13 18 # Bugs: … … 31 36 # 32 37 # Magic markers? 33 #%# family= manual38 #%# family=auto 34 39 #%# capabilities=autoconf 35 40 people/ilmari/modularisation-branch/node/node.d.linux/fw_forwarded_local.in
r1045 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor network connections. … … 13 13 # Magic markers (optional - used by munin-config and some installation 14 14 # scripts): 15 #%# family= manual15 #%# family=auto 16 16 #%# capabilities=autoconf 17 17 # 18 # NOTE: MUST RUN AS ROOT. 19 # @@CONFDIR@@/plugin-conf.d/global or other file in that dir must contain: 20 # [fw*] 21 # user root 18 22 19 23 … … 42 46 echo 'forward.label forward' 43 47 echo 'forward.type GAUGE' 44 echo 'forward.max 500'''45 48 echo 'local.label local' 46 49 echo 'local.type GAUGE' 47 echo 'local.max 500'''48 50 exit 0 49 51 fi people/ilmari/modularisation-branch/node/node.d.linux/fw_packets.in
r1012 r1265 1 1 #!@@PERL@@ -w 2 # -*- perl -*- 2 3 # 3 4 # Plugin to monitor the throuhgput of a firewall. … … 10 11 # autoconf (optional - used by munin-config) 11 12 # 13 # NOTE: MUST RUN AS ROOT. 14 # @@CONFDIR@@/plugin-conf.d/global or other file in that dir must contain: 15 # [fw*] 16 # user root 17 # 12 18 # Config variables: 13 19 # … … 15 21 # scripts): 16 22 # 17 #%# family= manual23 #%# family=auto 18 24 #%# capabilities=autoconf 19 25 people/ilmari/modularisation-branch/node/node.d.linux/if_.in
r1012 r1265 1 #!/bin/sh 2 # 3 # Wildcard-plugin to monitor network interfaces. To monitor an 4 # interface, link if_<interface> to this file. E.g. 5 # 1 #!/bin/bash 2 3 # Wildcard-plugin to monitor traffic and errors on network 4 # interfaces. To monitor an interface, link if_<interface> to this 5 # file. E.g. 6 6 7 # ln -s /usr/share/node/node/plugins-auto/if_ /etc/munin/node.d/if_eth0 7 # 8 8 9 # ...will monitor eth0. 9 # 10 10 11 # Any device found in /proc/net/dev can be monitored. Examples include 11 12 # ipsec*, eth*, irda* and lo. Please note that aliases cannot be 12 13 # monitored with this plugin. 13 # 14 14 15 # Magic markers (optional - used by munin-config and some installation 15 16 # scripts): 16 # 17 17 18 #%# family=auto 18 19 #%# capabilities=autoconf suggest 19 20 21 INTERFACE=${0##*if_} 20 22 21 INTERFACE=`basename $0 | sed 's/^if_//g'` 23 findspeed () { 22 24 23 if [ "$1" = "autoconf" ]; then 25 # Who whould have thought it's so much work to determine the 26 # maximum speed of a network interface. Buckle up! 27 28 IWLIST="$(type -p iwlist)" 29 30 WIRELESS=0 31 # Do not use interface name to guess technology. Many many 32 # wifi drivers use "eth*" names. 33 case $IWLIST in 34 35 '') 36 # Used to use iwconfig to look for "no wireless 37 # extentions" message - but this seemed un-needed. If we 38 # don't have iwlist we can't find out if # the interface 39 # is wireless 40 :;; 41 *) IWO="$($IWLIST $INTERFACE rate 2>&1)" 42 case $IWO in 43 *no*) :;; 44 *) WIRELESS=1;; 45 esac 46 ;; 47 esac 48 49 SPEED=U 50 # Find speed in Mbps. - or not 51 case $WIRELESS:$IWLIST in 52 0:*) 53 ETHTOOL="$(type -p ethtool)" 54 if [ -x "$ETHTOOL" ]; then 55 SPEED="$($ETHTOOL $INTERFACE | 56 awk '/Speed:/ { gsub(/[^0-9]*/,"",$2); print $2; }')" 57 case $SPEED in 58 [0-9]*) :;; # OK 59 *) SPEED=U;; # Could be "unknown" 60 esac 61 else 62 INSTALL="ethtool" 63 fi 64 ;; 65 1:/*) 66 # Current bit rate is not very interesting, it varies too often 67 SPEED=$(echo "$IWO" | 68 awk 'BEGIN { RATE=U } 69 { if ($2 == "Mb/s") RATE=$1; } 70 END { print RATE; }') 71 72 ;; 73 *) 74 # Wireless interface, cannot find iwlist 75 INSTALL="wireless-tools" 76 ;; 77 esac 78 79 MIITOOL="$(type -p mii-tool)" 80 case $SPEED:$MIITOOL in 81 U:/*) 82 SPEED="$($MIITOOL $INTERFACE 2>&1)" 83 case $SPEED in 84 *1000base*) SPEED=1000;; # as if... 85 *100base*) SPEED=100;; 86 *10base*) SPEED=10;; 87 *) SPEED=U;; 88 esac 89 ;; 90 esac 91 92 case $SPEED in 93 U) echo "up.info Traffic of the $INTERFACE interface. Unable to determine interface speed. Please install ethtool, wireless-tools (or mii-tool), whatever is apropriate for the interface." 94 return;; 95 esac 96 97 BPS=$(( $SPEED * 1000 * 1000 )) 98 99 cat <<EOF 100 up.max $BPS 101 up.info Traffic of the $INTERFACE interface. Maximum speed is $SPEED Mbps. 102 down.max $BPS 103 EOF 104 105 return 106 } 107 108 109 case $1 in 110 autoconf) 24 111 if [ -r /proc/net/dev ]; then 25 echo yes26 exit 0112 echo yes 113 exit 0 27 114 else 28 echo "no (/proc/net/dev not found)"29 exit 1115 echo "no (/proc/net/dev not found)" 116 exit 1 30 117 fi 31 fi 118 ;; 119 suggest) 120 if [ -r /proc/net/dev ]; then 121 awk ' 122 /^ *(eth|tap|bond|wlan|ath|ra|sw)[0-9]+:/ { 123 split($0, a, /: */); 124 gsub(/^ +/,"",a[1]); 125 if (($2 > 0) || ($10 > 0)) print a[1]; }' /proc/net/dev 32 126 33 if [ "$1" = "suggest" ]; then 34 if [ -r /proc/net/dev ]; then 35 egrep '^ *(eth|wlan|ath|ra)[0-9]+:' /proc/net/dev | cut -f1 -d: | sed 's/ //g' 36 exit 0 37 else 38 exit 1 127 # egrep '^ *(eth|tap|bond|wlan|ath|ra|sw)[0-9]+:' /proc/net/dev | cut -f1 -d: | sed 's/ //g' 39 128 fi 40 fi 41 42 if [ "$1" = "config" ]; then 43 129 exit 0 130 ;; 131 config) 132 44 133 echo "graph_order down up" 45 134 echo "graph_title $INTERFACE traffic" … … 56 145 echo 'up.negative down' 57 146 echo 'up.cdef up,8,*' 58 case "$INTERFACE" in 59 ath*|wlan*|ra*) 60 echo -n "up.info Traffic of the $INTERFACE interface. Maximum speed is " 61 which iwlist >/dev/null 2>/dev/null || echo "undeterminable (please install iwlist)." 62 iwlist $INTERFACE rate 2>/dev/null | awk '/Current Bit Rate/ { split ($0, arr, "[=:]"); split (arr[2], arr2, "M"); print (arr2[1]*1000000) " bits per second.\nup.max " (arr2[1]*1000000) "\ndown.max "(arr2[1]*1000000); }' 63 ;; 64 *) 65 echo -n "up.info Traffic of the $INTERFACE interface. Maximum speed is " 66 which ethtool >/dev/null 2>/dev/null || echo "undeterminable (please install ethtool)." 67 ethtool $INTERFACE 2>/dev/null | awk '/Speed/ { split ($2, arr2, "M"); print (arr2[1]*1000000) " bits per second.\nup.max " (arr2[1]*1000000) "\ndown.max "(arr2[1]*1000000); }' 68 ;; 69 esac 147 148 findspeed 149 70 150 exit 0 71 fi; 151 ;; 152 esac 72 153 73 awk -F '[: \t]+' -v interface="$INTERFACE" \ 74 '$1 == interface { print "down.value " $2 "\nup.value " $10; exit } 75 $2 == interface { print "down.value " $3 "\nup.value " $11; exit }' \ 154 # Escape dots in the interface name (eg. vlans) before using it as a regex 155 awk -v interface="$INTERFACE" \ 156 'BEGIN { gsub(/\./, "\\.", interface) } \ 157 $1 ~ "^" interface ":" { 158 split($0, a, /: */); $0 = a[2]; \ 159 print "down.value " $1 "\nup.value " $9 \ 160 }' \ 76 161 /proc/net/dev 77 162 people/ilmari/modularisation-branch/node/node.d.linux/if_err_.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Wildcard-plugin to monitor network interfaces. To monitor an … … 18 18 #%# capabilities=autoconf suggest 19 19 20 INTERFACE= `basename $0 | sed 's/^if_err_//g'`20 INTERFACE=${0##*/if_err_} 21 21 22 22 if [ "$1" = "autoconf" ]; then … … 31 31 32 32 if [ "$1" = "suggest" ]; then 33 if [ -r /proc/net/dev ]; then 34 egrep '^ *(eth|wlan|ath|ra)[0-9]+:' /proc/net/dev | cut -f1 -d: | sed 's/ //g' 35 exit 0 36 else 37 exit 1 38 fi 33 if [ -r /proc/net/dev ]; then 34 awk ' 35 /^ *(eth|tap|bond|wlan|ath|ra|sw)[0-9]+:/ { 36 split($0, a, /: */); 37 gsub(/^ +/,"",a[1]); 38 if (($2 > 0) || ($10 > 0)) print a[1]; }' /proc/net/dev 39 fi 40 exit 0 39 41 fi 40 42 people/ilmari/modularisation-branch/node/node.d.linux/interrupts.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the number of interrupts and context switches on a system. people/ilmari/modularisation-branch/node/node.d.linux/ip_.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Wildcard-plugin to monitor IP addresses through iptables. To monitor an … … 24 24 25 25 26 IP= `basename $0 | sed 's/^ip_//g'`26 IP=${0##*/ip_} 27 27 28 28 if [ "$1" = "autoconf" ]; then people/ilmari/modularisation-branch/node/node.d.linux/irqstats.in
r1012 r1265 1 1 #!@@PERL@@ -w 2 # -*- cperl -*- 2 3 # 3 4 # Plugin to monitor individual interrupts … … 16 17 } 17 18 } 18 open my $in, '<', '/proc/interrupts'19 or die "Can't open /proc/interrupts: $!\n";20 19 21 my @cpus = split(' ', <$in>); 22 my $cpus = scalar @cpus; 20 my $sun; 21 $sun = 1 if (`uname -m` =~ /sparc/); 22 23 my $in; 24 my @cpus; 25 my $cpus; 26 27 if ($sun) { 28 @cpus = grep (/^cpu\d+/, `cat /proc/stat`); 29 $cpus = scalar @cpus; 30 } else { 31 open $in, '<', '/proc/interrupts' 32 or die "Can't open /proc/interrupts: $!\n"; 33 @cpus = split(' ', <$in>); 34 $cpus = scalar @cpus; 35 } 36 23 37 my $cpu; 24 38 … … 40 54 while (my $line = <$in>) { 41 55 my ($irq, $label, $type); 42 my @data = split(' ', $line, $cpus + 3); 56 my @data; 57 if ($sun) { 58 @data = split (' ', $line, $cpus + 2); 59 } else { 60 @data = split(' ', $line, $cpus + 3); 61 } 43 62 chomp @data; 44 63 $irq = shift @data; people/ilmari/modularisation-branch/node/node.d.linux/load.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the load average on a system. 4 4 # 5 5 # Usage: Link or copy into /etc/munin/node.d/ 6 # 7 # Parameters 8 # env.load_warn <warning load> 9 # env.load_crit <critical load> 6 10 # 7 11 # Magic markers (optional - only used by munin-config and some … … 10 14 #%# family=auto 11 15 #%# capabilities=autoconf 12 13 14 16 15 17 # If run with the "autoconf"-parameter, give our opinion on wether we … … 27 29 28 30 if [ "$1" = "config" ]; then 31 LOAD_WARN=${load_warn:-10} 32 LOAD_CRIT=${load_crit:-120} 33 29 34 # The host name this plugin is for. (Can be overridden to have 30 35 # one machine answer for several) … … 48 53 # configured your munin to tell a Nagios-server about any 49 54 # problems 50 echo 'load.warning 10'51 echo 'load.critical 120'55 echo 'load.warning $LOAD_WARN' 56 echo 'load.critical $LOAD_CRIT' 52 57 # This one is purely to add an explanation to the web page. The first 53 58 # one is for the graph itself, while the second one is for the field … … 67 72 echo -n "load.value " 68 73 cut -f2 -d' ' < /proc/loadavg 69 70 # How could this plugin have been written in its simplest form?71 # Something like this:72 #73 # ---------------------74 # #!/bin/sh75 76 #77 # if [ "$1" = "config" ]; then78 79 # echo "graph_title Load average"80 # echo 'graph_args --base 1000 -l 0'81 # echo 'graph_vlabel load'82 # echo "load.label load"83 # exit 084 # fi85 # echo -n "load.value "86 # cut -f1 -d' ' < /proc/loadavg87 # ---------------------88 #89 # Except for the Nagios-warnings (which most people don't have any need90 # for) and things used by installation scripts and munin-config (which91 # you don't need if you don't plan on submitting your plugin to the92 # pacakge), and the scaling (no milliload numbers) the two versions will93 # work identically.people/ilmari/modularisation-branch/node/node.d.linux/memory.in
r1012 r1265 1 1 #!@@PERL@@ -w 2 # -*- perl -*- 2 3 # 3 4 # Plugin to monitor memory usage. … … 5 6 # Origional Author: Jimmy Olsen 6 7 # Contributors: 7 # Mike Fedyk: Slab, SwapCached, PageTables, VmallocUsed, Mapped, Active, Inactive, 2.4 Rmap & 2.6 8 # Mike Fedyk: Slab, SwapCached, PageTables, VmallocUsed, Mapped, 9 # Active, Inactive, 2.4 Rmap & 2.6 10 # Juha-Matti Tapio: Input on swap_cache and VMalloc Used on 64 bit 11 # machines. 12 # Nicolai Langfeldt: Editor. 8 13 # 9 14 # Parameters: … … 12 17 # autoconf (optional - only used by munin-config) 13 18 # 14 # Magic markers (optional - onlyused by munin-config and some19 # Magic markers (optional - used by munin-config and some 15 20 # installation scripts): 21 # 22 # $Id$ 23 # 16 24 #%# family=auto 17 25 #%# capabilities=autoconf 18 26 19 20 if ($ARGV[0] and $ARGV[0] eq "autoconf") 21 { 22 if (-r "/proc/meminfo") 23 { 24 print "yes\n"; 25 exit 0; 26 } 27 else 28 { 29 print "/proc/meminfo not found\n"; 30 exit 1; 31 } 27 if ($ARGV[0] and $ARGV[0] eq "autoconf") { 28 if (-r "/proc/meminfo") { 29 print "yes\n"; 30 exit 0; 31 } else { 32 print "no (/proc/meminfo not found)\n"; 33 exit 1; 34 } 32 35 } 33 36 … … 35 38 &fetch_meminfo; 36 39 37 if ($ARGV[0] and $ARGV[0] eq "config") 38 { 39 print "graph_args --base 1024 -l 0 --vertical-label Bytes --upper-limit ", $mems{'MemTotal'}, "\n"; 40 print "graph_title Memory usage\n"; 41 print "graph_category system\n"; 42 print "graph_info This graph shows what the machine uses its memory for.\n"; 43 print "graph_order ", 44 "apps "; 45 if (exists $mems{'PageTables'}) 46 { 47 print "page_tables "; 48 } 49 if (exists $mems{'SwapCached'}) 50 { 51 print "swap_cache "; 52 } 53 if (exists $mems{'VmallocUsed'}) 54 { 55 print "vmalloc_used "; 56 } 57 if (exists $mems{'Slab'}) 58 { 59 print "slab "; 60 } 61 print "cached ", 62 "buffers ", 63 "free ", 64 "swap ", 65 "\n"; 66 print "apps.label apps\n"; 67 print "apps.draw AREA\n"; 68 print "apps.info Memory used by user-space applications.\n"; 69 print "buffers.label buffers\n"; 70 print "buffers.draw STACK\n"; 71 print "buffers.info Block device (e.g. harddisk) cache. Also where \"dirty\" blocks are stored until written.\n"; 72 print "swap.label swap\n"; 73 print "swap.draw STACK\n"; 74 print "swap.info Swap space used.\n"; 75 print "cached.label cache\n"; 76 print "cached.draw STACK\n"; 77 print "cached.info Parked file data (file content) cache.\n"; 78 print "free.label unused\n"; 79 print "free.draw STACK\n"; 80 print "free.info Wasted memory. Memory that is not used for anything at all.\n"; 81 if (exists $mems{'Slab'}) 82 { 83 print "slab.label slab_cache\n"; 84 print "slab.draw STACK\n"; 85 print "slab.info Memory used by the kernel (major users are caches like inode, dentry, etc).\n"; 86 } 87 if (exists $mems{'SwapCached'}) 88 { 89 print "swap_cache.label swap_cache\n"; 90 print "swap_cache.draw STACK\n"; 91 print "swap_cache.info A piece of memory that keeps track of pages that have been fetched from swap but not yet been modified.\n"; 92 } 93 if (exists $mems{'PageTables'}) 94 { 95 print "page_tables.label page_tables\n"; 96 print "page_tables.draw STACK\n"; 97 print "page_tables.info Memory used to map between virtual and physical memory addresses.\n" 98 } 99 if (exists $mems{'VmallocUsed'}) 100 { 101 print "vmalloc_used.label vmalloc_used\n"; 102 print "vmalloc_used.draw STACK\n"; 103 print "vmalloc_used.info Virtual memory used by the kernel (used when the memory does not have to be physically contigious).\n"; 104 } 105 if (exists $mems{'Committed_AS'}) 106 { 107 print "committed.label committed\n"; 108 print "committed.draw LINE2\n"; 109 print "committed.warn ", $mems{'SwapTotal'} + $mems{'MemTotal'}, "\n"; 110 print "committed.info The amount of memory that would be used if all the memory that's been allocated were to be used.\n"; 111 } 112 if (exists $mems{'Mapped'}) 113 { 114 print "mapped.label mapped\n"; 115 print "mapped.draw LINE2\n"; 116 print "mapped.info All mmap()ed pages.\n"; 117 } 118 if (exists $mems{'Active'}) 119 { 120 print "active.label active\n"; 121 print "active.draw LINE2\n"; 122 print "active.info Memory recently used. Not reclaimed unless absolutely necessary.\n"; 123 } 124 if (exists $mems{'ActiveAnon'}) 125 { 126 print "active_anon.label active_anon\n"; 127 print "active_anon.draw LINE1\n"; 128 } 129 if (exists $mems{'ActiveCache'}) 130 { 131 print "active_cache.label active_cache\n"; 132 print "active_cache.draw LINE1\n"; 133 } 134 if (exists $mems{'Inactive'}) 135 { 136 print "inactive.label inactive\n"; 137 print "inactive.draw LINE2\n"; 138 print "inactive.info Memory not currently used.\n"; 139 } 140 if (exists $mems{'Inact_dirty'}) 141 { 142 print "inact_dirty.label inactive_dirty\n"; 143 print "inact_dirty.draw LINE1\n"; 144 print "inact_dirty.info Memory not currently used, but in need of being written to disk.\n"; 145 } 146 if (exists $mems{'Inact_laundry'}) 147 { 148 print "inact_laundry.label inactive_laundry\n"; 149 print "inact_laundry.draw LINE1\n"; 150 } 151 if (exists $mems{'Inact_clean'}) 152 { 153 print "inact_clean.label inactive_clean\n"; 154 print "inact_clean.draw LINE1\n"; 155 print "inact_clean.info Memory not currently used.\n"; 156 } 157 exit 0; 40 if ($ARGV[0] and $ARGV[0] eq "config") { 41 print "graph_args --base 1024 -l 0 --upper-limit ",$mems{'MemTotal'},"\n"; 42 print "graph_vlabel Bytes\n"; 43 print "graph_title Memory usage\n"; 44 print "graph_category system\n"; 45 print "graph_info This graph shows what the machine uses memory for.\n"; 46 print "graph_order ", 47 "apps "; 48 print "page_tables " if exists $mems{'PageTables'}; 49 50 print "swap_cache " if exists $mems{'SwapCached'}; 51 52 #print "vmalloc_used " if exists $mems{'VmallocUsed'}; 53 54 print "slab " if exists $mems{'Slab'}; 55 56 print "cached ", 57 "buffers ", 58 "free ", 59 "swap ", 60 "\n"; 61 62 print "apps.label apps\n"; 63 print "apps.draw AREA\n"; 64 print "apps.info Memory used by user-space applications.\n"; 65 print "buffers.label buffers\n"; 66 print "buffers.draw STACK\n"; 67 print "buffers.info Block device (e.g. harddisk) cache. ", 68 "Also where \"dirty\" blocks are stored until written.\n"; 69 print "swap.label swap\n"; 70 print "swap.draw STACK\n"; 71 print "swap.info Swap space used.\n"; 72 print "cached.label cache\n"; 73 print "cached.draw STACK\n"; 74 print "cached.info Parked file data (file content) cache.\n"; 75 print "free.label unused\n"; 76 print "free.draw STACK\n"; 77 print "free.info Wasted memory. Memory that is not ", 78 "used for anything at all.\n"; 79 if (exists $mems{'Slab'}) { 80 print "slab.label slab_cache\n"; 81 print "slab.draw STACK\n"; 82 print "slab.info Memory used by the kernel (major users ", 83 " are caches like inode, dentry, etc).\n"; 84 } 85 if (exists $mems{'SwapCached'}) { 86 print "swap_cache.label swap_cache\n"; 87 print "swap_cache.draw STACK\n"; 88 print "swap_cache.info A piece of memory that keeps track of pages ", 89 "that have been fetched from swap but not yet been modified.\n"; 90 } 91 if (exists $mems{'PageTables'}) { 92 print "page_tables.label page_tables\n"; 93 print "page_tables.draw STACK\n"; 94 print "page_tables.info Memory used to map between virtual and ", 95 "physical memory addresses.\n" 96 } 97 if (exists $mems{'VmallocUsed'}) { 98 print "vmalloc_used.label vmalloc_used\n"; 99 # print "vmalloc_used.draw STACK\n"; 100 print "vmalloc_used.draw LINE2\n"; 101 print "vmalloc_used.info 'VMalloc' (kernel) memory used\n" 102 } 103 if (exists $mems{'Committed_AS'}) { 104 print "committed.label committed\n"; 105 print "committed.draw LINE2\n"; 106 107 # Linux machines frequently overcommit - this is not a error 108 # condition or even worrying. But sometimes overcommit shows 109 # memory leaks so we want to graph it. 110 111 # print "committed.warning ", $mems{'SwapTotal'} + $mems{'MemTotal'}, "\n"; 112 print "committed.info The amount of memory allocated to programs. ", 113 "Overcommitting is normal, but may indicate memory leaks.\n"; 114 } 115 if (exists $mems{'Mapped'}) { 116 print "mapped.label mapped\n"; 117 print "mapped.draw LINE2\n"; 118 print "mapped.info All mmap()ed pages.\n"; 119 } 120 if (exists $mems{'Active'}) { 121 print "active.label active\n"; 122 print "active.draw LINE2\n"; 123 print "active.info Memory recently used. Not reclaimed unless ", 124 "absolutely necessary.\n"; 125 } 126 if (exists $mems{'ActiveAnon'}) { 127 print "active_anon.label active_anon\n"; 128 print "active_anon.draw LINE1\n"; 129 } 130 if (exists $mems{'ActiveCache'}) { 131 print "active_cache.label active_cache\n"; 132 print "active_cache.draw LINE1\n"; 133 } 134 if (exists $mems{'Inactive'}) { 135 print "inactive.label inactive\n"; 136 print "inactive.draw LINE2\n"; 137 print "inactive.info Memory not currently used.\n"; 138 } 139 if (exists $mems{'Inact_dirty'}) { 140 print "inact_dirty.label inactive_dirty\n"; 141 print "inact_dirty.draw LINE1\n"; 142 print "inact_dirty.info Memory not currently used, but in need of ", 143 "being written to disk.\n"; 144 } 145 if (exists $mems{'Inact_laundry'}) { 146 print "inact_laundry.label inactive_laundry\n"; 147 print "inact_laundry.draw LINE1\n"; 148 } 149 if (exists $mems{'Inact_clean'}) { 150 print "inact_clean.label inactive_clean\n"; 151 print "inact_clean.draw LINE1\n"; 152 print "inact_clean.info Memory not currently used.\n"; 153 } 154 exit 0; 158 155 } 159 156 … … 161 158 # and is has not been set by &fetch_meminfo 162 159 163 if (exists $mems{'Slab'}) 164 { 165 print "slab.value ", $mems{'Slab'}, "\n"; 166 } 167 else 168 { 169 $mems{'Slab'} = 0; 170 } 171 if (exists $mems{'SwapCached'}) 172 { 173 print "swap_cache.value ", $mems{'SwapCached'}, "\n"; 174 } 175 else 176 { 177 $mems{'SwapCached'} = 0; 178 } 179 if (exists $mems{'PageTables'}) 180 { 181 print "page_tables.value ", $mems{'PageTables'}, "\n"; 182 } 183 else 184 { 185 $mems{'PageTables'} = 0; 186 } 187 if (exists $mems{'VmallocUsed'}) 188 { 189 print "vmalloc_used.value ", $mems{'VmallocUsed'}, "\n"; 190 } 191 else 192 { 193 $mems{'VmallocUsed'} = 0; 160 if (exists $mems{'Slab'}) { 161 print "slab.value ", $mems{'Slab'}, "\n"; 162 } else { 163 $mems{'Slab'} = 0; 164 } 165 166 if (exists $mems{'SwapCached'}) { 167 print "swap_cache.value ", $mems{'SwapCached'}, "\n"; 168 } else { 169 $mems{'SwapCached'} = 0; 170 } 171 172 if (exists $mems{'PageTables'}) { 173 print "page_tables.value ", $mems{'PageTables'}, "\n"; 174 } else { 175 $mems{'PageTables'} = 0; 176 } 177 178 if (exists $mems{'VmallocUsed'}) { 179 print "vmalloc_used.value ", $mems{'VmallocUsed'}, "\n"; 180 } else { 181 $mems{'VmallocUsed'} = 0; 194 182 } 195 183 … … 198 186 -$mems{'Buffers'} 199 187 -$mems{'Cached'} 200 -$mems{'SwapCached'}201 188 -$mems{'Slab'} 202 189 -$mems{'PageTables'} 203 -$mems{'VmallocUsed'}190 -$mems{'SwapCached'} 204 191 ,"\n"; 192 205 193 print "free.value ", $mems{'MemFree'}, "\n"; 206 194 print "buffers.value ", $mems{'Buffers'}, "\n"; … … 208 196 print "swap.value ", $mems{'SwapTotal'} - $mems{'SwapFree'}, "\n"; 209 197 210 if (exists $mems{'Committed_AS'}) 211 { 212 print "committed.value ", $mems{'Committed_AS'}, "\n"; 213 } 214 if (exists $mems{'Mapped'}) 215 { 216 print "mapped.value ", $mems{'Mapped'}, "\n"; 217 } 218 if (exists $mems{'Active'}) 219 { 220 print "active.value ", $mems{'Active'}, "\n"; 221 } 222 if (exists $mems{'ActiveAnon'}) 223 { 224 print "active_anon.value ", $mems{'ActiveAnon'}, "\n"; 225 } 226 if (exists $mems{'ActiveCache'}) 227 { 228 print "active_cache.value ", $mems{'ActiveCache'}, "\n"; 229 } 230 if (exists $mems{'Inactive'}) 231 { 232 print "inactive.value ", $mems{'Inactive'}, "\n"; 233 } 234 if (exists $mems{'Inact_dirty'}) 235 { 236 print "inact_dirty.value ", $mems{'Inact_dirty'}, "\n"; 237 } 238 if (exists $mems{'Inact_laundry'}) 239 { 240 print "inact_laundry.value ", $mems{'Inact_laundry'}, "\n"; 241 } 242 if (exists $mems{'Inact_clean'}) 243 { 244 print "inact_clean.value ", $mems{'Inact_clean'}, "\n"; 245 } 246 247 sub fetch_meminfo 248 { 249 open (IN, "/proc/meminfo") || die "Could not open /proc/meminfo for reading: $!"; 250 while (<IN>) 251 { 252 if (/^(\w+):\s*(\d+)\s+kb/i) 253 { 254 $mems{"$1"} = $2 * 1024; 255 } 198 print "committed.value ", $mems{'Committed_AS'}, "\n" 199 if exists $mems{'Committed_AS'}; 200 201 print "mapped.value ", $mems{'Mapped'}, "\n" 202 if exists $mems{'Mapped'}; 203 204 print "active.value ", $mems{'Active'}, "\n" 205 if exists $mems{'Active'}; 206 207 print "active_anon.value ", $mems{'ActiveAnon'}, "\n" 208 if exists $mems{'ActiveAnon'}; 209 210 print "active_cache.value ", $mems{'ActiveCache'}, "\n" 211 if exists $mems{'ActiveCache'}; 212 213 print "inactive.value ", $mems{'Inactive'}, "\n" 214 if exists $mems{'Inactive'}; 215 216 print "inact_dirty.value ", $mems{'Inact_dirty'}, "\n" 217 if exists $mems{'Inact_dirty'}; 218 219 print "inact_laundry.value ", $mems{'Inact_laundry'}, "\n" 220 if exists $mems{'Inact_laundry'}; 221 222 print "inact_clean.value ", $mems{'Inact_clean'}, "\n" 223 if exists $mems{'Inact_clean'}; 224 225 exit 0; 226 227 sub fetch_meminfo { 228 open (IN, "/proc/meminfo") || 229 die "Could not open /proc/meminfo for reading: $!"; 230 while (<IN>) { 231 if (/^(\w+):\s*(\d+)\s+kb/i) { 232 $mems{"$1"} = $2 * 1024; 256 233 } 257 close (IN); 258 # Only 2.6 and above has slab reported in meminfo, so read slabinfo if it isn't in meminfo 259 if (!$mems{Slab}) 260 { 261 &fetch_slabinfo; 234 } 235 close (IN); 236 237 # Only 2.6 and above has slab reported in meminfo, so read 238 # slabinfo if it isn't in meminfo 239 if (!$mems{Slab}) { 240 &fetch_slabinfo; 241 } 242 # Support 2.4 Rmap VM based kernels 243 if (!$mems{'Inactive'} && $mems{'Inact_dirty'} && 244 $mems{'Inact_laundry'} && $mems{'Inact_clean'}) { 245 $mems{'Inactive'} = $mems{'Inact_dirty'} + 246 $mems{'Inact_laundry'} + $mems{'Inact_clean'}; 247 } 248 } 249 250 sub fetch_slabinfo { 251 # In 2.0 there is no slabinfo file, so return if the file doesn't open 252 open (IN, "/proc/slabinfo") || return; 253 my @slabinfo; 254 my $tot_slab_pages = 0; 255 my $slab_version = <IN>; 256 if ($slab_version =~ /^slabinfo - version: 1.1/) { 257 while (<IN>) { 258 if (!/^slabinfo/) { 259 @slabinfo = split; 260 $tot_slab_pages += $slabinfo[5]; 261 } 262 262 } 263 # Support 2.4 Rmap VM based kernels 264 if (!$mems{'Inactive'} && $mems{'Inact_dirty'} && $mems{'Inact_laundry'} && $mems{'Inact_clean'}) 265 { 266 $mems{'Inactive'} = $mems{'Inact_dirty'} + $mems{'Inact_laundry'} + $mems{'Inact_clean'} 267 } 268 } 269 270 sub fetch_slabinfo 271 { 272 # In 2.0 there is no slabinfo file, so return if the file doesn't open 273 open (IN, "/proc/slabinfo") || return; 274 my @slabinfo; 275 my $tot_slab_pages = 0; 276 my $slab_version = <IN>; 277 if ($slab_version =~ /^slabinfo - version: 1.1/) 278 { 279 while (<IN>) 280 { 281 if (!/^slabinfo/) 282 { 283 @slabinfo = split; 284 $tot_slab_pages += $slabinfo[5]; 285 } 286 } 287 } 288 close (IN); 289 if ($tot_slab_pages gt 0) 290 { 291 $mems{'Slab'} = $tot_slab_pages * 4096; 292 } 263 } 264 close (IN); 265 266 $mems{'Slab'} = $tot_slab_pages * 4096 if $tot_slab_pages gt 0; 293 267 } 294 268 people/ilmari/modularisation-branch/node/node.d.linux/netstat.in
r1012 r1265 1 #!/bin/sh 1 #!@@GOODSH@@ 2 # -*- sh -*- 2 3 # 3 4 # Plugin to monitor network connections. people/ilmari/modularisation-branch/node/node.d.linux/nfs4_client.in
r1045 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor NFSv4 client traffic people/ilmari/modularisation-branch/node/node.d.linux/nfs_client.in
r1045 r1265 1 #!/bin/sh 1 #!@@GOODSH@@ 2 # -*- sh -*- 2 3 # 3 4 # Plugin to monitor NFS client traffic people/ilmari/modularisation-branch/node/node.d.linux/nfsd.in
r1045 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin created by Alexandre Dupouy, with the assistance of Mike Fedyk 4 4 # 5 # $Log$ 6 # Revision 1.9.2.1 2005/03/16 13:45:45 ilmari 7 # Fix autoconf for linux/{nfsd,nfs_client}. 8 # 9 # Revision 1.9 2004/12/10 10:47:49 jimmyo 10 # Change name from ${scale} to ${graph_period}, to be more consistent. 11 # 12 # Revision 1.8 2004/12/09 22:12:56 jimmyo 13 # Added "graph_period" option, to make "graph_sums" usable. 14 # 15 # Revision 1.7 2004/11/21 00:17:12 jimmyo 16 # Changed a lot of plugins so they use DERIVE instead of COUNTER. 17 # 18 # Revision 1.6 2004/10/01 12:32:09 ilmari 19 # complete "rpc" removal 20 # 21 # Revision 1.5 2004/10/01 08:40:50 ilmari 22 # Remove useless 'rpc' field, add total field 23 # 24 # Revision 1.4 2004/05/20 19:02:37 jimmyo 25 # Set categories on a bunch of plugins 26 # 27 # Revision 1.3 2004/05/15 21:33:29 jimmyo 28 # "Upped" som plugins from contrib/manual to manual or auto. 29 # 30 # Revision 1.2 2004/05/06 21:55:18 jimmyo 31 # Added patch to contrib-plugin linux/nfsd, to graph rpc count (Alexandre Dupouy). 32 # 33 # Revision 1.1 2004/02/18 18:41:54 jimmyo 34 # Plugin created by Alexandre Dupouy, with the assistance of Mike Fedyk 35 # 5 # $Id$ 36 6 # 37 7 #%# family=auto people/ilmari/modularisation-branch/node/node.d.linux/open_files.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the number of open files in the system. … … 13 13 #%# family=auto 14 14 #%# capabilities=autoconf 15 16 17 15 18 16 if [ "$1" = "autoconf" ]; then people/ilmari/modularisation-branch/node/node.d.linux/open_inodes.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the number of open files in the system. … … 13 13 #%# family=auto 14 14 #%# capabilities=autoconf 15 16 17 15 18 16 if [ "$1" = "autoconf" ]; then people/ilmari/modularisation-branch/node/node.d.linux/port_.in
r1012 r1265 31 31 my ($fd, $file) = @_; 32 32 33 my $cache_dir = " /var/run/munin/plugin-state";33 my $cache_dir = "@@PLUGSTATE@@"; 34 34 my $cache = $file; 35 35 $cache =~ s:/:_:g; people/ilmari/modularisation-branch/node/node.d.linux/processes.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the number of processes on the machine. Much linke … … 13 13 #%# family=auto 14 14 #%# capabilities=autoconf 15 16 17 15 18 16 if [ "$1" = "autoconf" ]; then people/ilmari/modularisation-branch/node/node.d.linux/swap.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor swap IO in number of blocks per second. people/ilmari/modularisation-branch/node/node.d.linux/uptime.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to measure uptime. Especially the average and max values on the … … 27 27 fi 28 28 29 env LC_ALL=Cawk '{printf "uptime.value %.2f\n",$1/86400}' /proc/uptime29 awk '{printf "uptime.value %.2f\n",$1/86400}' /proc/uptime people/ilmari/modularisation-branch/node/node.d.linux/vlan_.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Wildcard-script to monitor network interfaces. To monitor an … … 17 17 #%# capabilities=autoconf suggest 18 18 19 INTERFACE= `basename $0 | sed 's/^vlan_//g' | tr '_' '.'`19 INTERFACE=$(basename $0 | sed 's/^vlan_//g' | tr '_' '.') 20 20 21 21 if [ "$1" = "autoconf" ]; then 22 if [ -d /proc/net/vlan -a -r /proc/net/vlan -a -x /proc/net/vlan ] 23 then 24 echo yes 25 exit 0 26 else 27 echo no 28 exit 1 29 fi 22 if [ ! -d /proc/net/vlan ] ; then 23 echo "no (no vlan support)" 24 exit 1 25 fi 26 if [ ! -d -r /proc/net/vlan ] ; then 27 echo "no (cannot not read /proc/net/vlan)" 28 exit 1 29 fi 30 if [ ! -x /proc/net/vlan ] ; then 31 echo "no (cannot cd to /proc/net/vlan)" 32 exit 1 33 fi 34 35 echo yes 36 exit 0 30 37 fi 31 38 32 39 if [ "$1" = "suggest" ]; then 33 if [ -d /proc/net/vlan -a -r /proc/net/vlan -a -x /proc/net/vlan ] 34 then 35 for file in /proc/net/vlan/* 36 do 37 if [ ! "$file" = "/proc/net/vlan/config" ] 38 then 39 basename $file | tr '.' '_' 40 fi 41 done 40 for file in /proc/net/vlan/*; do 41 if [ ! "$file" = "/proc/net/vlan/config" ]; then 42 basename $file | tr '.' '_' 42 43 fi 43 exit 0 44 done 45 exit 0 44 46 fi 45 47 … … 63 65 echo 'transmitted.draw AREA' 64 66 exit 0 65 fi ;67 fi 66 68 67 69 awk "/bytes received/ { print \"received.value \" \$4 } /bytes transmitted/ { print \"transmitted.value \" \$4 }" < /proc/net/vlan/$INTERFACE people/ilmari/modularisation-branch/node/node.d.sunos/if_.in
r1012 r1265 1 #!/bin/sh 1 #!@@GOODSH@@ 2 # -*- sh -*- 2 3 # 3 4 # Wildcard-plugin to monitor network interfaces. To monitor an … … 16 17 #%# capabilities=autoconf suggest 17 18 18 19 INTERFACE=`basename $0 | sed 's/^if_//g'` 19 INTERFACE=${0##*/if_} 20 20 21 21 if [ "$1" = "autoconf" ]; then people/ilmari/modularisation-branch/node/node.d.sunos/if_errcoll_.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Wildcard-plugin to monitor network interfaces. To monitor an … … 16 16 #%# capabilities=autoconf suggest 17 17 18 19 INTERFACE=`basename $0 | sed 's/^if_errcoll_//g'` 18 INTERFACE=${0##*/if_errcoll_} 20 19 21 20 if [ "$1" = "autoconf" ]; then people/ilmari/modularisation-branch/node/node.d.sunos/io_busy_.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Wildcard-plugin to monitor disks. To monitor a disk, people/ilmari/modularisation-branch/node/node.d.sunos/io_bytes_.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Wildcard-plugin to monitor disks. To monitor a disk, people/ilmari/modularisation-branch/node/node.d.sunos/io_ops_.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Wildcard-plugin to monitor disks. To monitor a disk, people/ilmari/modularisation-branch/node/node.d.sunos/load.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 3 3 #%# family=auto people/ilmari/modularisation-branch/node/node.d.sunos/memory.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 #%# family=manual 3 #%# family=auto 4 #%# capabilities=autoconf 5 # 6 # Show memory stats based on top output 7 # 8 # Parameters 9 # env.top /path/to/top 10 # 11 # FIXME1: Reporting size in MB is Wrong. Report bytes and let rrd scale units 12 # FIXME2: Using kstat would be much better! 4 13 14 TOP=${top:-/usr/local/bin/top} 5 15 6 TOP=/usr/local/bin/top 16 if [ "$1" = "autoconf" ]; then 17 if [ -x $TOP ] ; then 18 echo yes 19 exit 0 20 else 21 echo "no (no executable: $TOP)" 22 exit 1 23 fi 24 fi 7 25 8 26 if [ "$1" = "config" ]; then 9 10 27 echo "graph_title Memory usage (in MB)" 11 28 echo 'graph_category system' people/ilmari/modularisation-branch/node/node.d.sunos/paging_in.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor CPU usage. people/ilmari/modularisation-branch/node/node.d.sunos/paging_out.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor CPU usage. people/ilmari/modularisation-branch/node/node.d.sunos/processes.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 #%# family=auto people/ilmari/modularisation-branch/node/node.d/amavis.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the amavis mail filter. … … 14 14 # amavislog - file where amavis logs are written 15 15 # 16 # #%# family=auto 17 # #%# capabilities=autoconf 16 18 17 19 mktempfile () { 18 @@MKTEMP@@ 20 $MUNIN_MKTEMP 19 21 } 20 22 21 AMAVIS_LOG=${ logfile:-/var/log/mail/mail.info}23 AMAVIS_LOG=${amavislog:-/var/log/mail/mail.info} 22 24 LOGTAIL=${logtail:-`which logtail`} 23 STATEFILE=@@PLUGSTATE@@/amavis.offset 24 25 if [ "$amavislog" ]; then AMAVIS_LOG=$amavislog ; fi 25 STATEFILE=$MUNIN_PLUGSTATE/amavis.offset 26 26 27 27 if [ "$1" = "autoconf" ]; then people/ilmari/modularisation-branch/node/node.d/apc_envunit_.in
r1045 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor APC environmental units (temperature/humidity) … … 16 16 # community - Community to use to access the APC unit 17 17 # 18 18 # #%# family=auto 19 # #%# capabilities=autoconf 19 20 # 20 21 # Configuration for temperature or humidity probes 22 # 23 # FIXME: Candidate to be snmp__apc 21 24 # 22 25 … … 50 53 if [ "$1" = "autoconf" ]; then 51 54 if [ -z "${UNITS}" -o -z "${SNMPGET}" ] ; then echo "no" ; exit 1 ; fi 55 if [ ! -x "$SNMPGET" ] ; then echo "no (no snmpget executable)"; exit 1; fi 52 56 for m in ${UNITS} ; do 53 57 if ping -c1 -q $m >/dev/null 2>&1 ; then continue ; fi people/ilmari/modularisation-branch/node/node.d/courier_.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to graph number of courier login/logouts … … 27 27 # courierpop3login: 28 28 # Jan 22 06:28:24 raven courierpop3login: Connection, ip=[::ffff:192.168.0.1] 29 5B30 29 # Jan 22 06:48:22 raven courierpop3login: DISCONNECTED, user=someuser, ip=[::ffff:192.168.0.1], top=0, retr=0, time=21 31 30 # Jan 22 06:28:24 raven courierpop3login: LOGIN, user=someuser, ip=[::ffff:192.168.0.1] … … 47 46 if [ -f ${COURIER_LOG} -a -x ${LOGTAIL} ] 48 47 then 49 echo yes 48 # Makes no sense for wildcard plugin to autoconf to yes 49 # unless you can provide suggestions. 50 echo no 50 51 exit 0 51 52 else people/ilmari/modularisation-branch/node/node.d/courier_mta_mailqueue.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor courier-mta mail spools people/ilmari/modularisation-branch/node/node.d/cupsys_pages.in
r1045 r1265 1 #2 1 #!@@PERL@@ -w 3 2 # … … 25 24 use strict; 26 25 # use Muninnode; 26 use Munin::Plugin; 27 27 28 28 my $statefile = "@@PLUGSTATE@@/munin-cupsys-pages.state"; … … 71 71 72 72 if (-f $statefile) { 73 open(IN, $statefile) or exit 4;73 open(IN, $statefile) or die "Could not open $statefile for reading: $!\n"; 74 74 if(<IN> =~ /^(\d+)$/) { 75 75 $pos = $1; … … 103 103 104 104 # Write back to state file 105 print "Foo! $statefile\n"; 106 open (STATFILE, ">$statefile") or exit 4;105 open (STATFILE, ">$statefile") or 106 die "Could not open $statefile for writing: $!\n"; 107 107 print STATFILE "$pos\n"; 108 108 foreach my $printer (sort(keys %printers)) { … … 116 116 print "graph_args --base 1000 -l 0\n"; 117 117 print "graph_vlabel pages/\${graph_period}\n"; 118 print "graph_order ".119 join(" ",120 sort(map { s/^[^a-zA-Z_]*//; s/[^a-zA-Z0-9_]/_/g; $_; }121 keys(%printers))),122 "\n";123 118 foreach my $printer (sort(keys %printers)) { 124 119 # Convert printername to something legal 125 120 my $p = $printer; 126 $printer =~ s/^[^a-zA-Z_]*//; 127 $printer =~ s/[^a-zA-Z0-9_]/_/g; 121 $printer = clean_fieldname($printer); 128 122 print "$printer.label $p\n"; 129 123 print "$printer.type DERIVE\n"; … … 134 128 foreach my $printer (sort(keys %printers)) { 135 129 my $p = $printer; 136 $printer =~ s/^[^a-zA-Z_]*//; 137 $printer =~ s/[^a-zA-Z0-9_]/_/g; 130 $printer = clean_fieldname($printer); 138 131 print "$printer.value ".$printers{$p}."\n"; 139 132 } 133 exit 0; 140 134 } 141 135 142 136 sub parselogfile { 143 137 my ($fname, $start, $stop) = @_; 144 open (LOGFILE, $fname) or exit 3;145 seek (LOGFILE, $start, 0) or exit 2;138 open (LOGFILE, $fname) or die "No logfile $fname: $!\n"; 139 seek (LOGFILE, $start, 0) or die "Could not seek in logfile $fname: $!\n"; 146 140 while (tell(LOGFILE) < $stop) { 147 141 my $line = <LOGFILE>; … … 157 151 close(LOGFILE); 158 152 } 159 160 people/ilmari/modularisation-branch/node/node.d/df.in
r1012 r1265 1 #!/bin/sh 1 #!@@GOODSH@@ 2 # -*- sh -*- 2 3 # 3 4 # Script to monitor disk usage. … … 14 15 #%# capabilities=autoconf 15 16 16 MAXLABEL=20 17 . $MUNIN_LIBDIR/plugins/plugin.sh 18 19 print_values () { 20 df -P -l 2>/dev/null | sed -e 1d -e '/\/\//d' -e 's/%//' | 21 while read dev size used free pct fs; do 22 echo "$(clean_fieldname $dev).value $pct" 23 done 24 } 25 17 26 18 27 if [ "$1" = "autoconf" ]; then 19 if [ `uname -s` = SunOS ]; then20 echo no21 exit 122 else23 echo yes24 exit 025 fi28 if [ -z "$(print_values)" ] ; then 29 echo no 30 exit 1 31 else 32 echo yes 33 exit 0 34 fi 26 35 fi 27 36 28 37 if [ "$1" = "config" ]; then 29 30 echo 'graph_title Filesystem usage (in %)' 31 echo 'graph_args --upper-limit 100 -l 0' 32 echo 'graph_vlabel %' 33 df -P -l | sed 1d | grep -v "//" | sort | while read i; do 34 name=`echo $i | sed 's/[\/.-]/_/g'| awk '{ print $1 }'` 35 printf "$name.label " 36 echo $i | awk "{ 37 dir=\$6 38 if (length(dir) <= $MAXLABEL) 39 print dir 40 else 41 printf (\"...%s\n\", substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3)) 42 }" 43 echo "$name.warning 92" 44 echo "$name.critical 98" 45 done 46 exit 0 38 echo 'graph_title Filesystem usage (in %)' 39 echo 'graph_args --upper-limit 100 -l 0' 40 echo 'graph_vlabel %' 41 echo 'graph_scale no' 42 df -P -l | sed -e 1d -e '/\/\//d' -e 's/%//' | sort | 43 while read dev size used free pct fs; do 44 name=$(clean_fieldname $dev) 45 echo "$name.label $fs" 46 echo "$name.warning 92" 47 echo "$name.critical 98" 48 done 49 exit 0 47 50 fi 48 51 49 df -P -l | sed 1d | grep -v "//" | while read i; do 50 name=`echo $i | sed 's/[\/.-]/_/g'| awk '{ print $1 ".value " }'` 51 printf "$name " 52 echo $i | awk '{ print $5 }' | cut -f1 -d% 53 done 52 print_values 53 people/ilmari/modularisation-branch/node/node.d/df_inode.in
r1012 r1265 1 #!/bin/sh 1 #!@@GOODSH@@ 2 # -*- sh -*- 2 3 # 3 # Plugin to monitor inode-usage. 4 5 # Plugin to monitor inode-usage. This plugin is meant to be generic 6 # unix but there will be specific kinks on each platform that may 7 # justify custom versions. It does not work on SunOS/Solaris. 8 4 9 # 5 10 # Parameters understood: … … 14 19 #%# capabilities=autoconf 15 20 16 MAXLABEL=20 17 18 fs() { 19 local escaped_mntpt=`echo "$*" | awk '{ print $NF }' | sed 's|/|\\\\/|g'` 20 awk "/^[^ ]* $escaped_mntpt / { print \$3 }" /proc/mounts | grep -v rootfs 21 } 21 . $MUNIN_LIBDIR/plugins/plugin.sh 22 22 23 23 print_values() { 24 df -P -l -i | sed 1d | grep -v "//" | while read i; do 25 if [ "`fs $i`" = "reiserfs" ] ; then continue ; fi 26 name=`echo $i | sed 's/[\/.]/_/g'| awk '{ print $1 ".value " }'` 27 printf "$name " 28 echo $i | awk '{ print $5 }' | cut -f1 -d% 29 done 24 df -P -l -i 2>/dev/null | sed -e '1d' -e '/\/\//d' -e 's/%//' | 25 while read dev avail used free pct fs; do 26 echo "$(clean_fieldname $dev).value $pct" 27 done 30 28 } 31 29 32 30 if [ "$1" = "autoconf" ]; then 33 if [ "`print_values`" = "" ] ; then 34 echo no 35 exit 1 36 else 37 if [ `uname -s` = SunOS ]; then 38 echo no 39 exit 1 40 else 41 echo yes 42 exit 0 43 fi 44 fi 31 if [ -z "$(print_values)" ] ; then 32 echo no 33 exit 1 34 else 35 echo yes 45 36 exit 0 37 fi 46 38 fi 47 39 48 40 if [ "$1" = "config" ]; then 49 50 echo 'graph_title Inode usage (in %)' 51 echo 'graph_args --upper-limit 100 -l 0' 52 echo 'graph_vlabel %' 53 df -P -l -i | sed 1d | grep -v "//" | sort | while read i; do 54 if [ "`fs $i`" = "reiserfs" ] ; then continue ; fi 55 name=`echo $i | sed 's/[\/.]/_/g'| awk '{ print $1 }'` 56 printf "$name.label " 57 echo $i | awk "{ 58 dir=\$6 59 if (length(dir) <= $MAXLABEL) 60 print dir 61 else 62 printf (\"...%s\n\", substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3)) 63 }" 64 echo "$name.warning 92" 65 echo "$name.critical 98" 66 done 67 exit 0 41 echo 'graph_title Inode usage (in %)' 42 echo 'graph_args --upper-limit 100 -l 0' 43 echo 'graph_vlabel %' 44 echo 'graph_scale no' 45 df -P -l -i | sed -e '1d' -e '/\/\//d' -e 's/%//' | sort | 46 while read dev avail used free pct fs; do 47 name=$(clean_fieldname $dev) 48 echo "$name.label $fs" 49 echo "$name.warning 92" 50 echo "$name.critical 98" 51 done 52 exit 0 68 53 fi 69 54 people/ilmari/modularisation-branch/node/node.d/exim_mailqueue.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor exim queue size … … 25 25 DIRNAME=`dirname $0` 26 26 SPOOLDIR="unset" 27 EXIM=`which exim 2>/dev/null || which exim4 2>/dev/null` 28 QUEUEWARN=100 29 QUEUECRIT=200 27 # You cannot trust the exit status of which 28 EXIM=$(which exim 2>/dev/null) 29 case $EXIM:$? in 30 *:1|no*) EXIM=$(which exim4 2>/dev/null) 31 esac 32 case $EXIM:$? in 33 *:1|no*) EXIM='' 34 esac 35 30 36 GRAPHTITLE='Exim Mailqueue' 31 37 32 if [ "$spooldir" ]; then SPOOLDIR=$spooldir ; fi 33 if [ "$exim" ]; then EXIM=$exim ; fi 34 if [ "$queuewarn" ]; then QUEUEWARN=$queuewarn; fi 35 if [ "$queuecrit" ]; then QUEUECRIT=$queuecrit; fi 36 if [ "$graphtitle" ]; then GRAPHTITLE=$graphtitle; fi 38 SPOOLDIR=${spooldir:-unset} 39 EXIM=${exim:-unset} 40 QUEUEWARN=${queuewarn:-100} 41 QUEUECRIT=${queuecrit:-200} 42 GRAPHTITLE=${graphtitle:-$GRAPHTITLE} 37 43 38 44 if [ "$SPOOLDIR" = "unset" ] 39 45 then 40 SPOOLDIR= `($EXIM -bP spool_directory | awk '{ print $3 "/input" }') 2>/dev/null`46 SPOOLDIR=$( ($EXIM -bP spool_directory | awk '{ print $3 "/input" }') 2>/dev/null) 41 47 fi 42 48 43 49 if [ "$1" = "autoconf" ]; then 44 if ( $EXIM -bV 2>/dev/null >/dev/null ); then 50 if [ -z "$EXIM" ]; then 51 echo no 52 exit 1 53 fi 54 55 if $EXIM -bV 2>/dev/null >/dev/null; then 45 56 if ( /usr/bin/find $SPOOLDIR -iname "*-H" -print 2>/dev/null >/dev/null ); then 46 57 echo yes people/ilmari/modularisation-branch/node/node.d/exim_mailqueue_alt.in
r1012 r1265 1 #! /bin/bash1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor Exim's mail queue … … 24 24 25 25 PATH='/bin:/sbin:/usr/bin:/usr/sbin' 26 EXIM=`which exim 2>/dev/null || which exim4 2>/dev/null` 27 QUEUEWARN=100 26 # You cannot trust the exit status of which 27 EXIM=$(which exim 2>/dev/null) 28 case $EXIM:$? in 29 *:1|no*) EXIM=$(which exim4 2>/dev/null) 30 esac 31 case $EXIM:$? in 32 *:1|no*) EXIM='' 33 esac 34 28 35 QUEUECRIT=200 29 36 30 [ "$exim" ] && EXIM=$exim 31 [ "$queuewarn" ] && QUEUEWARN=$queuewarn 32 [ "$queuecrit" ] && QUEUECRIT=$queuecrit 37 EXIM=${exim:-$EXIM} 38 QUEUEWARN=${queuewarn:-100} 39 QUEUECRIT=${queuecrit:-200} 33 40 34 41 if [ "$1" == "config" ]; then people/ilmari/modularisation-branch/node/node.d/exim_mailstats.in
r1012 r1265 34 34 my $ts = sprintf("%04d%02d%02d",$t[5]+1900, $t[4]+1, $t[3]); 35 35 $logfile =~ s/\%D/$ts/g; 36 } 36 } 37 37 my @lfiles = split(/\s?:\s?/, $logfile); 38 38 foreach (@lfiles) { … … 57 57 { 58 58 my $logfile; 59 59 60 60 if(defined($LOGDIR)) { 61 61 if(! -d $LOGDIR) { people/ilmari/modularisation-branch/node/node.d/foldingathome.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Folding@Home people/ilmari/modularisation-branch/node/node.d/foldingathome_rank.in
r864 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Folding@Home Rank … … 13 13 #%# capabilities=autoconf 14 14 15 statefile= @@PLUGSTATE@@/plugin-fah_rank.state15 statefile=$MUNIN_PLUGSTATE/plugin-fah_rank.state 16 16 17 17 if [ "$1" = "autoconf" ]; then 18 echo yes 19 exit 0 18 # No real check of anything 19 # echo yes 20 echo no 21 exit 1 20 22 fi 21 23 people/ilmari/modularisation-branch/node/node.d/foldingathome_wu.in
r864 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Folding@Home WU submited … … 13 13 #%# capabilities=autoconf 14 14 15 statefile= @@PLUGSTATE@@/plugin-fah_wu.state15 statefile=$MUNIN_PLUGSTATE/plugin-fah_wu.state 16 16 17 17 if [ "$1" = "autoconf" ]; then 18 echo yes 19 exit 0 18 # Didn't check anything, which is meaningless in this case. 19 # echo yes 20 echo no 21 exit 1 20 22 fi 21 23 … … 30 32 fi 31 33 32 wu= `wget "http://vspx27.stanford.edu/cgi-bin/main.py?qtype=userpage&username=8d" -q -t 1 -T 5 -O - | egrep -A 2 "<TD> WU</TD>" | grep "<b>" | sed 's/.*<b> \([0-9]*\) .*/\1/'`34 wu=$(wget "http://vspx27.stanford.edu/cgi-bin/main.py?qtype=userpage&username=8d" -q -t 1 -T 5 -O - | egrep -A 2 "<TD> WU</TD>" | grep "<b>" | sed 's/.*<b> \([0-9]*\) .*/\1/') 33 35 34 36 if [ "$wu" == "" ]; then people/ilmari/modularisation-branch/node/node.d/hddtemp.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor harddrive temperatures through SMART. people/ilmari/modularisation-branch/node/node.d/id.in
r1015 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Copyright (C) 2006 Dagfinn Ilmari Mannsaaker <ilmari@ilmari.org> people/ilmari/modularisation-branch/node/node.d/ipac-ng.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Skeleton-plugin to monitor ipac-ng rules. To monitor an people/ilmari/modularisation-branch/node/node.d/mbmon_.in
r864 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor Motherboard temparature using mbmon … … 21 21 #%# capabilities=autoconf suggest 22 22 23 24 25 23 what=`basename $0 | sed 's/^mbmon_//g'` 26 27 24 28 25 if [ "$1" = "suggest" ]; then people/ilmari/modularisation-branch/node/node.d/multips.in
r1045 r1265 1 #!/bin/sh 1 #!@@GOODSH@@ 2 # -*- sh -*- 2 3 # 3 4 # Script to monitor number of processes. Programs are configured … … 46 47 47 48 eval REGEX='"${regex_'$name'-\<'$name'\>}"' 48 PGREP= `which pgrep`49 if [ -n "$PGREP" ]; then49 PGREP=$(which pgrep) 50 if [ -n "$PGREP" -a -x "$PGREP" ]; then 50 51 $PGREP -f -l "$name" | grep "$REGEX" | wc -l 51 52 elif [ -x /usr/ucb/ps ]; then people/ilmari/modularisation-branch/node/node.d/munin_graph.in
r1012 r1265 1 #!/bin/sh 1 #!@@GOODSH@@ 2 # -*- sh -*- 2 3 # 3 4 # Script to monitor munin-graph … … 11 12 # scripts): 12 13 # 13 #%# family= manual14 #%# family=auto 14 15 #%# capabilities=autoconf 15 16 16 17 if [ ! "$GRAPH_STATSFILE" ] ; then 17 GRAPH_STATSFILE= @@DBDIR@@/munin-graph.stats18 GRAPH_STATSFILE=$MUNIN_DBDIR/munin-graph.stats 18 19 fi 19 20 20 21 if [ "$1" = "autoconf" ]; then 21 if [ - f$GRAPH_STATSFILE ]; then22 if [ -r $GRAPH_STATSFILE ]; then 22 23 echo "yes" 23 24 exit 0 people/ilmari/modularisation-branch/node/node.d/munin_update.in
r1012 r1265 1 #!/bin/sh 1 #!@@GOODSH@@ 2 # -*- sh -*- 2 3 # 3 4 # Script to monitor Munin-update … … 11 12 # scripts): 12 13 # 13 #%# family= manual14 #%# family=auto 14 15 #%# capabilities=autoconf 15 16 16 17 if [ ! "$UPDATE_STATSFILE" ]; then 17 UPDATE_STATSFILE= @@DBDIR@@/munin-update.stats18 UPDATE_STATSFILE=$MUNIN_DBDIR/munin-update.stats 18 19 fi 19 20 20 21 if [ "$1" = "autoconf" ]; then 21 if [ - f$UPDATE_STATSFILE ]; then22 if [ -r $UPDATE_STATSFILE ]; then 22 23 echo "yes" 23 24 exit 0 people/ilmari/modularisation-branch/node/node.d/mysql_bytes.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the number of bytes sent from and received by mysql. people/ilmari/modularisation-branch/node/node.d/mysql_isam_space_.in
r1012 r1265 1 1 #!@@PERL@@ -w 2 # -*- perl -*- 2 3 # 3 4 # Plugin to monitor the percent of table space used on isam and myisam … … 24 25 my $STATEFILE = $ENV{'statefile'} || "@@PLUGSTATE@@/plugin-mysql_isam_space.state"; 25 26 my $MYSQLSHOW = $ENV{'mysqlshow'} || 'mysqlshow'; 27 my $ABSOLUTE = $ENV{'absolute'} || 0; 26 28 my @mysql_opts = (); 27 29 … … 193 195 if (! $headerseen and $fields[1] eq "Name") 194 196 { # Header line, grab field names 195 %index = map {($field [$_], $_)} 0..$#fields;197 %index = map {($fields[$_], $_)} 0..$#fields; 196 198 } 197 199 else people/ilmari/modularisation-branch/node/node.d/mysql_queries.in
r1045 r1265 105 105 else 106 106 { 107 print "no (mysq admin not found)\n";107 print "no (mysqladmin not found)\n"; 108 108 } 109 109 exit $return; people/ilmari/modularisation-branch/node/node.d/mysql_slowqueries.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the number of slow queries on a mysql-server people/ilmari/modularisation-branch/node/node.d/mysql_threads.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the number of threads on a mysql-server. Faster than people/ilmari/modularisation-branch/node/node.d/named.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Munin plugin for named. This is a bit experimental, we will have to see … … 130 130 131 131 do_stats 132 people/ilmari/modularisation-branch/node/node.d/ntp_.in
r1012 r1265 1 1 #!@@PERL@@ -w 2 # -*- perl -*- 2 3 # 3 4 # Plugin to monitor NTP statistics … … 76 77 } 77 78 print "graph_args --base 1000 --vertical-label seconds --lower-limit 0\n"; 79 print "graph_category time\n"; 78 80 print "delay.label Delay\n"; 79 81 print "delay.draw LINE2\n"; people/ilmari/modularisation-branch/node/node.d/ntp_states.in
r1012 r1265 1 1 #!@@PERL@@ -w 2 # -*- perl -*- 2 3 # 3 4 # Plugin to monitor NTP states … … 53 54 print "graph_title NTP states\n"; 54 55 print "graph_args --base 1000 --vertical-label msec --lower-limit 0\n"; 56 print "graph_category time\n"; 55 57 foreach (`ntpq -c "hostnames no" -c peers`) { 56 58 next unless /^.(\d+\.\d+\.\d+\.\d+)/; people/ilmari/modularisation-branch/node/node.d/perdition.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to graph perdition connections and errors … … 57 57 fatal.label Fatal Errors 58 58 EOF 59 # Echo warnnig and critical attributes if set in the plugin config 60 for i in imap imaps pop pops fatal connection disconnected; do 61 warn=\$${i}_warn; eval val=$warn 62 [ "$val" ] && echo "$i.warning ${val}" 63 crit=\$${i}_crit; eval val=$crit 64 [ "$val" ] && echo "$i.critical ${val}" 65 done 59 66 exit 0 60 67 ;; people/ilmari/modularisation-branch/node/node.d/ping_.in
r864 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Copyright (C) 2004 Jimmy Olsen … … 26 26 # ping - Ping program to use 27 27 # host - Host to ping 28 # ping_warn - Warning limit for nagios notification 29 # ping_crit - Critical limit for nagios notification 30 # packetloss_warn- Warning limit for nagios notification 31 # packetloss_crit- Critical limit for nagios notification 28 32 # 29 33 # Arguments for Solaris: … … 47 51 echo 'packetloss.label packet loss' 48 52 echo 'packetloss.graph no' 53 [ -n "$ping_warn" ] && echo "ping.warning $ping_warn" 54 [ -n "$ping_crit" ] && echo "ping.critical $ping_crit" 55 [ -n "$packetloss_warn" ] && echo "packetloss.warning $packetloss_warn" 56 [ -n "$packetloss_crit" ] && echo "packetloss.critical $packetloss_crit" 49 57 exit 0 50 58 fi people/ilmari/modularisation-branch/node/node.d/postfix_mailqueue.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor postfix mail spools people/ilmari/modularisation-branch/node/node.d/postfix_mailstats.in
r1012 r1265 109 109 { 110 110 print "delivered.value U\n"; 111 foreach my $i ( keys %{$rejects})111 foreach my $i (sort keys %{$rejects}) 112 112 { 113 113 print "r$i.value U\n"; … … 147 147 print "delivered.draw AREA\n"; 148 148 print "delivered.min 0\n"; 149 foreach my $i ( keys %{$rejects})149 foreach my $i (sort keys %{$rejects}) 150 150 { 151 151 print "r$i.label reject $i\n"; … … 158 158 159 159 print "delivered.value $delivered\n"; 160 foreach my $i ( keys %{$rejects})160 foreach my $i (sort keys %{$rejects}) 161 161 { 162 162 print "r$i.value ", $rejects->{$i}, "\n"; … … 168 168 open (OUT, ">$statefile") or exit 4; 169 169 print OUT "$pos:$delivered\n"; 170 foreach my $i ( keys %{$rejects})170 foreach my $i (sort keys %{$rejects}) 171 171 { 172 172 print OUT "$i:", $rejects->{$i}, "\n"; people/ilmari/modularisation-branch/node/node.d/ps_.in
r1045 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Wildcard-script to monitor number of processes. To monitor a … … 22 22 #%# capabilities=autoconf suggest 23 23 24 . $MUNIN_LIBDIR/plugins/plugin.sh 24 25 25 26 myname=`basename $0 | sed 's/^ps_//g'` … … 29 30 30 31 if [ "$1" = "autoconf" ]; then 31 echo yes 32 exit 0 32 # Makes little sense to autoconf if you can't suggest 33 echo no 34 exit 0 33 35 fi 34 36 … … 43 45 echo 'graph_category processes' 44 46 echo "count.label $myname" 45 echo 'processes.draw LINE2'46 47 exit 0 47 48 fi people/ilmari/modularisation-branch/node/node.d/psu_.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Wildcard-script to monitor number of processes running as a given user. … … 17 17 #%# family=manual 18 18 #%# capabilities=autoconf suggest 19 20 21 19 22 20 name=`basename $0 | sed 's/^psu_//g'` people/ilmari/modularisation-branch/node/node.d/samba.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the number of open files in the system. people/ilmari/modularisation-branch/node/node.d/sendmail_mailqueue.in
r1045 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor sendmail queue size. people/ilmari/modularisation-branch/node/node.d/sendmail_mailstats.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor sendmail statistics. … … 21 21 22 22 if [ "$1" = "autoconf" ]; then 23 if [ -n "$MAILSTATS" -a -x $MAILSTATS]; then23 if [ -n "$MAILSTATS" -a -x "$MAILSTATS" ]; then 24 24 echo yes 25 25 exit 0 people/ilmari/modularisation-branch/node/node.d/sendmail_mailtraffic.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor sendmail statistics. … … 21 21 22 22 if [ "$1" = "autoconf" ]; then 23 if [ -n "$MAILSTATS" -a -x $MAILSTATS]; then23 if [ -n "$MAILSTATS" -a -x "$MAILSTATS" ]; then 24 24 echo yes 25 25 exit 0 people/ilmari/modularisation-branch/node/node.d/snmp__if_.in
r1012 r1265 27 27 28 28 my $response; 29 30 # This is the snmpwalk: 31 # .1.3.6.1.2.1.2.1.0 = INTEGER: 2 32 # .1.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1 33 # .1.3.6.1.2.1.2.2.1.1.65539 = INTEGER: 65539 34 # .1.3.6.1.2.1.2.2.1.2.1 = STRING: MS TCP Loopback interface 35 # .1.3.6.1.2.1.2.2.1.2.65539 = STRING: Broadcom NetXtreme Gigabit Ethernet 36 # .1.3.6.1.2.1.2.2.1.3.1 = INTEGER: softwareLoopback(24) 37 # .1.3.6.1.2.1.2.2.1.3.65539 = INTEGER: ethernetCsmacd(6) 38 # .1.3.6.1.2.1.2.2.1.4.1 = INTEGER: 1520 39 # .1.3.6.1.2.1.2.2.1.4.65539 = INTEGER: 1500 40 # .1.3.6.1.2.1.2.2.1.5.1 = Gauge32: 10000000 41 # .1.3.6.1.2.1.2.2.1.5.65539 = Gauge32: 1000000000 42 # .1.3.6.1.2.1.2.2.1.6.1 = STRING: 43 # .1.3.6.1.2.1.2.2.1.6.65539 = STRING: 0:30:48:75:65:5e 44 # .1.3.6.1.2.1.2.2.1.7.1 = INTEGER: up(1) 45 # .1.3.6.1.2.1.2.2.1.7.65539 = INTEGER: up(1) 46 # .1.3.6.1.2.1.2.2.1.8.1 = INTEGER: up(1) 47 # .1.3.6.1.2.1.2.2.1.8.65539 = INTEGER: up(1) 29 48 30 49 if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") people/ilmari/modularisation-branch/node/node.d/spamstats.in
r1012 r1265 73 73 { 74 74 # Log rotated 75 parselogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]); 75 if (-f $rotlogfile) { 76 parselogfile ($rotlogfile, $pos, (stat $rotlogfile)[7]); 77 } 76 78 $pos = 0; 77 79 } people/ilmari/modularisation-branch/node/node.d/squid_cache.in
r1012 r1265 68 68 my $cachemgr = IO::Socket::INET->new(PeerAddr => $host, 69 69 PeerPort => $port, 70 Proto => 'tcp'); 70 Proto => 'tcp', 71 Timeout => 5); 71 72 72 73 if (!$cachemgr) people/ilmari/modularisation-branch/node/node.d/squid_icp.in
r1012 r1265 73 73 my $cachemgr = IO::Socket::INET->new(PeerAddr => $host, 74 74 PeerPort => $port, 75 Proto => 'tcp'); 75 Proto => 'tcp', 76 Timeout => 5); 76 77 77 78 if (!$cachemgr) people/ilmari/modularisation-branch/node/node.d/squid_requests.in
r1012 r1265 69 69 my $cachemgr = IO::Socket::INET->new(PeerAddr => $host, 70 70 PeerPort => $port, 71 Proto => 'tcp'); 71 Proto => 'tcp', 72 Timeout => 5); 72 73 73 74 if (!$cachemgr) people/ilmari/modularisation-branch/node/node.d/squid_traffic.in
r1012 r1265 70 70 my $cachemgr = IO::Socket::INET->new(PeerAddr => $host, 71 71 PeerPort => $port, 72 Proto => 'tcp'); 72 Proto => 'tcp', 73 Timeout => 5); 73 74 74 75 if (!$cachemgr) people/ilmari/modularisation-branch/node/node.d/vmstat.in
r1012 r1265 1 #! /bin/sh1 #!@@GOODSH@@ 2 2 # 3 3 # Plugin to monitor the number of procs in io-sleep and other wait people/ilmari/modularisation-branch/node/plugins.history.in
r1012 r1265 1 1 2 # 2 3 # This file contains plugin history. It only contains history for plugins in … … 120 121 [1.3.1] 121 122 [1.3.2] 123 linux/yum 124 digitemp_ 125 [1.3.3] 126 aix/load 127 digitemp_ 128 env 129 freebsd/uptime 130 id 131 linux/acpi 132 linux/cpuspeed 133 linux/nfs4_client 134 linux/proc_pri 135 linux/quota_usage_ 136 linux/threads 137 linux/yum 138 lpstat 139 multiping 140 netbsd 141 netbsd/cpu 142 netbsd/df 143 netbsd/df_inode 144 netbsd/forks 145 netbsd/if_ 146 netbsd/if_errcoll_ 147 netbsd/interrupts 148 netbsd/iostat 149 netbsd/iostat_ops 150 netbsd/irqstats 151 netbsd/load 152 netbsd/memory 153 netbsd/memory_pools 154 netbsd/memory_types 155 netbsd/netstat 156 netbsd/nfs_client 157 netbsd/nfsd 158 netbsd/open_files 159 netbsd/processes 160 netbsd/sensors_ 161 netbsd/swap 162 netbsd/uptime 163 netbsd/vmstat 164 netopia 165 ntp_kernel_err 166 ntp_kernel_pll_freq 167 ntp_kernel_pll_off 168 nutups_ 169 qmailscan 170 qmailscan-simple 171 snmp__rdp_users 172 snmp__uptime 173 snmp__winmem 174 sunos/df 175 sunos/df_inode 176 sunos/uptime 177 tomcat_access 178 tomcat_jvm 179 tomcat_threads 180 tomcat_volume 181 users people/ilmari/modularisation-branch/server/munin-cgi-graph.in
r1012 r1265 1 1 #!@@PERL@@ -Tw 2 #3 2 # 4 3 # Copyright (C) 2004 Jimmy Olsen … … 50 49 my $serv = ""; 51 50 my $dom = ""; 51 my $lock = ""; 52 52 53 53 my $config = &munin_readconfig ($conffile); … … 103 103 print "\n"; 104 104 105 # Try to police the number of concurrent rrdgraph instances. The 106 # third value is the default maximum. 107 108 # NOTE: The munin_*lock functions are not exactly ideal for race prone 109 # locking, they're a bit fuzzy. A better solution, which would not 110 # imply a "sleep 1" would be to use semaphores. See "perldoc perlipc" 111 # and "man semop". 112 113 my $max_cgi_graph_jobs = &munin_get ($config, "max_cgi_graph_jobs" , 6, $dom); 114 115 until ( $lock ) { 116 foreach my $n ( 1 .. $max_cgi_graph_jobs ) { 117 if (&munin_getlock ("$config->{rundir}/munin-cgi-graph-$n.lock")) { 118 $lock = "munin-cgi-graph-$n.lock"; 119 last; 120 } 121 } 122 sleep 1; 123 } 105 124 106 125 &graph ($filename); 126 127 munin_removelock($lock); 107 128 108 129 sub graph people/ilmari/modularisation-branch/server/munin-cron.pod
r864 r1265 36 36 so only use parameters that are understood by all the other programs. 37 37 38 =head1 VERSION39 40 This is munin-cron version 0.9.2-341 42 38 =head1 AUTHORS 43 39 … … 46 42 =head1 COPYRIGHT 47 43 48 Copyright © 2002-200 4Audun Ytterdal and Jimmy Olsen / Linpro AS.44 Copyright © 2002-2006 Audun Ytterdal and Jimmy Olsen / Linpro AS. 49 45 50 46 This is free software; see the source for copying conditions. There is people/ilmari/modularisation-branch/server/munin-graph.in
r1012 r1265 1 1 #!@@PERL@@ -w 2 # -*- cperl -*- 2 3 # 3 # Copyright (C) 2002-200 4 Jimmy Olsen, Audun Ytterdal4 # Copyright (C) 2002-2006 Jimmy Olsen, Audun Ytterdal, Nicolai Langfeldt 4 5 # 5 6 # This program is free software; you can redistribute it and/or … … 17 18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 19 # 19 #20 20 # $Id$ 21 # 21 22 22 $|=1; 23 23 … … 33 33 my $graph_time= Time::HiRes::time; 34 34 my $DEBUG = 0; 35 my $VERSION = "@@VERSION@@";35 my $VERSION = '@@VERSION@@'; 36 36 37 37 # Limit graphing to certain hosts and/or services … … 42 42 my $RRDkludge = $RRDs::VERSION < 1.2 ? '' : '\\'; 43 43 44 # Force drawing of "graph no". 44 # And RRDtool 1.2 and later has draws lines with crayons so we hack 45 # the LINE* options a bit. 46 my $LINEkluge=0; 47 if ($RRDs::VERSION >= 1.2) { 48 $LINEkluge=1; 49 } 50 51 # Force drawing of "graph no". 45 52 my $force_graphing = 0; 46 53 my $force_lazy = 1; … … 514 521 { 515 522 my $name = shift; 516 523 517 524 $name = substr (Digest::MD5::md5_hex ($name), -15) 518 525 if (length $name > 15); … … 544 551 my @added = (); 545 552 546 # See if we should skip the service 553 # See if we should skip the service 547 554 next if (&skip_service ($node, $service)); 548 555 … … 553 560 my $force_single_value; 554 561 555 @field_order = @{&munin_get_field_order ($node, $config, $domain, $name, $service, \$force_single_value)}; 562 # munin_set_context($node,$config,$domain,$name,$service); 563 564 @field_order = 565 @{&munin_get_field_order($node, $config, $domain, $name, 566 $service, \$force_single_value)}; 556 567 557 568 # Array to keep 'preprocess'ed fields. 558 569 my @rrd_preprocess = (); 559 print "DEBUG: Expanding specials \"", join "\",\"", @field_order, "\".\n" if $DEBUG; 560 @added = @{&expand_specials ($node, $config, $domain, $name, $service, \@rrd_preprocess, \@field_order)}; 570 print "DEBUG: Expanding specials \"", 571 join("\",\"", @field_order), "\".\n" 572 if $DEBUG; 573 574 @added = 575 @{&expand_specials ($node, $config, $domain, $name, 576 $service, \@rrd_preprocess, \@field_order)}; 561 577 562 578 @field_order = (@rrd_preprocess, @field_order); 563 print "DEBUG: Checking field lengths \"", join "\",\"", (@rrd_preprocess, @field_order), "\".\n" if $DEBUG; 579 print "DEBUG: Checking field lengths \"", 580 join("\",\"", @rrd_preprocess), "\".\n" 581 if $DEBUG; 564 582 565 583 # Get max label length 566 $max_field_len = &munin_get_max_label_length ($node, $config, $domain, $name, $service, \@field_order); 567 my $global_headers = ($max_field_len > 20); 584 $max_field_len = 585 &munin_get_max_label_length ($node, $config, $domain, $name, 586 $service, \@field_order); 587 # my $global_headers = ($max_field_len >= 16); 588 # Global headers makes the value tables easier to read no matter how 589 # wide the labels are. 590 my $global_headers = 1; 591 592 # Default format for printing under graph. 593 my $avgformat; 594 my $rrdformat=$avgformat="%6.2lf"; 595 596 if (exists $node->{client}->{$service}->{graph_args} and 597 $node->{client}->{$service}->{graph_args} =~ /--base\s+1024/) { 598 # If the base unit is 1024 then 1012.56 is a valid 599 # number to show. That's 7 positions, not 6. 600 $rrdformat=$avgformat="%7.2lf"; 601 } 602 603 if (exists $node->{client}->{$service}->{graph_printf} ) { 604 # Plugin specified complete printf format 605 $rrdformat=$node->{client}->{$service}->{graph_printf}; 606 } 607 608 my $rrdscale = ''; 609 $rrdscale = '%s' 610 if munin_get_bool_val ($node->{client}->{$service}->{graph_scale},1); 568 611 569 612 # Array to keep negative data until we're finished with positive. … … 572 615 my %total_pos; 573 616 my %total_neg; 617 my $autostacking=0; 574 618 print "DEBUG: Treating fields \"", join "\",\"", @field_order, "\".\n" if $DEBUG; 575 619 for my $field (@field_order) { 576 620 my $path = undef; 577 if ($field =~ s/=(.+)//) 578 { 621 if ($field =~ s/=(.+)//) { 579 622 $path = $1; 580 623 } … … 583 626 print "DEBUG: Processing field \"$field\".\n" if $DEBUG; 584 627 585 if ($field_count == 0 and munin_get ($config, "draw", "LINE2", $domain, $name, $service, $field) eq "STACK") 586 { # Illegal -- first field is a STACK 587 logger ("ERROR: First field (\"$field\") of graph \"$domain\" :: \"$name\" :: \"$service\" is STACK. STACK can only be drawn after a LINEx or AREA."); 588 } 589 628 my $fielddraw = munin_get ($config, "draw", "LINE2", $domain, 629 $name, $service, $field); 630 631 if ($field_count == 0 and $fielddraw eq 'STACK') { 632 # Illegal -- first field is a STACK 633 logger ("ERROR: First field (\"$field\") of graph \"$domain\"". 634 ":: \"$name\" :: \"$service\" is STACK. STACK can ". 635 "only be drawn after a LINEx or AREA."); 636 $fielddraw = "LINE2"; 637 } 638 639 if ($fielddraw eq 'AREASTACK') { 640 if ($autostacking==0) { 641 $fielddraw='AREA'; 642 $autostacking=1; 643 } else { 644 $fielddraw='STACK'; 645 } 646 } 647 648 if ($fielddraw =~ /LINESTACK(\d+(?:.\d+)?)/ ) { 649 if ($autostacking==0) { 650 $fielddraw="LINE$1"; 651 $autostacking=1; 652 } else { 653 $fielddraw='STACK'; 654 } 655 } 656 590 657 # Getting name of rrd file 591 $filename = &munin_get_rrd_filename ($node, $config, $domain, $name, $service, $field, $path); 658 $filename = &munin_get_rrd_filename ($node, $config, $domain, 659 $name, $service, $field, 660 $path); 592 661 593 662 my $update = RRDs::last ($filename); 594 663 $update = 0 if ! defined $update; 595 if ($update > $lastupdate) 596 { 664 if ($update > $lastupdate) { 597 665 $lastupdate = $update; 598 666 } 599 667 600 my $rrdfield = ($node->{client}->{$service}->{$field.".rrdfield"} || "42"); 601 my $single_value = $force_single_value || &single_value ($node, $config, $domain, $name, $service, $field, \@field_order); 602 my $has_negative = exists $node->{client}->{$service}->{$field.".negative"}; 668 # It does not look like $fieldname.rrdfield is possible to set 669 my $rrdfield = ($node->{client}->{$service}->{$field.".rrdfield"} 670 || "42"); 671 672 my $single_value = $force_single_value || 673 &single_value ($node, $config, $domain, $name, 674 $service, $field, \@field_order); 675 676 my $has_negative = 677 exists $node->{client}->{$service}->{$field.".negative"}; 603 678 604 679 # Trim the fieldname to make room for other field names. 605 680 $rrdname = &get_field_name ($field); 606 if ($rrdname ne $field) # A change was made607 {681 if ($rrdname ne $field) { 682 # A change was made 608 683 set_cdef_name ($node->{client}->{$service}, $field, $rrdname); 609 684 } … … 615 690 push (@rrd, "DEF:a$rrdname=" . 616 691 $filename . ":" . $rrdfield . ":MAX"); 617 if (exists $node->{client}->{$service}->{$field.".onlynullcdef"} and $node->{client}->{$service}->{$field.".onlynullcdef"}) 618 { 619 push (@rrd, "CDEF:c$rrdname=g$rrdname" . (($now-$update)>900 ? ",POP,UNKN" : "")); 620 } 621 if (($node->{client}->{$service}->{$field.".type"}||"GAUGE") ne "GAUGE" and graph_by_minute ($config, $domain, $name, $service)) 622 { 623 push (@rrd, &expand_cdef($node->{client}->{$service}, \$rrdname, "$field,60,*")); 624 } 625 if ($node->{client}->{$service}->{$field.".cdef"}) 626 { 627 push (@rrd, &expand_cdef($node->{client}->{$service}, \$rrdname, $node->{client}->{$service}->{$field.".cdef"})); 692 693 if (exists $node->{client}->{$service}->{$field.".onlynullcdef"} 694 and 695 $node->{client}->{$service}->{$field.".onlynullcdef"}) { 696 push (@rrd, "CDEF:c$rrdname=g$rrdname" . 697 (($now-$update)>900 ? ",POP,UNKN" : "")); 698 } 699 700 if (($node->{client}->{$service}->{$field.".type"}||"GAUGE") 701 ne "GAUGE" 702 and graph_by_minute ($config, $domain, $name, $service)) { 703 push (@rrd, &expand_cdef($node->{client}->{$service}, 704 \$rrdname, "$field,60,*")); 705 } 706 707 if ($node->{client}->{$service}->{$field.".cdef"}) { 708 push (@rrd,&expand_cdef($node->{client}->{$service}, 709 \$rrdname, 710 $node->{client}->{$service}->{$field.".cdef"})); 628 711 push (@rrd, "CDEF:c$rrdname=g$rrdname"); 629 712 print "DEBUG: Field name after cdef set to $rrdname\n" if $DEBUG; 630 } 631 elsif (!(exists $node->{client}->{$service}->{$field.".onlynullcdef"} and $node->{client}->{$service}->{$field.".onlynullcdef"})) 632 { 713 } elsif (!(exists $node->{client}->{$service}->{$field.".onlynullcdef"} 714 and $node->{client}->{$service}->{$field.".onlynullcdef"})) { 633 715 push (@rrd, "CDEF:c$rrdname=g$rrdname" . (($now-$update)>900 ? ",POP,UNKN" : "")); 634 716 } … … 637 719 print "DEBUG: Drawing field \"$field\".\n" if $DEBUG; 638 720 639 if ($single_value) # Only one field. Do min/max range.640 {721 if ($single_value) { 722 # Only one field. Do min/max range. 641 723 push (@rrd, "CDEF:min_max_diff=a$rrdname,i$rrdname,-"); 642 724 push (@rrd, "CDEF:re_zero=min_max_diff,min_max_diff,-") … … 648 730 } 649 731 650 if ($has_negative and !@rrd_negatives) # Push "global" headers... 651 { 732 if ($has_negative and !@rrd_negatives) { # Push "global" headers... 652 733 push (@rrd, "COMMENT:" . (" " x $max_field_len)); 653 734 push (@rrd, "COMMENT:Cur (-/+)"); … … 655 736 push (@rrd, "COMMENT:Avg (-/+)"); 656 737 push (@rrd, "COMMENT:Max (-/+) \\j"); 657 } 658 elsif ($global_headers == 1) 659 { 738 } elsif ($global_headers == 1) { 660 739 push (@rrd, "COMMENT:" . (" " x $max_field_len)); 661 740 push (@rrd, "COMMENT: Cur$RRDkludge:"); … … 666 745 } 667 746 668 push (@rrd, ($node->{client}->{$service}->{$field.".draw"} || "LINE2") . 669 ":g$rrdname" . 670 ($single_value ? $single_colour : $COLOUR[$field_count++%@COLOUR]) . ":" . 747 my $colour; 748 749 if (exists $node->{client}->{$service}->{$field.".colour"}) { 750 $colour = "#". 751 $node->{client}->{$service}->{$field.".colour"}; 752 } elsif ($single_value) { 753 $colour = $single_colour; 754 } else { 755 $colour = $COLOUR[$field_count%@COLOUR]; 756 } 757 758 $field_count++; 759 760 push (@rrd, $fielddraw . ":g$rrdname" . $colour . ":" . 671 761 (escape ($node->{client}->{$service}->{"$field.label"}) || escape ($field)) 672 762 . (" " x ($max_field_len + 1 - 673 763 length ($node->{client}->{$service}->{"$field.label"} || $field)))); 674 764 675 # Check for negative fields (typically network traffic) 676 if ($has_negative) 677 { 765 # Check for negative fields (typically network (or disk) traffic) 766 if ($has_negative) { 678 767 my $negfield = &orig_to_cdef ($node->{client}->{$service}, $node->{client}->{$service}->{$field.".negative"}); 679 768 print "DEBUG: negfield = $negfield\n" if $DEBUG; 680 if (exists $node->{client}->{$service}->{$negfield.".realname"}) 681 { 769 if (exists $node->{client}->{$service}->{$negfield.".realname"}) { 682 770 $negfield = $node->{client}->{$service}->{$negfield.".realname"}; 683 771 } 684 772 685 if (!@rrd_negatives) # zero-line, to redraw zero afterwards.686 {773 if (!@rrd_negatives) { 774 # zero-line, to redraw zero afterwards. 687 775 push (@rrd_negatives, "CDEF:re_zero=g$negfield,UN,0,0,IF"); 688 776 } … … 690 778 push (@rrd_negatives, "CDEF:ng$negfield=g$negfield,-1,*"); 691 779 692 if ($single_value) # Only one field. Do min/max range. 693 { 694 push (@rrd, "CDEF:neg_min_max_diff=i$negfield,a$negfield,-"); 695 push (@rrd, "CDEF:ni$negfield=i$negfield,-1,*"); 696 push (@rrd, "AREA:ni$negfield#ffffff"); 697 push (@rrd, "STACK:neg_min_max_diff$range_colour"); 698 } 699 700 push (@rrd_negatives, ($node->{client}->{$service}->{$negfield.".draw"} || "LINE2") . 701 ":ng$negfield" . 702 ((defined $single_value and $single_value) ? $single_colour : $COLOUR[($field_count-1)%@COLOUR])); 780 if ($single_value) { 781 # Only one field. Do min/max range. 782 push (@rrd, "CDEF:neg_min_max_diff=i$negfield,a$negfield,-"); 783 push (@rrd, "CDEF:ni$negfield=i$negfield,-1,*"); 784 push (@rrd, "AREA:ni$negfield#ffffff"); 785 push (@rrd, "STACK:neg_min_max_diff$range_colour"); 786 } 787 788 push (@rrd_negatives, $fielddraw . ":ng$negfield" . $colour ); 703 789 704 790 # Draw HRULEs 705 791 my $linedef = munin_get ($config, "line", undef, $domain, $name, $service, $node->{client}->{$service}->{$field.".negative"}); 706 if ($linedef) 707 { 708 my ($number, $colour, $label) = split (/:/, $linedef, 3); 792 if ($linedef) { 793 my ($number, $ldcolour, $label) = split (/:/, $linedef, 3); 709 794 push (@rrd_negatives, "HRULE:".$number. 710 ($colour ? "#$colour" : 711 ((defined $single_value and $single_value) ? "#ff0000" : $COLOUR[($field_count-1)%@COLOUR])) 712 ); 713 } 714 elsif ($node->{client}->{$service}->{"$negfield.warn"}) 715 { 795 ($ldcolour ? "#$ldcolour" : $colour)); 796 797 } elsif ($node->{client}->{$service}->{"$negfield.warn"}) { 716 798 push (@rrd_negatives, "HRULE:".$node->{client}->{$service}->{$node->{client}->{$service}->{$field.".negative"}.".warn"}. 717 ((defined $single_value and $single_value) ? "#ff0000" : $COLOUR[($field_count-1)%@COLOUR]));718 } 719 720 push (@rrd, "GPRINT:c$negfield:LAST: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "/\\g");721 push (@rrd, "GPRINT:c$rrdname:LAST: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "");722 push (@rrd, "GPRINT:i$negfield:MIN: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "/\\g");723 push (@rrd, "GPRINT:i$rrdname:MIN: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "");724 push (@rrd, "GPRINT:g$negfield:AVERAGE: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "/\\g");725 push (@rrd, "GPRINT:g$rrdname:AVERAGE: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "");726 push (@rrd, "GPRINT:a$negfield:MAX: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "/\\g");727 push (@rrd, "GPRINT:a$rrdname:MAX: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "\\j");799 (defined $single_value and $single_value) ? "#ff0000" : $colour); 800 } 801 802 push (@rrd, "GPRINT:c$negfield:LAST:$rrdformat" . $rrdscale . "/\\g"); 803 push (@rrd, "GPRINT:c$rrdname:LAST:$rrdformat" . $rrdscale . ""); 804 push (@rrd, "GPRINT:i$negfield:MIN:$rrdformat" . $rrdscale . "/\\g"); 805 push (@rrd, "GPRINT:i$rrdname:MIN:$rrdformat" . $rrdscale . ""); 806 push (@rrd, "GPRINT:g$negfield:AVERAGE:$avgformat" . $rrdscale . "/\\g"); 807 push (@rrd, "GPRINT:g$rrdname:AVERAGE:$avgformat" . $rrdscale . ""); 808 push (@rrd, "GPRINT:a$negfield:MAX:$rrdformat" . $rrdscale . "/\\g"); 809 push (@rrd, "GPRINT:a$rrdname:MAX:$rrdformat" . $rrdscale . "\\j"); 728 810 push (@{$total_pos{'min'}}, "i$rrdname"); 729 811 push (@{$total_pos{'avg'}}, "g$rrdname"); … … 732 814 push (@{$total_neg{'avg'}}, "g$negfield"); 733 815 push (@{$total_neg{'max'}}, "a$negfield"); 734 } 735 else 736 { 816 } else { 737 817 push (@rrd, "COMMENT: Cur$RRDkludge:") unless $global_headers; 738 push (@rrd, "GPRINT:c$rrdname:LAST: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, "yes")?"%s":""). "");818 push (@rrd, "GPRINT:c$rrdname:LAST:$rrdformat" . $rrdscale . ""); 739 819 push (@rrd, "COMMENT: Min$RRDkludge:") unless $global_headers; 740 push (@rrd, "GPRINT:i$rrdname:MIN: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "");820 push (@rrd, "GPRINT:i$rrdname:MIN:$rrdformat" . $rrdscale . ""); 741 821 push (@rrd, "COMMENT: Avg$RRDkludge:") unless $global_headers; 742 push (@rrd, "GPRINT:g$rrdname:AVERAGE: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "");822 push (@rrd, "GPRINT:g$rrdname:AVERAGE:$avgformat" . $rrdscale . ""); 743 823 push (@rrd, "COMMENT: Max$RRDkludge:") unless $global_headers; 744 push (@rrd, "GPRINT:a$rrdname:MAX: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "\\j");824 push (@rrd, "GPRINT:a$rrdname:MAX:$rrdformat" . $rrdscale . "\\j"); 745 825 push (@{$total_pos{'min'}}, "i$rrdname"); 746 826 push (@{$total_pos{'avg'}}, "g$rrdname"); … … 748 828 } 749 829 750 751 830 # Draw HRULEs 752 831 my $linedef = munin_get ($config, "line", undef, $domain, $name, $service, $field); 753 if ($linedef) 754 { 755 my ($number, $colour, $label) = split (/:/, $linedef, 3); 832 if ($linedef) { 833 my ($number, $ldcolour, $label) = split (/:/, $linedef, 3); 756 834 $label =~ s/:/\\:/g if defined $label; 757 835 push (@rrd, "HRULE:".$number. 758 ($colour ? "#$colour" : 759 ((defined $single_value and $single_value) ? "#ff0000" : $COLOUR[($field_count-1)%@COLOUR])) . 760 ((defined $label and length ($label)) ? ":$label" : ""), 836 ($ldcolour ? "#$ldcolour" : 837 ((defined $single_value and $single_value) ? 838 "#ff0000" : $colour)). 839 ((defined $label and length ($label)) ? ":$label" : ""), 761 840 "COMMENT: \\j" 762 841 ); 763 } 764 elsif ($node->{client}->{$service}->{"$field.warn"}) 765 { 766 push (@rrd, "HRULE:".$node->{client}->{$service}->{"$field.warn"}.($single_value ? "#ff0000" : $COLOUR[($field_count-1)%@COLOUR])); 767 } 768 } 769 770 if (@rrd_negatives) 771 { 842 } elsif ($node->{client}->{$service}->{"$field.warn"}) { 843 push (@rrd,"HRULE:". 844 $node->{client}->{$service}->{"$field.warn"}. 845 ($single_value ? "#ff0000" : $colour)); 846 } 847 } 848 849 if (@rrd_negatives) { 772 850 push (@rrd, @rrd_negatives); 773 851 push (@rrd, "LINE2:re_zero#000000"); # Redraw zero. 774 if (exists $node->{client}->{$service}->{graph_total} and 775 exists $total_pos{'min'} and exists $total_neg{'min'} and776 @{$total_pos{'min'}} and @{$total_neg{'min'}})777 { 852 if (exists $node->{client}->{$service}->{graph_total} and 853 exists $total_pos{'min'} and exists $total_neg{'min'} and 854 @{$total_pos{'min'}} and @{$total_neg{'min'}}) { 855 778 856 push (@rrd, "CDEF:ipostotal=".join (",", map { "$_,UN,0,$_,IF" } @{$total_pos{'min'}}).(",+" x (@{$total_pos{'min'}}-1))); 779 857 push (@rrd, "CDEF:gpostotal=".join (",", map { "$_,UN,0,$_,IF" } @{$total_pos{'avg'}}).(",+" x (@{$total_pos{'avg'}}-1))); … … 784 862 push (@rrd, "CDEF:dpostotal=ipostotal,UN,ipostotal,UNKN,IF"); 785 863 push (@rrd, "LINE1:dpostotal#000000:" . $node->{client}->{$service}->{graph_total} . (" " x ($max_field_len - length ($node->{client}->{$service}->{graph_total}) + 1))); 786 push (@rrd, "GPRINT:gnegtotal:LAST:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "/\\g"); 787 push (@rrd, "GPRINT:gpostotal:LAST:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . ""); 788 push (@rrd, "GPRINT:inegtotal:MIN:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "/\\g"); 789 push (@rrd, "GPRINT:ipostotal:MIN:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . ""); 790 push (@rrd, "GPRINT:gnegtotal:AVERAGE:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "/\\g"); 791 push (@rrd, "GPRINT:gpostotal:AVERAGE:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . ""); 792 push (@rrd, "GPRINT:anegtotal:MAX:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "/\\g"); 793 push (@rrd, "GPRINT:apostotal:MAX:%6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") . "\\j"); 794 } 795 } 796 elsif (exists $node->{client}->{$service}->{graph_total} and exists $total_pos{'min'} and @{$total_pos{'min'}}) 797 { 864 push (@rrd, "GPRINT:gnegtotal:LAST:$rrdformat" . $rrdscale . "/\\g"); 865 push (@rrd, "GPRINT:gpostotal:LAST:$rrdformat" . $rrdscale . ""); 866 push (@rrd, "GPRINT:inegtotal:MIN:$rrdformat" . $rrdscale . "/\\g"); 867 push (@rrd, "GPRINT:ipostotal:MIN:$rrdformat" . $rrdscale . ""); 868 push (@rrd, "GPRINT:gnegtotal:AVERAGE:$avgformat" . $rrdscale . "/\\g"); 869 push (@rrd, "GPRINT:gpostotal:AVERAGE:$avgformat" . $rrdscale . ""); 870 push (@rrd, "GPRINT:anegtotal:MAX:$rrdformat" . $rrdscale . "/\\g"); 871 push (@rrd, "GPRINT:apostotal:MAX:$rrdformat" . $rrdscale . "\\j"); 872 } 873 } 874 elsif (exists $node->{client}->{$service}->{graph_total} and exists $total_pos{'min'} and @{$total_pos{'min'}}) { 798 875 push (@rrd, "CDEF:ipostotal=".join (",", map { "$_,UN,0,$_,IF" } @{$total_pos{'min'}}).(",+" x (@{$total_pos{'min'}}-1))); 799 876 push (@rrd, "CDEF:gpostotal=".join (",", map { "$_,UN,0,$_,IF" } @{$total_pos{'avg'}}).(",+" x (@{$total_pos{'avg'}}-1))); 800 877 push (@rrd, "CDEF:apostotal=".join (",", map { "$_,UN,0,$_,IF" } @{$total_pos{'max'}}).(",+" x (@{$total_pos{'max'}}-1))); 801 878 802 879 push (@rrd, "CDEF:dpostotal=ipostotal,UN,ipostotal,UNKN,IF"); 803 880 push (@rrd, "LINE1:dpostotal#000000:" . $node->{client}->{$service}->{graph_total} . (" " x ($max_field_len - length ($node->{client}->{$service}->{graph_total}) + 1))); 804 881 push (@rrd, "COMMENT: Cur$RRDkludge:") unless $global_headers; 805 push (@rrd, "GPRINT:gpostotal:LAST: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "");882 push (@rrd, "GPRINT:gpostotal:LAST:$rrdformat" . $rrdscale . ""); 806 883 push (@rrd, "COMMENT: Min$RRDkludge:") unless $global_headers; 807 push (@rrd, "GPRINT:ipostotal:MIN: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "");884 push (@rrd, "GPRINT:ipostotal:MIN:$rrdformat" . $rrdscale . ""); 808 885 push (@rrd, "COMMENT: Avg$RRDkludge:") unless $global_headers; 809 push (@rrd, "GPRINT:gpostotal:AVERAGE: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":"") ."");886 push (@rrd, "GPRINT:gpostotal:AVERAGE:$avgformat" . $rrdscale .""); 810 887 push (@rrd, "COMMENT: Max$RRDkludge:") unless $global_headers; 811 push (@rrd, "GPRINT:apostotal:MAX: %6.2lf" . (munin_get_bool_val ($node->{client}->{$service}->{graph_scale}, 1)?"%s":""). "\\j");888 push (@rrd, "GPRINT:apostotal:MAX:$rrdformat" . $rrdscale . "\\j"); 812 889 } 813 890 814 891 for my $time (keys %times) { 815 892 next unless ($draw{$time}); 816 my @complete; 893 my @complete = (); 894 if ($RRDkludge) { 895 push (@complete, 896 '--font' ,'LEGEND:7:@@LIBDIR@@/VeraMono.ttf', 897 '--font' ,'UNIT:7:@@LIBDIR@@/VeraMono.ttf', 898 '--font' ,'AXIS:7:@@LIBDIR@@/VeraMono.ttf'); 899 } 900 817 901 logger ("Processing $name -> $time") if $DEBUG; 818 902 819 903 # Do the header (title, vtitle, size, etc...) 820 904 push @complete, @{&get_header ($node, $config, $domain, $name, $service, $time)}; 905 if ($LINEkluge) { 906 @rrd = map { s/LINE3:/LINE2.2:/; $_; } @rrd; 907 @rrd = map { s/LINE2:/LINE1.6:/; $_; } @rrd; 908 # LINE1 is thin enough. 909 } 821 910 push @complete, @rrd; 822 911 823 push (@complete, "COMMENT:Last update$RRDkludge: " . RRDescape(scalar localtime($lastupdate)) . "\\r"); 824 825 if (time - 300 < $lastupdate) 826 { 827 push @complete, "--end",(int($lastupdate/$resolutions{$time}))*$resolutions{$time}; 828 } 829 print "\n\nrrdtool \"graph\" \"", join ("\"\n\t\"",@complete), "\"\n" if $DEBUG; 912 push (@complete, "COMMENT:Last update$RRDkludge: " . 913 RRDescape(scalar localtime($lastupdate)) . "\\r"); 914 915 if (time - 300 < $lastupdate) { 916 push @complete, "--end", 917 (int($lastupdate/$resolutions{$time}))*$resolutions{$time}; 918 } 919 print "\n\nrrdtool \"graph\" \"", 920 join ("\"\n\t\"",@complete), "\"\n" if $DEBUG; 830 921 RRDs::graph (@complete); 831 922 if (my $ERROR = RRDs::error) { 832 923 logger ("Unable to graph $filename: $ERROR"); 833 } 834 elsif ($list_images) # Command-line option to list images created 835 { 836 print &munin_get_picture_filename ($config, $domain, $name, $service, $time), "\n"; 837 } 838 } 839 840 if (&munin_get_bool_val ($node->{client}->{$service}->{"graph_sums"}, 0)) 841 { 842 foreach my $time (keys %sumtimes) 843 { 924 } elsif ($list_images) { 925 # Command-line option to list images created 926 print &munin_get_picture_filename ($config, $domain, $name, 927 $service, $time),"\n"; 928 } 929 } 930 931 if (&munin_get_bool_val ($node->{client}->{$service}->{"graph_sums"}, 0)) { 932 foreach my $time (keys %sumtimes) { 844 933 next unless ($draw{"sum".$time}); 845 934 my @rrd_sum; 846 935 push @rrd_sum, @{&get_header ($node, $config, $domain, $name, $service, $time, 1)}; 847 936 848 if (time - 300 < $lastupdate) 849 { 850 push @rrd_sum, "--end",(int($lastupdate/$resolutions{$time}))*$resolutions{$time}; 937 if (time - 300 < $lastupdate) { 938 push @rrd_sum, "--end",(int($lastupdate/$resolutions{$time}))*$resolutions{$time}; 851 939 } 852 940 push @rrd_sum, @rrd; … … 855 943 my $labelled = 0; 856 944 my @defined = (); 857 for (my $index = 0; $index <= $#rrd_sum; $index++) 858 { 859 if ($rrd_sum[$index] =~ /^(--vertical-label|-v)$/) 860 { 945 for (my $index = 0; $index <= $#rrd_sum; $index++) { 946 if ($rrd_sum[$index] =~ /^(--vertical-label|-v)$/) { 861 947 (my $label = $node->{client}->{$service}->{graph_vlabel}) =~ s/\$\{graph_period\}/$sumtimes{$time}[0]/g; 862 948 splice (@rrd_sum, $index, 2, ("--vertical-label", $label)); 863 949 $index++; 864 950 $labelled++; 865 } 866 elsif ($rrd_sum[$index] =~ /^(LINE[123]|STACK|AREA|GPRINT):([^#:]+)([#:].+)$/) 867 { 951 } elsif ($rrd_sum[$index] =~ /^(LINE[123]|STACK|AREA|GPRINT):([^#:]+)([#:].+)$/) { 868 952 my ($pre, $fname, $post) = ($1, $2, $3); 869 953 next if $fname eq "re_zero"; 870 if ($post =~ /^:AVERAGE/) 871 { 954 if ($post =~ /^:AVERAGE/) { 872 955 splice (@rrd_sum, $index, 1, $pre . ":x$fname" . $post); 873 956 $index++; … … 878 961 my @replace; 879 962 880 if (!defined ($node->{client}->{$service}->{$fname.".type"}) or $node->{client}->{$service}->{$fname.".type"} ne "GAUGE")881 {882 if ($time eq "week") 883 {# Every plot is half an hour. Add two plots and multiply, to get per hour884 if (graph_by_minute ($config, $domain, $name, $service)) 885 {# Already multiplied by 60963 if (!defined ($node->{client}->{$service}->{$fname.".type"}) or 964 $node->{client}->{$service}->{$fname.".type"} ne "GAUGE") { 965 if ($time eq "week") { 966 # Every plot is half an hour. Add two plots and multiply, to get per hour 967 if (graph_by_minute ($config, $domain, $name, $service)) { 968 # Already multiplied by 60 886 969 push @replace, "CDEF:x$fname=PREV($fname),UN,0,PREV($fname),IF,$fname,+,5,*,6,*"; 887 } 888 else 889 { 970 } else { 890 971 push @replace, "CDEF:x$fname=PREV($fname),UN,0,PREV($fname),IF,$fname,+,300,*,6,*"; 891 972 } 892 } 893 else 894 { # Every plot is one day exactly. Just multiply. 895 if (graph_by_minute ($config, $domain, $name, $service)) 896 { # Already multiplied by 60 973 } else { 974 # Every plot is one day exactly. Just multiply. 975 if (graph_by_minute ($config, $domain, $name, $service)) { 976 # Already multiplied by 60 897 977 push @replace, "CDEF:x$fname=$fname,5,*,288,*"; 898 } 899 else 900 { 978 } else { 901 979 push @replace, "CDEF:x$fname=$fname,300,*,288,*"; 902 980 } … … 906 984 splice (@rrd_sum, $index, 1, @replace); 907 985 $index++; 908 } 909 elsif ($rrd_sum[$index] =~ /^(--lower-limit|--upper-limit|-l|-u)$/) 910 { 986 } elsif ($rrd_sum[$index] =~ /^(--lower-limit|--upper-limit|-l|-u)$/) { 911 987 $index++; 912 988 $rrd_sum[$index] = $rrd_sum[$index] * 300 * $sumtimes{$time}->[1]; 913 989 } 914 990 } 915 unless ($labelled) 916 {991 992 unless ($labelled) { 917 993 my $label = $node->{client}->{$service}->{"graph_vlabel_sum_$time"} || $sumtimes{$time}->[0]; 918 994 unshift @rrd_sum, "--vertical-label", $label; … … 921 997 print "\n\nrrdtool \"graph\" \"", join ("\"\n\t\"",@rrd_sum), "\"\n" if $DEBUG; 922 998 RRDs::graph (@rrd_sum); 999 923 1000 if (my $ERROR = RRDs::error) { 924 1001 logger ("Unable to graph $filename: $ERROR"); 925 } 926 elsif ($list_images) # Command-line option to list images created 927 { 1002 } elsif ($list_images) { 1003 # Command-line option to list images created 928 1004 print &munin_get_picture_filename ($config, $domain, $name, $service, $time, 1), "\n"; 929 1005 } … … 935 1011 print STATS "GS|$domain|$name|$service|$service_time\n" unless $skip_stats; 936 1012 937 foreach (@added) 938 {939 delete $node->{client}->{$service}->{$_}if exists $node->{client}->{$service}->{$_};1013 foreach (@added) { 1014 delete $node->{client}->{$service}->{$_} 1015 if exists $node->{client}->{$service}->{$_}; 940 1016 } 941 1017 @added = (); 942 1018 } 943 944 } 945 946 sub graph_by_minute 947 { 1019 } 1020 1021 sub graph_by_minute { 948 1022 my $config = shift; 949 1023 my $domain = shift; … … 954 1028 } 955 1029 956 sub orig_to_cdef 957 { 1030 sub orig_to_cdef { 958 1031 my $service = shift; 959 1032 my $field = shift; … … 966 1039 } 967 1040 968 sub set_cdef_name 969 { 1041 sub set_cdef_name { 970 1042 my $service = shift; 971 1043 my $field = shift; … … 976 1048 } 977 1049 978 sub skip_service 979 { 1050 sub skip_service { 980 1051 my $node = shift; 981 1052 my $service = shift; … … 996 1067 } 997 1068 998 sub expand_cdef 999 { 1069 sub expand_cdef { 1000 1070 my $service = shift; 1001 1071 my $cfield_ref = shift; … … 1184 1254 about any off-limit values. 1185 1255 1186 munin-graph does the graphing. It is usually only used from within munin-cron. 1256 munin-graph does the graphing. It is usually only used from within 1257 munin-cron. If munin.conf sets "graph_strategy cgi" then munin-graph 1258 does no work, instead munin-html generates references to the graphing 1259 CGI. Please see http://munin.projects.linpro.no/wiki/CgiHowto for 1260 more information about CGI grpahing. 1187 1261 1188 1262 It checks the rrd-files for updated values, and redraws the graphs if 1189 1263 needed. To force redrawing of graphs (after setup-changes et alia), use 1190 '--nolazy'. 1264 '--nolazy'. 1191 1265 1192 1266 =head1 FILES … … 1197 1271 @@STATEDIR@@/* 1198 1272 1199 =head1 VERSION1200 1201 This is munin-graph version 0.9.2-31202 1203 1273 =head1 AUTHORS 1204 1274 1205 Audun Ytterdal and Jimmy Olsen.1275 Audun Ytterdal, Jimmy Olsen, Tore Anderson, Nicolai Langfeldt. 1206 1276 1207 1277 =head1 BUGS … … 1213 1283 =head1 COPYRIGHT 1214 1284 1215 Copyright © 2002-2004 Audun Ytterdal, Jimmy Olsen, and Tore Anderson / Linpro AS.1285 Copyright (C) 2002-2006 Audun Ytterdal, Jimmy Olsen, Tore Anderson, and Nicolai Langfeldt 1216 1286 1217 1287 This is free software; see the source for copying conditions. There is people/ilmari/modularisation-branch/server/munin-html.in
r1012 r1265 1 1 #!@@PERL@@ 2 # -*- perl -*- 2 3 # 3 # Copyright (C) 2002-200 4Jimmy Olsen, Audun Ytterdal4 # Copyright (C) 2002-2006 Jimmy Olsen, Audun Ytterdal 4 5 # 5 6 # This program is free software; you can redistribute it and/or … … 25 26 use HTML::Template; 26 27 use Getopt::Long; 28 use Time::HiRes; 27 29 use Munin; 28 30 use POSIX qw(strftime); 29 31 30 32 my @times = ( "day", "week", "month", "year" ); 31 32 33 33 34 my $DEBUG=0; … … 41 42 42 43 # Get options 43 $do_usage=1 unless 44 $do_usage=1 unless 44 45 GetOptions ( "host=s" => \(), 45 46 "force-root!" => \$force_root, … … 75 76 Written by Knut Haugen, Audun Ytterdal, Jimmy Olsen, Tore Anderson / Linpro AS 76 77 77 Copyright (C) 2002-200 578 Copyright (C) 2002-2006 78 79 79 80 This is free software released under the GNU General Public License. There … … 93 94 exit (1); 94 95 } 96 97 my $update_time = Time::HiRes::time; 95 98 96 99 my $config; … … 139 142 my @domainorder; 140 143 if ($config->{domain_order}) { 141 @domainorder = split / /, $config->{domain_order};144 @domainorder = split /\s+/, $config->{domain_order}; 142 145 } 143 146 foreach my $d (sort (keys %{$config->{domain}})) { … … 165 168 my $timestamp = strftime("%Y-%m-%d T %T", localtime); 166 169 for my $domain (@domainorder) { 167 logger("processing domain: $domain"); 168 my %domain; 169 $domain{domain}=$domain; 170 my @nodes; 171 my %comparisons; 172 my @nodeorder = (); 173 if ($config->{domain}->{$domain}->{node_order}) { 174 @nodeorder = split / /, $config->{domain}->{$domain}->{node_order}; 175 } 176 foreach my $n (sort (keys %{$config->{domain}->{$domain}->{node}})) 177 { 178 unless (grep (/^$n$/, @nodeorder)) 179 { 180 push @nodeorder, $n; 181 } 182 } 183 for my $node (@nodeorder) { 184 logger("processing node: $node"); 185 my %node; 186 $node{node}=$node; 187 $node{url}="$domain/$node.html"; 188 my @services; 189 my @categories; 190 my %categories; 191 my %tmp_cats; 192 my @serviceorder; 193 if ($config->{domain}->{$domain}->{node}->{$node}->{service_order}) { 194 @serviceorder = split / /, $config->{domain}->{$domain}->{node}->{$node}->{service_order}; 170 logger("processing domain: $domain"); 171 my %domain; 172 $domain{domain}=$domain; 173 my @nodes; 174 my %comparisons; 175 my @nodeorder = (); 176 if ($config->{domain}->{$domain}->{node_order}) { 177 @nodeorder = split /\s+/, $config->{domain}->{$domain}->{node_order}; 178 } 179 foreach my $n (sort (keys %{$config->{domain}->{$domain}->{node}})) { 180 unless (grep (/^$n$/, @nodeorder)) { 181 push @nodeorder, $n; 182 } 183 } 184 for my $node (@nodeorder) { 185 logger("processing node: $node"); 186 my %node; 187 $node{node}=$node; 188 $node{url}="$domain/$node.html"; 189 my @services; 190 my @categories; 191 my %categories; 192 my %tmp_cats; 193 my @serviceorder; 194 if ($config->{domain}->{$domain}->{node}->{$node}->{service_order}) { 195 @serviceorder = split /\s+/, 196 $config->{domain}->{$domain}->{node}->{$node}->{service_order}; 197 } else { 198 @serviceorder = sort 199 keys %{$config->{domain}->{$domain}->{node}->{$node}->{client}}; 200 } 201 202 for my $service (@serviceorder) { 203 logger("processing service: $service"); 204 next unless 205 defined($config->{domain}->{$domain}->{node}->{$node}->{client}->{$service} ) 206 && $config->{domain}->{$domain}->{node}->{$node}->{client}->{$service} ne ""; 207 208 next unless 209 munin_get_bool ($config, "graph", 1, $domain, $node, $service); 210 211 my @service; 212 my %service; 213 my $fieldnum = 0; 214 my @graph_info; 215 my @field_info; 216 $service{service}=$service; 217 $service{label}= 218 $config->{domain}->{$domain}->{node}->{$node}->{client}-> 219 {$service}->{graph_title}; 220 221 my $method = &munin_get ($config, "graph_strategy", "cron"); 222 if ($method eq "cgi") { 223 $service{imgday}=$config->{'cgiurl_graph'}. 224 "/$domain/$node/$service-day.png"; 225 $service{imgweek}=$config->{'cgiurl_graph'}. 226 "/$domain/$node/$service-week.png"; 227 $service{imgmonth}=$config->{'cgiurl_graph'}. 228 "/$domain/$node/$service-month.png"; 229 $service{imgyear}=$config->{'cgiurl_graph'}. 230 "/$domain/$node/$service-year.png"; 231 232 if (&munin_get_bool_val($config->{domain}->{$domain}-> 233 {node}->{$node}-> 234 {client}->{$service}->{"graph_sums"}, 0)) { 235 $service{imgweeksum} = 236 $config->{'cgiurl_graph'}."/$domain/$node/$service-week-sum.png"; 237 $service{imgyearsum} = 238 $config->{'cgiurl_graph'}."/$domain/$node/$service-year-sum.png"; 239 } 240 241 # There is a disturbance in the force here, the sizes are off. 242 # if (my ($w, $h) = 243 # &calculate_png_size ($config, $domain, $node, $service)) { 244 # for my $scale (@times) { 245 # $service{"img".$scale."width"} = $w; 246 # $service{"img".$scale."height"} = $h; 247 # } 248 # if (&munin_get_bool_val($config->{domain}->{$domain}-> 249 # {node}->{$node}-> 250 # {client}->{$service}->{"graph_sums"}, 0)) { 251 # for my $scale (["week", "year"]) { 252 # $service{"img".$scale."sumwidth"} = $w; 253 # $service{"img".$scale."sumheight"} = $h; 254 # } 255 # } 256 # } 257 } else { 258 # graph strategy cron 259 $service{imgday}="$node-$service-day.png"; 260 $service{imgweek}="$node-$service-week.png"; 261 $service{imgmonth}="$node-$service-month.png"; 262 $service{imgyear}="$node-$service-year.png"; 263 264 for my $scale (@times) { 265 if (my ($w, $h) = 266 &get_png_size(&munin_get_picture_filename($config, $domain, 267 $node, $service, 268 $scale))) { 269 $service{"img".$scale."width"} = $w; 270 $service{"img".$scale."height"} = $h; 271 } 272 } 273 274 if (&munin_get_bool_val ($config->{domain}->{$domain}-> 275 {node}->{$node}->{client}-> 276 {$service}->{"graph_sums"}, 0)) { 277 $service{imgweeksum} = "$node-$service-week-sum.png"; 278 $service{imgyearsum} = "$node-$service-year-sum.png"; 279 for my $scale (["week", "year"]) { 280 if (my ($w, $h) = 281 &get_png_size (&munin_get_picture_filename($config,$domain, 282 $node, $service, 283 $scale, 1))) { 284 $service{"img".$scale."sumwidth"} = $w; 285 $service{"img".$scale."sumheight"} = $h; 286 } 287 } 288 } 289 } 290 $service{url}="$node-$service.html"; 291 $service{domain}="$domain"; 292 $service{node}=$node; 293 $service{category}= lc( $config->{domain}->{$domain}-> 294 {node}->{$node}->{client}-> 295 {$service}->{graph_category} || "other" ); 296 297 # Do "help" section 298 if (defined($config->{domain}->{$domain}-> 299 {node}->{$node}-> 300 {client}->{$service}->{graph_info})) { 301 my %graph_info; 302 303 $graph_info{info} = $config->{domain}->{$domain}-> 304 {node}->{$node}->{client}->{$service}->{graph_info}; 305 306 push @{$service{graphinfo}}, \%graph_info; 307 } 308 309 $service{fieldlist} .= "<tr><th align='left' valign='top'>Field</th><th align='left' valign='top'>Type</th><th align='left' valign='top'>Warn</th><th align='left' valign='top'>Crit</th><th></tr>"; 310 # foreach my $field (keys %{$config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}}) 311 foreach my $f (@{&munin_get_field_order ($config->{domain}->{$domain}->{node}->{$node}, $config, $domain, $node, $service)}) { 312 $f =~ s/=(.*)$//; 313 my $path = $1; 314 next unless &munin_draw_field ($config->{domain}->{$domain}-> 315 {node}->{$node}, $service, $f); 316 317 print "DEBUG: single_value: Checking field \"$f\" ($path).\n" 318 if $DEBUG; 319 320 if (defined $path) { 321 # HUH? Get the filename and then forget? Some side effect here? 322 munin_get_rrd_filename ($config->{domain}->{$domain}-> 323 {node}->{$node}, $config, $domain, 324 $node, $service, $f, $path); 325 } 326 327 my %field_info; 328 $fieldnum++; 329 330 $field_info{'hr'} = 1 unless ($fieldnum % 3); 331 $field_info{'field'} = $f; 332 $field_info{'label'} = $config->{domain}->{$domain}-> 333 {node}->{$node}->{client}->{$service}->{$f.".label"} || $f; 334 335 $field_info{'type'} = lc( $config->{domain}->{$domain}-> 336 {node}->{$node}->{client}->{$service}-> 337 {$f.".type"} || "GAUGE" ); 338 339 $field_info{'warn'} = $config->{domain}->{$domain}-> 340 {node}->{$node}->{client}->{$service}->{$f.".warning"} || "None"; 341 $field_info{'crit'} = $config->{domain}->{$domain}-> 342 {node}->{$node}->{client}->{$service}->{$f.".critical"} || "None"; 343 $field_info{'info'} = $config->{domain}->{$domain}-> 344 {node}->{$node}->{client}->{$service}->{$f.".info"} || ""; 345 346 my $state = &munin_field_status ($config, $limits, $domain, 347 $node, $service, $f, 1); 348 349 if (defined $state) { 350 $field_info{'state_warning'} = 1 if $state eq "warning"; 351 $field_info{'state_critical'} = 1 if $state eq "critical"; 352 $field_info{'state_unknown'} = 1 if $state eq "unknown"; 353 } 354 push @{$service{fieldinfo}}, \%field_info; 355 } 356 357 { 358 my $state = &munin_service_status ($config, $limits, $domain, 359 $node, $service, 1); 360 if (defined $state) { 361 $service{'state_warning'} = 1 if $state eq "warning"; 362 $service{'state_critical'} = 1 if $state eq "critical"; 363 $service{'state_unknown'} = 1 if $state eq "unknown"; 364 } 365 } 366 367 push @services, \%service; 368 push @service, \%service; 369 push @{$tmp_cats{$service{'category'}}}, \%service; 370 $servicetemplate->param(SERVICES => \@service, 371 SERVICE => $service, 372 NODE => $node, 373 DOMAIN => $domain, 374 DOMAINS => \@domainlist, 375 TIMESTAMP => $timestamp); 376 open (FILE, ">$config->{htmldir}/$domain/$node-$service.html") or 377 die "Cannot open $config->{htmldir}/$domain/$node-$service.html"; 378 print FILE $servicetemplate->output; 379 close FILE; 380 } 381 foreach my $key (keys %tmp_cats) { 382 next if $key eq "other"; 383 my %tmp; 384 my $state = &munin_category_status ($config, $limits, $domain, 385 $node, $key, 1); 386 print "DEBUG: Pushing category \"$node\" -> \"$key\"...\n" if $DEBUG; 387 if (defined $state) { 388 $tmp{'state_warning'} = 1 if $state eq "warning"; 389 $tmp{'state_critical'} = 1 if $state eq "critical"; 390 $tmp{'state_unknown'} = 1 if $state eq "unknown"; 391 } 392 $tmp{name} = ucfirst $key; 393 $tmp{services} = \@{$tmp_cats{$key}}; 394 $tmp{node} = $node; 395 $tmp{domain} = $domain; 396 $categories{ucfirst $key} = \%tmp; 397 $comparisons{$key}{$node} = \%tmp; 398 } 399 if (defined $tmp_cats{'other'}) { 400 my $key = 'other'; 401 my %tmp; 402 my $state = &munin_category_status ($config, $limits, $domain, 403 $node, $key, 1); 404 print "DEBUG: Pushing category \"$node\" -> \"$key\"...\n" if $DEBUG; 405 if (defined $state) { 406 $tmp{'state_warning'} = 1 if $state eq "warning"; 407 $tmp{'state_critical'} = 1 if $state eq "critical"; 408 $tmp{'state_unknown'} = 1 if $state eq "unknown"; 409 } 410 $tmp{name} = ucfirst $key; 411 $tmp{services} = \@{$tmp_cats{$key}}; 412 $tmp{node} = $node; 413 $tmp{domain} = $domain; 414 $categories{ucfirst $key} = \%tmp; 415 $comparisons{'other'}{$node} = \%tmp; 416 } 417 # Handle category_order 418 @categories = (); 419 if ($config->{domain}->{$domain}->{node}->{$node}->{category_order}) { 420 foreach my $cat (split /\s+/, 421 $config->{domain}->{$domain}-> 422 {node}->{$node}->{category_order}) { 423 push @categories, $categories{ucfirst $cat}; 424 } 425 foreach my $cat (sort keys %categories) { 426 push @categories, $categories{$cat} 427 unless (grep { $_->{name} eq $cat } @categories); 428 } 429 } else { 430 @categories = map { $categories{$_} } sort keys %categories; 431 } 432 $nodetemplate->param(SERVICES => \@services, 433 NODE => $node, 434 DOMAIN => $domain, 435 DOMAINS => \@domainlist, 436 TIMESTAMP => $timestamp, 437 CATEGORIES => \@categories); 438 open (FILE, ">$config->{htmldir}/$domain/$node.html") or 439 die "Cannot open $config->{htmldir}/$domain/$node.html"; 440 print FILE $nodetemplate->output; 441 close FILE; 442 $node{services} = \@services; 443 $node{categories} = \@categories; 444 $node{domain} = $domain; 445 push @nodes,\%node; 446 447 } 448 $domaintemplate->param(NODES => \@nodes, 449 DOMAIN => $domain, 450 DOMAINS => \@domainlist, 451 COMPARE => (&munin_get_bool ($config, "compare", 1, 452 $domain) 453 and @nodeorder > 1), 454 TIMESTAMP => $timestamp); 455 open (FILE, ">$config->{htmldir}/$domain/index.html") or 456 die "Cannot open $config->{htmldir}/index.html"; 457 print FILE $domaintemplate->output; 458 close FILE; 459 460 $domain{nodes} = \@nodes; 461 $domain{domain} = $domain; 462 $domain{compare} = (&munin_get_bool ($config, "compare", 1, $domain) 463 and @nodeorder > 1); 464 465 my @cats = (); 466 foreach my $key (sort keys %comparisons) { 467 my %cat; 468 my %servlist; 469 my $nodewidth = 0; 470 471 foreach my $node (sort keys %{$comparisons{$key}}) { 472 foreach my $serv (@{$comparisons{$key}{$node}->{services}}) { 473 $servlist{$serv->{service}}{$node} = $serv; 474 $nodewidth = $serv->{imgdaywidth} 475 if (defined $serv->{imgdaywidth} 476 and $serv->{imgdaywidth} > $nodewidth); 477 } 478 } 479 foreach my $sname (sort keys %servlist) { 480 my %s; 481 foreach my $node (@nodeorder) { 482 if (defined $servlist{$sname}{$node}) { 483 $servlist{$sname}{$node}->{width} = $nodewidth; 484 push (@{$s{nodes}}, $servlist{$sname}{$node}); 195 485 } else { 196 @serviceorder = sort (keys %{$config->{domain}->{$domain}->{node}->{$node}->{client}}); 197 } 198 199 for my $service (@serviceorder) { 200 logger("processing service: $service"); 201 next unless defined( $config->{domain}->{$domain}->{node}->{$node}->{client}->{$service} ) 202 && $config->{domain}->{$domain}->{node}->{$node}->{client}->{$service} ne ""; 203 next unless (munin_get_bool ($config, "graph", 1, $domain, $node, $service)); 204 my @service; 205 my %service; 206 my $fieldnum = 0; 207 my @graph_info; 208 my @field_info; 209 $service{service}=$service; 210 $service{label}=$config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{graph_title}; 211 212 my $method = &munin_get ($config, "graph_strategy", "cron"); 213 if ($method eq "cgi") 214 { 215 $service{imgday}=$config->{'cgiurl_graph'}."/$domain/$node/$service-day.png"; 216 $service{imgweek}=$config->{'cgiurl_graph'}."/$domain/$node/$service-week.png"; 217 $service{imgmonth}=$config->{'cgiurl_graph'}."/$domain/$node/$service-month.png"; 218 $service{imgyear}=$config->{'cgiurl_graph'}."/$domain/$node/$service-year.png"; 219 220 if (&munin_get_bool_val ($config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{"graph_sums"}, 0)) 221 { 222 $service{imgweeksum} = $config->{'cgiurl_graph'}."/$domain/$node/$service-week-sum.png"; 223 $service{imgyearsum} = $config->{'cgiurl_graph'}."/$domain/$node/$service-year-sum.png"; 224 } 225 226 if (my ($w, $h) = &calculate_png_size ($config, $domain, $node, $service)) 227 { 228 for my $scale (@times) 229 { 230 $service{"img".$scale."width"} = $w; 231 $service{"img".$scale."height"} = $h; 232 } 233 if (&munin_get_bool_val ($config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{"graph_sums"}, 0)) 234 { 235 for my $scale (["week", "year"]) 236 { 237 $service{"img".$scale."sumwidth"} = $w; 238 $service{"img".$scale."sumheight"} = $h; 239 } 240 } 241 } 242 } 243 else 244 { 245 $service{imgday}="$node-$service-day.png"; 246 $service{imgweek}="$node-$service-week.png"; 247 $service{imgmonth}="$node-$service-month.png"; 248 $service{imgyear}="$node-$service-year.png"; 249 250 for my $scale (@times) 251 { 252 if (my ($w, $h) = &get_png_size (&munin_get_picture_filename ($config, $domain, $node, $service, $scale))) 253 { 254 $service{"img".$scale."width"} = $w; 255 $service{"img".$scale."height"} = $h; 256 } 257 } 258 259 if (&munin_get_bool_val ($config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{"graph_sums"}, 0)) 260 { 261 $service{imgweeksum} = "$node-$service-week-sum.png"; 262 $service{imgyearsum} = "$node-$service-year-sum.png"; 263 for my $scale (["week", "year"]) 264 { 265 if (my ($w, $h) = &get_png_size (&munin_get_picture_filename ($config, $domain, $node, $service, $scale, 1))) 266 { 267 $service{"img".$scale."sumwidth"} = $w; 268 $service{"img".$scale."sumheight"} = $h; 269 } 270 } 271 } 272 } 273 $service{url}="$node-$service.html"; 274 $service{domain}="$domain"; 275 $service{node}=$node; 276 $service{category}= $config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{graph_category} || "other"; 277 278 # Do "help" section 279 if (defined $config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{graph_info}) 280 { 281 my %graph_info; 282 $graph_info{info} = $config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{graph_info}; 283 push @{$service{graphinfo}}, \%graph_info; 284 } 285 $service{fieldlist} .= "<tr><th align='left' valign='top'>Field</th><th align='left' valign='top'>Type</th><th align='left' valign='top'>Warn</th><th align='left' valign='top'>Crit</th><th></tr>"; 286 # foreach my $field (keys %{$config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}}) 287 foreach my $f (@{&munin_get_field_order ($config->{domain}->{$domain}->{node}->{$node}, $config, $domain, $node, $service)}) 288 { 289 $f =~ s/=(.*)$//; 290 my $path = $1; 291 next unless (&munin_draw_field ($config->{domain}->{$domain}->{node}->{$node}, $service, $f)); 292 print "DEBUG: single_value: Checking field \"$f\" ($path).\n" if $DEBUG; 293 294 if (defined $path) 295 { 296 munin_get_rrd_filename ($config->{domain}->{$domain}->{node}->{$node}, $config, $domain, $node, $service, $f, $path); 297 } 298 299 my %field_info; 300 $fieldnum++; 301 302 $field_info{'hr'} = 1 unless ($fieldnum % 3); 303 $field_info{'field'} = $f; 304 $field_info{'label'} = $config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{$f.".label"} || $f; 305 $field_info{'type'} = lc ($config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{$f.".type"} || "GAUGE"); 306 $field_info{'warn'} = $config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{$f.".warning"} || "None"; 307 $field_info{'crit'} = $config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{$f.".critical"} || "None"; 308 $field_info{'info'} = $config->{domain}->{$domain}->{node}->{$node}->{client}->{$service}->{$f.".info"} || ""; 309 310 my $state = &munin_field_status ($config, $limits, $domain, $node, $service, $f, 1); 311 if (defined $state) 312 { 313 $field_info{'state_warning'} = 1 if $state eq "warning"; 314 $field_info{'state_critical'} = 1 if $state eq "critical"; 315 $field_info{'state_unknown'} = 1 if $state eq "unknown"; 316 } 317 push @{$service{fieldinfo}}, \%field_info; 318 } 319 320 { 321 my $state = &munin_service_status ($config, $limits, $domain, $node, $service, 1); 322 if (defined $state) 323 { 324 $service{'state_warning'} = 1 if $state eq "warning"; 325 $service{'state_critical'} = 1 if $state eq "critical"; 326 $service{'state_unknown'} = 1 if $state eq "unknown"; 327 } 328 } 329 330 push @services, \%service; 331 push @service, \%service; 332 push @{$tmp_cats{$service{'category'}}}, \%service; 333 $servicetemplate->param(SERVICES => \@service, 334 SERVICE => $service, 335 NODE => $node, 336 DOMAIN => $domain, 337 DOMAINS => \@domainlist, 338 TIMESTAMP => $timestamp); 339 open (FILE, ">$config->{htmldir}/$domain/$node-$service.html") or die "Cannot open $config->{htmldir}/$domain/$node-$service.html"; 340 print FILE $servicetemplate->output; 341 close FILE; 342 } 343 foreach my $key (keys %tmp_cats) 344 { 345 next if $key eq "other"; 346 my %tmp; 347 my $state = &munin_category_status ($config, $limits, $domain, $node, $key, 1); 348 print "DEBUG: Pushing category \"$node\" -> \"$key\"...\n" if $DEBUG; 349 if (defined $state) 350 { 351 $tmp{'state_warning'} = 1 if $state eq "warning"; 352 $tmp{'state_critical'} = 1 if $state eq "critical"; 353 $tmp{'state_unknown'} = 1 if $state eq "unknown"; 354 } 355 $tmp{name} = ucfirst $key; 356 $tmp{services} = \@{$tmp_cats{$key}}; 357 $tmp{node} = $node; 358 $tmp{domain} = $domain; 359 $categories{ucfirst $key} = \%tmp; 360 $comparisons{$key}{$node} = \%tmp; 361 } 362 if (defined $tmp_cats{'other'}) 363 { 364 my $key = 'other'; 365 my %tmp; 366 my $state = &munin_category_status ($config, $limits, $domain, $node, $key, 1); 367 print "DEBUG: Pushing category \"$node\" -> \"$key\"...\n" if $DEBUG; 368 if (defined $state) 369 { 370 $tmp{'state_warning'} = 1 if $state eq "warning"; 371 $tmp{'state_critical'} = 1 if $state eq "critical"; 372 $tmp{'state_unknown'} = 1 if $state eq "unknown"; 373 } 374 $tmp{name} = ucfirst $key; 375 $tmp{services} = \@{$tmp_cats{$key}}; 376 $tmp{node} = $node; 377 $tmp{domain} = $domain; 378 $categories{ucfirst $key} = \%tmp; 379 $comparisons{'other'}{$node} = \%tmp; 380 } 381 # Handle category_order 382 @categories = (); 383 if ($config->{domain}->{$domain}->{node}->{$node}->{category_order}) { 384 foreach my $cat (split /\s+/, $config->{domain}->{$domain}->{node}->{$node}->{category_order}) 385 { 386 push @categories, $categories{ucfirst $cat}; 387 } 388 foreach my $cat (sort keys %categories) 389 { 390 push @categories, $categories{$cat} 391 unless (grep { $_->{name} eq $cat } @categories); 392 } 393 } else { 394 @categories = map { $categories{$_} } sort keys %categories; 395 } 396 $nodetemplate->param(SERVICES => \@services, 397 NODE => $node, 398 DOMAIN => $domain, 399 DOMAINS => \@domainlist, 400 TIMESTAMP => $timestamp, 401 CATEGORIES => \@categories); 402 open (FILE, ">$config->{htmldir}/$domain/$node.html") or die "Cannot open $config->{htmldir}/$domain/$node.html"; 403 print FILE $nodetemplate->output; 404 close FILE; 405 $node{services} = \@services; 406 $node{categories} = \@categories; 407 $node{domain} = $domain; 408 push @nodes,\%node; 409 410 } 411 $domaintemplate->param(NODES => \@nodes, 412 DOMAIN => $domain, 413 DOMAINS => \@domainlist, 414 COMPARE => (&munin_get_bool ($config, "compare", 1, $domain) and @nodeorder > 1), 415 TIMESTAMP => $timestamp); 416 open (FILE, ">$config->{htmldir}/$domain/index.html") or die "Cannot open $config->{htmldir}/index.html"; 417 print FILE $domaintemplate->output; 418 close FILE; 419 420 $domain{nodes} = \@nodes; 421 $domain{domain} = $domain; 422 $domain{compare} = (&munin_get_bool ($config, "compare", 1, $domain) and @nodeorder > 1); 423 424 my @cats = (); 425 foreach my $key (sort keys %comparisons) 426 { 427 my %cat; 428 my %servlist; 429 my $nodewidth = 0; 430 431 foreach my $node (sort keys %{$comparisons{$key}}) 432 { 433 foreach my $serv (@{$comparisons{$key}{$node}->{services}}) 434 { 435 $servlist{$serv->{service}}{$node} = $serv; 436 $nodewidth = $serv->{imgdaywidth} if (defined $serv->{imgdaywidth} and $serv->{imgdaywidth} > $nodewidth); 437 } 438 } 439 foreach my $sname (sort keys %servlist) 440 { 441 my %s; 442 foreach my $node (@nodeorder) 443 { 444 if (defined $servlist{$sname}{$node}) 445 { 446 $servlist{$sname}{$node}->{width} = $nodewidth; 447 push (@{$s{nodes}}, $servlist{$sname}{$node}); 448 } 449 else 450 { 451 my %ts; 452 $ts{label} = "Not present"; 453 $ts{service} = "$sname"; 454 $ts{title} = "Not present"; 455 $ts{node} = $node; 456 $ts{width} = $nodewidth; 457 push (@{$s{nodes}}, \%ts); 458 } 459 } 460 push @{$cat{services}}, \%s; 461 } 462 $cat{name} = ucfirst $key; 463 $cat{numnodes} = @nodeorder; 464 $cat{numnodes} = @nodeorder; 465 push @cats, \%cat; 466 } 467 468 if (&munin_get_bool ($config, "compare", 1, $domain) and @nodeorder > 1) 469 { 470 foreach my $t (@times) 471 { 472 $comparisontemplates{$t}->param(DOMAIN => $domain, 473 DOMAINS => \@domainlist, 474 TIMESTAMP => $timestamp, 475 CATEGORIES => \@cats); 476 open (FILE, ">$config->{htmldir}/$domain/comparison-$t.html") or die "Cannot open $config->{htmldir}/$domain/comparison-$t.html"; 477 print FILE $comparisontemplates{$t}->output; 478 close FILE; 479 } 480 } 481 482 push @domains,\%domain; 486 my %ts; 487 $ts{label} = "Not present"; 488 $ts{service} = "$sname"; 489 $ts{title} = "Not present"; 490 $ts{node} = $node; 491 $ts{width} = $nodewidth; 492 push (@{$s{nodes}}, \%ts); 493 } 494 } 495 push @{$cat{services}}, \%s; 496 } 497 $cat{name} = ucfirst $key; 498 $cat{numnodes} = @nodeorder; 499 $cat{numnodes} = @nodeorder; 500 push @cats, \%cat; 501 } 502 503 if (&munin_get_bool ($config, "compare", 1, $domain) and @nodeorder > 1) { 504 foreach my $t (@times) { 505 $comparisontemplates{$t}->param(DOMAIN => $domain, 506 DOMAINS => \@domainlist, 507 TIMESTAMP => $timestamp, 508 CATEGORIES => \@cats); 509 open (FILE, ">$config->{htmldir}/$domain/comparison-$t.html") or 510 die "Cannot open $config->{htmldir}/$domain/comparison-$t.html"; 511 print FILE $comparisontemplates{$t}->output; 512 close FILE; 513 } 514 } 515 push @domains,\%domain; 483 516 } 484 517 … … 604 637 } 605 638 606 logger("munin-html finished"); 639 $update_time = sprintf("%.2f",(Time::HiRes::time - $update_time)); 640 641 logger("munin-html finished ($update_time sec)"); 607 642 close $log; 608 643 … … 651 686 Munin's nodes, graph them, create html-pages, and optionally warn Nagios 652 687 about any off-limit values. 688 689 If munin.conf sets "graph_strategy cgi" then munin-html generates URLs 690 referencing the graph CGI instead of referencing pre-generated 691 graphs (made by munin-graph). 653 692 654 693 Munin-html creates the html pages. … … 678 717 =head1 COPYRIGHT 679 718 680 Copyright © 2002-2004 Knut Haugen, Audun Ytterdal, and Jimmy Olsen / Linpro AS. 719 Copyright (C) 2002-2006 Knut Haugen, Audun Ytterdal, and Jimmy Olsen / 720 Linpro AS. 681 721 682 722 This is free software; see the source for copying conditions. There is people/ilmari/modularisation-branch/server/munin-limits.in
r1012 r1265 157 157 $client->{'fields'} = join (' ', map { $_ =~ s/\.label$//; $_} grep (/\.label/, keys %$client)); 158 158 $client->{'plugin'} = $clientname; 159 $client->{'graph_ options'} = $client->{'notify_alias'} if defined $client->{'notify_alias'};159 $client->{'graph_title'} = $client->{'notify_alias'} if defined $client->{'notify_alias'}; 160 160 $client->{'host'} = $config->{'domain'}->{$domain}->{'node'}->{$name}->{'notify_alias'} || $name; 161 161 $client->{'group'} = $config->{'domain'}->{$domain}->{'notify_alias'} || $domain; … … 643 643 =head1 AUTHORS 644 644 645 Audun Ytterdal and Jimmy Olsen.645 Knut Haugen, Audun Ytterdal and Jimmy Olsen. 646 646 647 647 =head1 BUGS … … 653 653 =head1 COPYRIGHT 654 654 655 Copyright © 2002-200 4Knut Haugen, Audun Ytterdal, and Jimmy Olsen / Linpro AS.655 Copyright © 2002-2006 Knut Haugen, Audun Ytterdal, and Jimmy Olsen / Linpro AS. 656 656 657 657 This is free software; see the source for copying conditions. There is people/ilmari/modularisation-branch/server/munin-update.in
r1045 r1265 17 17 # along with this program; if not, write to the Free Software 18 18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 #20 #21 19 # 22 20 # Script to update the RRD-files with current information. … … 312 310 else 313 311 { 314 warn"Could not create lockfile \"$config->{rundir}/munin-update.lock\"";312 die "Could not create lockfile \"$config->{rundir}/munin-update.lock\""; 315 313 } 316 314 … … 1107 1105 1108 1106 sub fetch_node { 1109 my ($domain,$name,$node,$socket) = @_; 1110 my $nodefetch_time = Time::HiRes::time; 1111 logger("Fetching node: $name") if $DEBUG; 1112 for my $service (keys %{$node->{client}}) { 1113 my $servicefetch_time = Time::HiRes::time; 1114 logger("Fetching service: $name->$service") if $DEBUG; 1115 next if (exists ($node->{client}->{$service}->{fetch_data}) and 1116 $node->{client}->{$service}->{fetch_data} == 0); 1117 next if (exists ($node->{client}->{$service}->{update}) and 1118 $node->{client}->{$service}->{update} ne "yes"); 1119 next if (@limit_services and !grep (/^$service$/, @limit_services)); 1120 my $realservname = $node->{client}->{$service}->{realservname} || $service; 1121 delete $node->{client}->{$service}->{realservname} 1122 if exists $node->{client}->{$service}->{realservname}; 1123 write_socket_single ($socket, "fetch $realservname\n"); 1124 my @lines = &read_socket($socket); 1125 return 0 unless $socket; 1126 my $fields = {}; 1127 for (@lines) { 1128 next unless defined $_; 1129 if (/\# timeout/) { 1130 logger("Client reported timeout in fetching of $service"); 1131 } 1132 elsif (/(\w+)\.value\s+(.+)/) { 1133 my $key = $1; 1134 my $value = $2; 1135 my $comment = $3; 1136 $key = &sanitise_fieldname ($key, $fields); 1137 if (exists $node->{client}->{$service}->{$key.".label"}) 1138 { 1139 my $fname = "$config->{dbdir}/$domain/$name-$service-$key-". 1140 lc substr (($node->{client}->{$service}->{$key.".type"}||"GAUGE"),0,1). 1141 ".rrd"; 1142 logger("Updating $fname with $value") if $DEBUG; 1143 RRDs::update ("$fname", "N:$value"); 1144 if (my $ERROR = RRDs::error) { 1145 logger ("Unable to update $fname: $ERROR"); 1107 my ($domain,$name,$node,$socket) = @_; 1108 my $nodefetch_time = Time::HiRes::time; 1109 logger("Fetching node: $name") if $DEBUG; 1110 for my $service (keys %{$node->{client}}) { 1111 my $servicefetch_time = Time::HiRes::time; 1112 logger("Fetching service: $name->$service") if $DEBUG; 1113 next if (exists ($node->{client}->{$service}->{fetch_data}) and 1114 $node->{client}->{$service}->{fetch_data} == 0); 1115 next if (exists ($node->{client}->{$service}->{update}) and 1116 $node->{client}->{$service}->{update} ne "yes"); 1117 next if (@limit_services and !grep (/^$service$/, @limit_services)); 1118 my $realservname = ( $node->{client}->{$service}->{realservname} || 1119 $service ); 1120 delete $node->{client}->{$service}->{realservname} 1121 if exists $node->{client}->{$service}->{realservname}; 1122 write_socket_single ($socket, "fetch $realservname\n"); 1123 my @lines = &read_socket($socket); 1124 return 0 unless $socket; 1125 my $fields = {}; 1126 for (@lines) { 1127 next unless defined $_; 1128 if (/\# timeout/) { 1129 logger("Client reported timeout in fetching of $service"); 1130 } elsif (/(\w+)\.value\s+(\S+)\s*(\#.*)?$/) { 1131 my $key = $1; 1132 my $value = $2; 1133 my $comment = $3; 1134 1135 if ($value =~ /\d[Ee]([+-]?\d+)$/) { 1136 # Looks like scientific format. RRDtool does not 1137 # like it so we convert it. 1138 my $magnitude = $1; 1139 if ($magnitude < 0) { 1140 # Preserve at least 4 significant digits 1141 $magnitude=abs($magnitude)+4; 1142 $value=sprintf("%.%magnitudef",$value); 1143 } else { 1144 $value=sprintf("%.4f",$value); 1145 } 1146 } 1147 1148 $key = &sanitise_fieldname ($key, $fields); 1149 if (exists $node->{client}->{$service}->{$key.".label"}) { 1150 my $fname = 1151 "$config->{dbdir}/$domain/$name-$service-$key-". 1152 lc 1153 substr(($node->{client}->{$service}->{$key.".type"}|| 1154 "GAUGE"),0,1).".rrd"; 1155 1156 logger("Updating $fname with $value") if $DEBUG; 1157 RRDs::update ("$fname", "N:$value"); 1158 if (my $ERROR = RRDs::error) { 1159 logger ("Unable to update $fname: $ERROR"); 1160 } 1161 } else { 1162 logger ("Unable to update $domain -> $name -> $service -> $key: No such field (no \"label\" field defined when running plugin with \"config\")."); 1163 } 1164 } elsif (/(\w+)\.extinfo\s+(.+)/) { 1165 $config->{domain}->{$domain}->{node}->{$name}->{client}->{$service}->{$1.".extinfo"} = $2; 1146 1166 } 1147 } else { 1148 logger ("Unable to update $domain -> $name -> $service -> $key: No such field (no \"label\" field defined when running plugin with \"config\")."); 1149 } 1150 } 1151 elsif (/(\w+)\.extinfo\s+(.+)/) { 1152 $config->{domain}->{$domain}->{node}->{$name}->{client}->{$service}->{$1.".extinfo"} = $2; 1153 } 1154 } 1155 $servicefetch_time = sprintf ("%.2f",(Time::HiRes::time - $servicefetch_time)); 1156 logger ("Fetched service: $name -> $service ($servicefetch_time sec)"); 1157 print STATS "FS|$domain|$name|$service|$servicefetch_time\n"; 1158 } 1159 $nodefetch_time = sprintf ("%.2f",(Time::HiRes::time - $nodefetch_time)); 1160 logger ("Fetched node: $name ($nodefetch_time sec)"); 1161 print STATS "FN|$domain|$name|$nodefetch_time\n"; 1162 1163 return 1; 1167 } 1168 $servicefetch_time = sprintf ("%.2f",(Time::HiRes::time - $servicefetch_time)); 1169 logger ("Fetched service: $name -> $service ($servicefetch_time sec)"); 1170 print STATS "FS|$domain|$name|$service|$servicefetch_time\n"; 1171 } 1172 $nodefetch_time = sprintf ("%.2f",(Time::HiRes::time - $nodefetch_time)); 1173 logger ("Fetched node: $name ($nodefetch_time sec)"); 1174 print STATS "FN|$domain|$name|$nodefetch_time\n"; 1175 1176 return 1; 1164 1177 } 1165 1178 … … 1316 1329 =head1 AUTHORS 1317 1330 1318 Audun Ytterdal and Jimmy Olsen.1331 Audun Ytterdal, Jimmy Olsen, and Tore Anderson. 1319 1332 1320 1333 =head1 BUGS … … 1326 1339 =head1 COPYRIGHT 1327 1340 1328 Copyright © 2002-200 4Audun Ytterdal, Jimmy Olsen, and Tore Anderson / Linpro AS.1341 Copyright © 2002-2006 Audun Ytterdal, Jimmy Olsen, and Tore Anderson / Linpro AS. 1329 1342 1330 1343 This is free software; see the source for copying conditions. There is
