--- /srv/rebuilderd/tmp/rebuilderdBcOsac/inputs/pcp_7.1.0-1_riscv64.deb +++ /srv/rebuilderd/tmp/rebuilderdBcOsac/out/pcp_7.1.0-1_riscv64.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2026-01-28 02:01:35.000000 debian-binary │ --rw-r--r-- 0 0 0 29860 2026-01-28 02:01:35.000000 control.tar.xz │ --rw-r--r-- 0 0 0 2992496 2026-01-28 02:01:35.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 29876 2026-01-28 02:01:35.000000 control.tar.xz │ +-rw-r--r-- 0 0 0 2992512 2026-01-28 02:01:35.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── file list │ │ │ @@ -1,8 +1,8 @@ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./ │ │ │ -rw-r--r-- 0 root (0) root (0) 12226 2026-01-28 02:01:35.000000 ./conffiles │ │ │ -rw-r--r-- 0 root (0) root (0) 1321 2026-01-28 02:01:35.000000 ./control │ │ │ --rw-r--r-- 0 root (0) root (0) 70035 2026-01-28 02:01:35.000000 ./md5sums │ │ │ +-rw-r--r-- 0 root (0) root (0) 70267 2026-01-28 02:01:35.000000 ./md5sums │ │ │ -rwxr-xr-x 0 root (0) root (0) 11521 2026-01-28 02:01:35.000000 ./postinst │ │ │ -rwxr-xr-x 0 root (0) root (0) 8203 2026-01-28 02:01:35.000000 ./postrm │ │ │ -rwxr-xr-x 0 root (0) root (0) 8060 2026-01-28 02:01:35.000000 ./preinst │ │ │ -rwxr-xr-x 0 root (0) root (0) 7676 2026-01-28 02:01:35.000000 ./prerm │ │ ├── ./control │ │ │ @@ -1,12 +1,12 @@ │ │ │ Package: pcp │ │ │ Version: 7.1.0-1 │ │ │ Architecture: riscv64 │ │ │ Maintainer: PCP Development Team │ │ │ -Installed-Size: 13442 │ │ │ +Installed-Size: 13449 │ │ │ Depends: libc6 (>= 2.42), libdrm-amdgpu1 (>= 2.4.80), libdrm2 (>= 2.4.65), libncursesw6 (>= 6), libpcp-archive1 (= 7.1.0-1), libpcp-gui2, libpcp-import1, libpcp-mmv1 (= 7.1.0-1), libpcp-pmda3 (= 7.1.0-1), libpcp-trace2, libpcp-web1 (= 7.1.0-1), libpcp4 (= 7.1.0-1), libpfm4 (>= 4.9), libreadline8t64 (>= 6.0), libssl3t64 (>= 3.0.0), libsystemd0, libtinfo6 (>= 6), libuv1t64 (>= 1.18.0), zlib1g (>= 1:1.1.4), perl:any, gawk, procps, zstd, python3-pcp, python3, pcp-conf (= 7.1.0-1) │ │ │ Recommends: libpcp-pmda-perl │ │ │ Suggests: pcp-gui, libpcp-import-perl, redis-server │ │ │ Conflicts: dstat, pcp-manager, pcp-webapi, pgpool2 │ │ │ Breaks: pcp-doc (<< 7.1.0) │ │ │ Replaces: dstat, pcp-manager, pcp-webapi │ │ │ Provides: dstat, pcp-manager, pcp-webapi │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ │ │ │ ├── line order │ │ │ │ @@ -1036,7 +1036,10 @@ │ │ │ │ usr/share/pcp/lib/pmcheck/pmda-redis │ │ │ │ usr/share/pcp/lib/pmcheck/pmda-uwsgi │ │ │ │ usr/share/pcp/lib/pmcheck/pmie │ │ │ │ usr/share/pcp/lib/pmcheck/pmlogger │ │ │ │ usr/share/pcp/lib/pmcheck/pmproxy │ │ │ │ usr/share/pcp/lib/pmcheck/zeroconf │ │ │ │ usr/share/zsh/site-functions/_pcp │ │ │ │ +var/lib/pcp/pmdas/oracle/connect.pl │ │ │ │ +var/lib/pcp/pmdas/perfevent/perfevent-makerewrite.pl │ │ │ │ +var/lib/pcp/pmdas/simple/pmdasimple.perl ├── data.tar.xz │ ├── data.tar │ │ ├── file list │ │ │ @@ -1786,17 +1786,19 @@ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/nvidia/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/openmetrics/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/openmetrics/config.d/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/opentelemetry/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/opentelemetry/config.d/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/openvswitch/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/oracle/ │ │ │ +-rwxr-xr-x 0 root (0) root (0) 2068 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/oracle/connect.pl │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/overhead/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/pdns/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/ │ │ │ +-rwxr-xr-x 0 root (0) root (0) 1186 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/perfevent-makerewrite.pl │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/pipe/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/pmcd/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/podman/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/postfix/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/postgresql/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/proc/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/rabbitmq/ │ │ │ @@ -1806,14 +1808,15 @@ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/root/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/rsyslog/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/samba/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/sample/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/sendmail/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/shping/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/ │ │ │ +-rwxr-xr-x 0 root (0) root (0) 4881 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/pmdasimple.perl │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/slurm/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/smart/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/snmp/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/sockets/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/summary/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/systemd/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/trace/ │ │ │ @@ -2483,15 +2486,14 @@ │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/opentelemetry/Upgrade -> /usr/lib/pcp/pmdas/opentelemetry/Upgrade │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/opentelemetry/pmdaopentelemetry.python -> /usr/lib/pcp/pmdas/opentelemetry/pmdaopentelemetry.python │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/openvswitch/Install -> /usr/lib/pcp/pmdas/openvswitch/Install │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/openvswitch/Remove -> /usr/lib/pcp/pmdas/openvswitch/Remove │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/openvswitch/pmdaopenvswitch.python -> /usr/lib/pcp/pmdas/openvswitch/pmdaopenvswitch.python │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/oracle/Install -> /usr/lib/pcp/pmdas/oracle/Install │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/oracle/Remove -> /usr/lib/pcp/pmdas/oracle/Remove │ │ │ -lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/oracle/connect.pl -> /usr/lib/pcp/pmdas/oracle/connect.pl │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/oracle/pmdaoracle.pl -> /usr/lib/pcp/pmdas/oracle/pmdaoracle.pl │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/oracle/sample.conf -> /etc/pcp/oracle/sample.conf │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/overhead/Install -> /usr/lib/pcp/pmdas/overhead/Install │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/overhead/README -> /usr/lib/pcp/pmdas/overhead/README │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/overhead/Remove -> /usr/lib/pcp/pmdas/overhead/Remove │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/overhead/default.conf -> /etc/pcp/overhead/conf.d/default.conf │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/overhead/domain.h -> /usr/lib/pcp/pmdas/overhead/domain.h │ │ │ @@ -2504,15 +2506,14 @@ │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/pdns/pmdapdns.pl -> /usr/lib/pcp/pmdas/pdns/pmdapdns.pl │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/Install -> /usr/lib/pcp/pmdas/perfevent/Install │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/Remove -> /usr/lib/pcp/pmdas/perfevent/Remove │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/Upgrade -> /usr/lib/pcp/pmdas/perfevent/Upgrade │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/domain.h -> /usr/lib/pcp/pmdas/perfevent/domain.h │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/help -> /usr/lib/pcp/pmdas/perfevent/help │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/perfalloc -> /usr/lib/pcp/pmdas/perfevent/perfalloc │ │ │ -lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/perfevent-makerewrite.pl -> /usr/lib/pcp/pmdas/perfevent/perfevent-makerewrite.pl │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/perfevent.conf -> /etc/pcp/perfevent/perfevent.conf │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/pmda_perfevent.so -> /usr/lib/pcp/pmdas/perfevent/pmda_perfevent.so │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/pmdaperfevent -> /usr/lib/pcp/pmdas/perfevent/pmdaperfevent │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/pmns -> /usr/lib/pcp/pmdas/perfevent/pmns │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/perfevent/root -> /usr/lib/pcp/pmdas/perfevent/root │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/pipe/Install -> /usr/lib/pcp/pmdas/pipe/Install │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/pipe/README -> /usr/lib/pcp/pmdas/pipe/README │ │ │ @@ -2625,15 +2626,14 @@ │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/shping/sample.conf -> /etc/pcp/shping/sample.conf │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/Install -> /usr/lib/pcp/pmdas/simple/Install │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/Makefile -> /usr/lib/pcp/pmdas/simple/Makefile │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/README -> /usr/lib/pcp/pmdas/simple/README │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/Remove -> /usr/lib/pcp/pmdas/simple/Remove │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/domain.h -> /usr/lib/pcp/pmdas/simple/domain.h │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/help -> /usr/lib/pcp/pmdas/simple/help │ │ │ -lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/pmdasimple.perl -> /usr/lib/pcp/pmdas/simple/pmdasimple.perl │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/pmdasimple.python -> /usr/lib/pcp/pmdas/simple/pmdasimple.python │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/pmns -> /usr/lib/pcp/pmdas/simple/pmns │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/root -> /usr/lib/pcp/pmdas/simple/root │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/simple.c -> /usr/lib/pcp/pmdas/simple/simple.c │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/simple/simple.conf -> /etc/pcp/simple/simple.conf │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/slurm/Install -> /usr/lib/pcp/pmdas/slurm/Install │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2026-01-28 02:01:35.000000 ./var/lib/pcp/pmdas/slurm/Remove -> /usr/lib/pcp/pmdas/slurm/Remove │ │ ├── ./var/lib/pcp/pmdas/oracle/connect.pl │ │ │ @@ -1,4 +1,130 @@ │ │ │ -00000000: 6465 7374 696e 6174 696f 6e3a 202f 7573 destination: /us │ │ │ -00000010: 722f 6c69 622f 7063 702f 706d 6461 732f r/lib/pcp/pmdas/ │ │ │ -00000020: 6f72 6163 6c65 2f63 6f6e 6e65 6374 2e70 oracle/connect.p │ │ │ -00000030: 6c0a l. │ │ │ +00000000: 2321 202f 7573 722f 6269 6e2f 7065 726c #! /usr/bin/perl │ │ │ +00000010: 0a23 0a23 2043 6f70 7972 6967 6874 2028 .#.# Copyright ( │ │ │ +00000020: 6329 2032 3031 3620 5265 6420 4861 742e c) 2016 Red Hat. │ │ │ +00000030: 0a23 0a23 2054 6869 7320 7072 6f67 7261 .#.# This progra │ │ │ +00000040: 6d20 6973 2066 7265 6520 736f 6674 7761 m is free softwa │ │ │ +00000050: 7265 3b20 796f 7520 6361 6e20 7265 6469 re; you can redi │ │ │ +00000060: 7374 7269 6275 7465 2069 7420 616e 642f stribute it and/ │ │ │ +00000070: 6f72 206d 6f64 6966 7920 6974 0a23 2075 or modify it.# u │ │ │ +00000080: 6e64 6572 2074 6865 2074 6572 6d73 206f nder the terms o │ │ │ +00000090: 6620 7468 6520 474e 5520 4765 6e65 7261 f the GNU Genera │ │ │ +000000a0: 6c20 5075 626c 6963 204c 6963 656e 7365 l Public License │ │ │ +000000b0: 2061 7320 7075 626c 6973 6865 6420 6279 as published by │ │ │ +000000c0: 2074 6865 0a23 2046 7265 6520 536f 6674 the.# Free Soft │ │ │ +000000d0: 7761 7265 2046 6f75 6e64 6174 696f 6e3b ware Foundation; │ │ │ +000000e0: 2065 6974 6865 7220 7665 7273 696f 6e20 either version │ │ │ +000000f0: 3220 6f66 2074 6865 204c 6963 656e 7365 2 of the License │ │ │ +00000100: 2c20 6f72 2028 6174 2079 6f75 720a 2320 , or (at your.# │ │ │ +00000110: 6f70 7469 6f6e 2920 616e 7920 6c61 7465 option) any late │ │ │ +00000120: 7220 7665 7273 696f 6e2e 0a23 0a23 2054 r version..#.# T │ │ │ +00000130: 6869 7320 7072 6f67 7261 6d20 6973 2064 his program is d │ │ │ +00000140: 6973 7472 6962 7574 6564 2069 6e20 7468 istributed in th │ │ │ +00000150: 6520 686f 7065 2074 6861 7420 6974 2077 e hope that it w │ │ │ +00000160: 696c 6c20 6265 2075 7365 6675 6c2c 2062 ill be useful, b │ │ │ +00000170: 7574 0a23 2057 4954 484f 5554 2041 4e59 ut.# WITHOUT ANY │ │ │ +00000180: 2057 4152 5241 4e54 593b 2077 6974 686f WARRANTY; witho │ │ │ +00000190: 7574 2065 7665 6e20 7468 6520 696d 706c ut even the impl │ │ │ +000001a0: 6965 6420 7761 7272 616e 7479 206f 6620 ied warranty of │ │ │ +000001b0: 4d45 5243 4841 4e54 4142 494c 4954 590a MERCHANTABILITY. │ │ │ +000001c0: 2320 6f72 2046 4954 4e45 5353 2046 4f52 # or FITNESS FOR │ │ │ +000001d0: 2041 2050 4152 5449 4355 4c41 5220 5055 A PARTICULAR PU │ │ │ +000001e0: 5250 4f53 452e 2020 5365 6520 7468 6520 RPOSE. See the │ │ │ +000001f0: 474e 5520 4765 6e65 7261 6c20 5075 626c GNU General Publ │ │ │ +00000200: 6963 204c 6963 656e 7365 0a23 2066 6f72 ic License.# for │ │ │ +00000210: 206d 6f72 6520 6465 7461 696c 732e 0a23 more details..# │ │ │ +00000220: 0a0a 7573 6520 7374 7269 6374 3b0a 7573 ..use strict;.us │ │ │ +00000230: 6520 7761 726e 696e 6773 3b0a 7573 6520 e warnings;.use │ │ │ +00000240: 5043 503a 3a50 4d44 413b 0a75 7365 2044 PCP::PMDA;.use D │ │ │ +00000250: 4249 3b0a 0a6d 7920 246f 735f 7573 6572 BI;..my $os_user │ │ │ +00000260: 203d 2027 6f72 6163 6c65 273b 0a6d 7920 = 'oracle';.my │ │ │ +00000270: 2475 7365 726e 616d 6520 3d20 2753 5953 $username = 'SYS │ │ │ +00000280: 5445 4d27 3b0a 6d79 2024 7061 7373 776f TEM';.my $passwo │ │ │ +00000290: 7264 203d 2027 6d61 6e61 6765 7227 3b0a rd = 'manager';. │ │ │ +000002a0: 6d79 2024 686f 7374 203d 2027 6c6f 6361 my $host = 'loca │ │ │ +000002b0: 6c68 6f73 7427 3b0a 6d79 2024 706f 7274 lhost';.my $port │ │ │ +000002c0: 203d 2027 3135 3231 273b 0a6d 7920 4073 = '1521';.my @s │ │ │ +000002d0: 6964 7320 3d20 2820 276d 6173 7465 7227 ids = ( 'master' │ │ │ +000002e0: 2029 3b0a 6d79 2024 6469 7361 626c 655f );.my $disable_ │ │ │ +000002f0: 6669 6c65 7374 6174 203d 2030 3b0a 6d79 filestat = 0;.my │ │ │ +00000300: 2024 6469 7361 626c 655f 6f62 6a65 6374 $disable_object │ │ │ +00000310: 5f63 6163 6865 203d 2030 3b0a 0a23 2043 _cache = 0;..# C │ │ │ +00000320: 6f6e 6669 6775 7261 7469 6f6e 2066 696c onfiguration fil │ │ │ +00000330: 6573 2066 6f72 206f 7665 7272 6964 696e es for overridin │ │ │ +00000340: 6720 7468 6520 6162 6f76 6520 7365 7474 g the above sett │ │ │ +00000350: 696e 6773 0a66 6f72 206d 7920 2466 696c ings.for my $fil │ │ │ +00000360: 6520 2809 272f 6574 632f 7063 7064 6269 e (.'/etc/pcpdbi │ │ │ +00000370: 2e63 6f6e 6627 2c09 2320 7379 7374 656d .conf',.# system │ │ │ +00000380: 2064 6566 6175 6c74 7320 286c 6f77 6573 defaults (lowes │ │ │ +00000390: 7420 7072 696f 7269 7479 290a 0909 706d t priority)...pm │ │ │ +000003a0: 6461 5f63 6f6e 6669 6728 2750 4350 5f50 da_config('PCP_P │ │ │ +000003b0: 4d44 4153 5f44 4952 2729 202e 2027 2f6f MDAS_DIR') . '/o │ │ │ +000003c0: 7261 636c 652f 6f72 6163 6c65 2e63 6f6e racle/oracle.con │ │ │ +000003d0: 6627 2c0a 0909 706d 6461 5f63 6f6e 6669 f',...pmda_confi │ │ │ +000003e0: 6728 2750 4350 5f56 4152 5f44 4952 2729 g('PCP_VAR_DIR') │ │ │ +000003f0: 202e 2027 2f63 6f6e 6669 672f 6f72 6163 . '/config/orac │ │ │ +00000400: 6c65 2f6f 7261 636c 652e 636f 6e66 272c le/oracle.conf', │ │ │ +00000410: 0a09 0927 2e2f 6f72 6163 6c65 2e63 6f6e ...'./oracle.con │ │ │ +00000420: 6627 2029 207b 0923 2063 7572 7265 6e74 f' ) {.# current │ │ │ +00000430: 2064 6972 6563 746f 7279 2028 6869 6768 directory (high │ │ │ +00000440: 2070 7269 6f72 6974 7929 0a20 2020 2069 priority). i │ │ │ +00000450: 6620 2820 2d66 2024 6669 6c65 2029 207b f ( -f $file ) { │ │ │ +00000460: 0a09 2320 7072 696e 7428 224c 6f61 6469 ..# print("Loadi │ │ │ +00000470: 6e67 2024 6669 6c65 5c6e 2229 3b0a 0965 ng $file\n");..e │ │ │ +00000480: 7661 6c20 6063 6174 2024 6669 6c65 603b val `cat $file`; │ │ │ +00000490: 0a20 2020 207d 0a7d 0a0a 6966 2028 6465 . }.}..if (de │ │ │ +000004a0: 6669 6e65 6428 2441 5247 565b 305d 2920 fined($ARGV[0]) │ │ │ +000004b0: 2626 2028 2441 5247 565b 305d 2065 7120 && ($ARGV[0] eq │ │ │ +000004c0: 272d 6327 207c 7c20 2441 5247 565b 305d '-c' || $ARGV[0] │ │ │ +000004d0: 2065 7120 272d 2d63 6f6e 6669 6727 2929 eq '--config')) │ │ │ +000004e0: 207b 0a20 2020 2070 7269 6e74 2822 6f73 {. print("os │ │ │ +000004f0: 5f75 7365 723d 246f 735f 7573 6572 5c6e _user=$os_user\n │ │ │ +00000500: 2229 3b0a 2020 2020 7072 696e 7428 2275 ");. print("u │ │ │ +00000510: 7365 726e 616d 653d 2475 7365 726e 616d sername=$usernam │ │ │ +00000520: 655c 6e22 293b 0a20 2020 2070 7269 6e74 e\n");. print │ │ │ +00000530: 2822 7061 7373 776f 7264 3d24 7061 7373 ("password=$pass │ │ │ +00000540: 776f 7264 5c6e 2229 3b0a 2020 2020 7072 word\n");. pr │ │ │ +00000550: 696e 7428 2268 6f73 743d 2468 6f73 745c int("host=$host\ │ │ │ +00000560: 6e22 293b 0a20 2020 2070 7269 6e74 2822 n");. print(" │ │ │ +00000570: 706f 7274 3d24 706f 7274 5c6e 2229 3b0a port=$port\n");. │ │ │ +00000580: 2020 2020 2320 7072 696e 7428 2270 6174 # print("pat │ │ │ +00000590: 683a 2024 454e 567b 4c44 5f4c 4942 5241 h: $ENV{LD_LIBRA │ │ │ +000005a0: 5259 5f50 4154 487d 5c6e 2229 3b0a 2020 RY_PATH}\n");. │ │ │ +000005b0: 2020 6d79 2024 7369 6473 7472 203d 2027 my $sidstr = ' │ │ │ +000005c0: 273b 0a20 2020 2066 6f72 6561 6368 206d ';. foreach m │ │ │ +000005d0: 7920 2473 6964 2028 4073 6964 7329 207b y $sid (@sids) { │ │ │ +000005e0: 0a09 2473 6964 7374 7220 2e3d 2024 7369 ..$sidstr .= $si │ │ │ +000005f0: 6420 2e20 272c 273b 0a20 2020 207d 0a20 d . ',';. }. │ │ │ +00000600: 2020 2063 686f 7028 2473 6964 7374 7229 chop($sidstr) │ │ │ +00000610: 3b0a 2020 2020 7072 696e 7428 2273 6964 ;. print("sid │ │ │ +00000620: 733d 2473 6964 7374 725c 6e22 293b 0a20 s=$sidstr\n");. │ │ │ +00000630: 2020 2070 7269 6e74 2822 6469 7361 626c print("disabl │ │ │ +00000640: 655f 6669 6c65 7374 6174 3d24 6469 7361 e_filestat=$disa │ │ │ +00000650: 626c 655f 6669 6c65 7374 6174 5c6e 2229 ble_filestat\n") │ │ │ +00000660: 3b0a 2020 2020 7072 696e 7428 2264 6973 ;. print("dis │ │ │ +00000670: 6162 6c65 5f6f 626a 6563 745f 6361 6368 able_object_cach │ │ │ +00000680: 653d 2464 6973 6162 6c65 5f6f 626a 6563 e=$disable_objec │ │ │ +00000690: 745f 6361 6368 655c 6e22 293b 0a20 2020 t_cache\n");. │ │ │ +000006a0: 2065 7869 7428 3029 3b0a 7d0a 0a6d 7920 exit(0);.}..my │ │ │ +000006b0: 2473 7461 7475 7320 3d20 303b 0a66 6f72 $status = 0;.for │ │ │ +000006c0: 6561 6368 206d 7920 2473 6964 2028 4073 each my $sid (@s │ │ │ +000006d0: 6964 7329 207b 0a20 2020 2070 7269 6e74 ids) {. print │ │ │ +000006e0: 2822 4174 7465 6d70 7469 6e67 204f 7261 ("Attempting Ora │ │ │ +000006f0: 636c 6520 6c6f 6769 6e20 5349 443d 2473 cle login SID=$s │ │ │ +00000700: 6964 202e 2e2e 2022 293b 0a20 2020 206d id ... ");. m │ │ │ +00000710: 7920 2464 6220 3d20 4442 492d 3e63 6f6e y $db = DBI->con │ │ │ +00000720: 6e65 6374 2822 6462 693a 4f72 6163 6c65 nect("dbi:Oracle │ │ │ +00000730: 3a68 6f73 743d 2468 6f73 743b 706f 7274 :host=$host;port │ │ │ +00000740: 3d24 706f 7274 3b73 6964 3d24 7369 6422 =$port;sid=$sid" │ │ │ +00000750: 2c20 2475 7365 726e 616d 652c 2024 7061 , $username, $pa │ │ │ +00000760: 7373 776f 7264 2c20 7b20 5072 696e 7445 ssword, { PrintE │ │ │ +00000770: 7272 6f72 203d 3e20 307d 293b 0a20 2020 rror => 0});. │ │ │ +00000780: 2069 6620 2864 6566 696e 6564 2824 6462 if (defined($db │ │ │ +00000790: 2929 207b 0a09 2464 622d 3e64 6973 636f )) {..$db->disco │ │ │ +000007a0: 6e6e 6563 7428 293b 0a09 7072 696e 7428 nnect();..print( │ │ │ +000007b0: 226f 6b2e 5c6e 2229 3b0a 2020 2020 7d20 "ok.\n");. } │ │ │ +000007c0: 656c 7365 207b 0a09 7072 696e 7466 2822 else {..printf(" │ │ │ +000007d0: 6661 696c 6564 215c 6e25 735c 6e22 2c20 failed!\n%s\n", │ │ │ +000007e0: 2444 4249 3a3a 6572 7273 7472 293b 0a09 $DBI::errstr);.. │ │ │ +000007f0: 2473 7461 7475 7320 3d20 313b 0a20 2020 $status = 1;. │ │ │ +00000800: 207d 0a7d 0a65 7869 7428 2473 7461 7475 }.}.exit($statu │ │ │ +00000810: 7329 3b0a s);. │ │ ├── ./var/lib/pcp/pmdas/perfevent/perfevent-makerewrite.pl │ │ │ @@ -1,5 +1,75 @@ │ │ │ -00000000: 6465 7374 696e 6174 696f 6e3a 202f 7573 destination: /us │ │ │ -00000010: 722f 6c69 622f 7063 702f 706d 6461 732f r/lib/pcp/pmdas/ │ │ │ -00000020: 7065 7266 6576 656e 742f 7065 7266 6576 perfevent/perfev │ │ │ -00000030: 656e 742d 6d61 6b65 7265 7772 6974 652e ent-makerewrite. │ │ │ -00000040: 706c 0a pl. │ │ │ +00000000: 2321 202f 7573 722f 6269 6e2f 7065 726c #! /usr/bin/perl │ │ │ +00000010: 0a23 0a23 2043 6f70 7972 6967 6874 2028 .#.# Copyright ( │ │ │ +00000020: 6329 2032 3031 3520 4d61 7274 696e 7320 c) 2015 Martins │ │ │ +00000030: 496e 6e75 732e 2020 416c 6c20 5269 6768 Innus. All Righ │ │ │ +00000040: 7473 2052 6573 6572 7665 642e 0a23 0a23 ts Reserved..#.# │ │ │ +00000050: 2054 6869 7320 7072 6f67 7261 6d20 6973 This program is │ │ │ +00000060: 2066 7265 6520 736f 6674 7761 7265 3b20 free software; │ │ │ +00000070: 796f 7520 6361 6e20 7265 6469 7374 7269 you can redistri │ │ │ +00000080: 6275 7465 2069 7420 616e 642f 6f72 206d bute it and/or m │ │ │ +00000090: 6f64 6966 7920 6974 0a23 2075 6e64 6572 odify it.# under │ │ │ +000000a0: 2074 6865 2074 6572 6d73 206f 6620 7468 the terms of th │ │ │ +000000b0: 6520 474e 5520 4765 6e65 7261 6c20 5075 e GNU General Pu │ │ │ +000000c0: 626c 6963 204c 6963 656e 7365 2061 7320 blic License as │ │ │ +000000d0: 7075 626c 6973 6865 6420 6279 2074 6865 published by the │ │ │ +000000e0: 0a23 2046 7265 6520 536f 6674 7761 7265 .# Free Software │ │ │ +000000f0: 2046 6f75 6e64 6174 696f 6e3b 2065 6974 Foundation; eit │ │ │ +00000100: 6865 7220 7665 7273 696f 6e20 3220 6f66 her version 2 of │ │ │ +00000110: 2074 6865 204c 6963 656e 7365 2c20 6f72 the License, or │ │ │ +00000120: 2028 6174 2079 6f75 720a 2320 6f70 7469 (at your.# opti │ │ │ +00000130: 6f6e 2920 616e 7920 6c61 7465 7220 7665 on) any later ve │ │ │ +00000140: 7273 696f 6e2e 0a23 0a23 2054 6869 7320 rsion..#.# This │ │ │ +00000150: 7072 6f67 7261 6d20 6973 2064 6973 7472 program is distr │ │ │ +00000160: 6962 7574 6564 2069 6e20 7468 6520 686f ibuted in the ho │ │ │ +00000170: 7065 2074 6861 7420 6974 2077 696c 6c20 pe that it will │ │ │ +00000180: 6265 2075 7365 6675 6c2c 2062 7574 0a23 be useful, but.# │ │ │ +00000190: 2057 4954 484f 5554 2041 4e59 2057 4152 WITHOUT ANY WAR │ │ │ +000001a0: 5241 4e54 593b 2077 6974 686f 7574 2065 RANTY; without e │ │ │ +000001b0: 7665 6e20 7468 6520 696d 706c 6965 6420 ven the implied │ │ │ +000001c0: 7761 7272 616e 7479 206f 6620 4d45 5243 warranty of MERC │ │ │ +000001d0: 4841 4e54 4142 494c 4954 590a 2320 6f72 HANTABILITY.# or │ │ │ +000001e0: 2046 4954 4e45 5353 2046 4f52 2041 2050 FITNESS FOR A P │ │ │ +000001f0: 4152 5449 4355 4c41 5220 5055 5250 4f53 ARTICULAR PURPOS │ │ │ +00000200: 452e 2020 5365 6520 7468 6520 474e 5520 E. See the GNU │ │ │ +00000210: 4765 6e65 7261 6c20 5075 626c 6963 204c General Public L │ │ │ +00000220: 6963 656e 7365 0a23 2066 6f72 206d 6f72 icense.# for mor │ │ │ +00000230: 6520 6465 7461 696c 732e 0a23 0a23 2054 e details..#.# T │ │ │ +00000240: 6869 7320 7574 696c 6974 7920 7769 6c6c his utility will │ │ │ +00000250: 2067 656e 6572 6174 6520 6120 636f 6e66 generate a conf │ │ │ +00000260: 6967 2066 696c 6520 7375 6974 6162 6c65 ig file suitable │ │ │ +00000270: 2066 6f72 2075 7365 2077 6974 680a 2320 for use with.# │ │ │ +00000280: 706d 6c6f 6772 6577 7269 7465 2074 6f20 pmlogrewrite to │ │ │ +00000290: 7570 6461 7465 2074 6865 206d 6574 7269 update the metri │ │ │ +000002a0: 6373 2067 656e 6572 6174 6564 2062 7920 cs generated by │ │ │ +000002b0: 7468 6520 7065 7266 6576 656e 7420 706d the perfevent pm │ │ │ +000002c0: 6461 2e0a 0a0a 7573 6520 7761 726e 696e da....use warnin │ │ │ +000002d0: 6773 3b0a 7573 6520 7374 7269 6374 3b0a gs;.use strict;. │ │ │ +000002e0: 0a6f 7065 6e20 5045 5246 4556 454e 5453 .open PERFEVENTS │ │ │ +000002f0: 2c20 2270 6d69 6e66 6f20 7065 7266 6576 , "pminfo perfev │ │ │ +00000300: 656e 7420 7c22 0a20 2020 206f 7220 6469 ent |". or di │ │ │ +00000310: 6520 2243 616e 2774 206c 6f61 6420 7065 e "Can't load pe │ │ │ +00000320: 7266 6576 656e 7473 3a20 2421 223b 0a0a rfevents: $!";.. │ │ │ +00000330: 6f70 656e 2043 4f4e 4649 472c 2022 3e70 open CONFIG, ">p │ │ │ +00000340: 6572 6665 7665 6e74 5f72 6577 7269 7465 erfevent_rewrite │ │ │ +00000350: 2e63 6f6e 6622 0a20 2020 206f 7220 6469 .conf". or di │ │ │ +00000360: 6520 2243 616e 2774 206f 7065 6e20 7065 e "Can't open pe │ │ │ +00000370: 7266 6576 656e 745f 7265 7772 6974 652e rfevent_rewrite. │ │ │ +00000380: 636f 6e66 2066 6f72 2077 7269 7469 6e67 conf for writing │ │ │ +00000390: 223b 0a0a 7768 696c 6520 283c 5045 5246 ";..while () {. m │ │ │ +000003b0: 7920 246c 696e 6520 3d20 245f 3b0a 2020 y $line = $_;. │ │ │ +000003c0: 2020 6368 6f6d 7020 246c 696e 653b 0a20 chomp $line;. │ │ │ +000003d0: 2020 2069 6620 2824 6c69 6e65 203d 7e20 if ($line =~ │ │ │ +000003e0: 2f5b 5e61 2d7a 412d 5a30 2d39 5f5c 2e5d /[^a-zA-Z0-9_\.] │ │ │ +000003f0: 2f29 7b0a 2020 2020 2020 2020 6d79 2024 /){. my $ │ │ │ +00000400: 6e65 776c 696e 6520 3d20 246c 696e 653b newline = $line; │ │ │ +00000410: 0a20 2020 2020 2020 2024 6e65 776c 696e . $newlin │ │ │ +00000420: 6520 3d7e 2073 2f5b 5e61 2d7a 412d 5a30 e =~ s/[^a-zA-Z0 │ │ │ +00000430: 2d39 5f5c 2e5d 2f5f 2f67 3b0a 0a20 2020 -9_\.]/_/g;.. │ │ │ +00000440: 2020 2020 2070 7269 6e74 2043 4f4e 4649 print CONFI │ │ │ +00000450: 4720 224d 4554 5249 4320 246c 696e 6520 G "METRIC $line │ │ │ +00000460: 7b20 4e41 4d45 202d 3e20 246e 6577 6c69 { NAME -> $newli │ │ │ +00000470: 6e65 207d 5c6e 220a 2020 2020 7d0a 7d20 ne }\n". }.} │ │ │ +00000480: 0a0a 636c 6f73 6520 5045 5246 4556 454e ..close PERFEVEN │ │ │ +00000490: 5453 3b0a 636c 6f73 6520 434f 4e46 4947 TS;.close CONFIG │ │ │ +000004a0: 3b0a ;. │ │ ├── ./var/lib/pcp/pmdas/simple/pmdasimple.perl │ │ │ @@ -1,4 +1,306 @@ │ │ │ -00000000: 6465 7374 696e 6174 696f 6e3a 202f 7573 destination: /us │ │ │ -00000010: 722f 6c69 622f 7063 702f 706d 6461 732f r/lib/pcp/pmdas/ │ │ │ -00000020: 7369 6d70 6c65 2f70 6d64 6173 696d 706c simple/pmdasimpl │ │ │ -00000030: 652e 7065 726c 0a e.perl. │ │ │ +00000000: 2321 202f 7573 722f 6269 6e2f 7065 726c #! /usr/bin/perl │ │ │ +00000010: 0a23 0a23 2043 6f70 7972 6967 6874 2028 .#.# Copyright ( │ │ │ +00000020: 6329 2032 3031 3220 5265 6420 4861 742e c) 2012 Red Hat. │ │ │ +00000030: 0a23 2043 6f70 7972 6967 6874 2028 6329 .# Copyright (c) │ │ │ +00000040: 2032 3030 382c 3230 3132 2041 636f 6e65 2008,2012 Acone │ │ │ +00000050: 782e 2020 416c 6c20 5269 6768 7473 2052 x. All Rights R │ │ │ +00000060: 6573 6572 7665 642e 0a23 2043 6f70 7972 eserved..# Copyr │ │ │ +00000070: 6967 6874 2028 6329 2032 3030 3420 5369 ight (c) 2004 Si │ │ │ +00000080: 6c69 636f 6e20 4772 6170 6869 6373 2c20 licon Graphics, │ │ │ +00000090: 496e 632e 2020 416c 6c20 5269 6768 7473 Inc. All Rights │ │ │ +000000a0: 2052 6573 6572 7665 642e 0a23 200a 2320 Reserved..# .# │ │ │ +000000b0: 5468 6973 2070 726f 6772 616d 2069 7320 This program is │ │ │ +000000c0: 6672 6565 2073 6f66 7477 6172 653b 2079 free software; y │ │ │ +000000d0: 6f75 2063 616e 2072 6564 6973 7472 6962 ou can redistrib │ │ │ +000000e0: 7574 6520 6974 2061 6e64 2f6f 7220 6d6f ute it and/or mo │ │ │ +000000f0: 6469 6679 2069 740a 2320 756e 6465 7220 dify it.# under │ │ │ +00000100: 7468 6520 7465 726d 7320 6f66 2074 6865 the terms of the │ │ │ +00000110: 2047 4e55 2047 656e 6572 616c 2050 7562 GNU General Pub │ │ │ +00000120: 6c69 6320 4c69 6365 6e73 6520 6173 2070 lic License as p │ │ │ +00000130: 7562 6c69 7368 6564 2062 7920 7468 650a ublished by the. │ │ │ +00000140: 2320 4672 6565 2053 6f66 7477 6172 6520 # Free Software │ │ │ +00000150: 466f 756e 6461 7469 6f6e 3b20 6569 7468 Foundation; eith │ │ │ +00000160: 6572 2076 6572 7369 6f6e 2032 206f 6620 er version 2 of │ │ │ +00000170: 7468 6520 4c69 6365 6e73 652c 206f 7220 the License, or │ │ │ +00000180: 2861 7420 796f 7572 0a23 206f 7074 696f (at your.# optio │ │ │ +00000190: 6e29 2061 6e79 206c 6174 6572 2076 6572 n) any later ver │ │ │ +000001a0: 7369 6f6e 2e0a 2320 0a23 2054 6869 7320 sion..# .# This │ │ │ +000001b0: 7072 6f67 7261 6d20 6973 2064 6973 7472 program is distr │ │ │ +000001c0: 6962 7574 6564 2069 6e20 7468 6520 686f ibuted in the ho │ │ │ +000001d0: 7065 2074 6861 7420 6974 2077 696c 6c20 pe that it will │ │ │ +000001e0: 6265 2075 7365 6675 6c2c 2062 7574 0a23 be useful, but.# │ │ │ +000001f0: 2057 4954 484f 5554 2041 4e59 2057 4152 WITHOUT ANY WAR │ │ │ +00000200: 5241 4e54 593b 2077 6974 686f 7574 2065 RANTY; without e │ │ │ +00000210: 7665 6e20 7468 6520 696d 706c 6965 6420 ven the implied │ │ │ +00000220: 7761 7272 616e 7479 206f 6620 4d45 5243 warranty of MERC │ │ │ +00000230: 4841 4e54 4142 494c 4954 590a 2320 6f72 HANTABILITY.# or │ │ │ +00000240: 2046 4954 4e45 5353 2046 4f52 2041 2050 FITNESS FOR A P │ │ │ +00000250: 4152 5449 4355 4c41 5220 5055 5250 4f53 ARTICULAR PURPOS │ │ │ +00000260: 452e 2020 5365 6520 7468 6520 474e 5520 E. See the GNU │ │ │ +00000270: 4765 6e65 7261 6c20 5075 626c 6963 204c General Public L │ │ │ +00000280: 6963 656e 7365 0a23 2066 6f72 206d 6f72 icense.# for mor │ │ │ +00000290: 6520 6465 7461 696c 732e 0a23 200a 0a75 e details..# ..u │ │ │ +000002a0: 7365 2073 7472 6963 743b 0a75 7365 2077 se strict;.use w │ │ │ +000002b0: 6172 6e69 6e67 733b 0a75 7365 2050 4350 arnings;.use PCP │ │ │ +000002c0: 3a3a 504d 4441 3b0a 0a75 7365 2076 6172 ::PMDA;..use var │ │ │ +000002d0: 7320 7177 2820 2470 6d64 6120 2472 6564 s qw( $pmda $red │ │ │ +000002e0: 2024 6772 6565 6e20 2462 6c75 6520 2475 $green $blue $u │ │ │ +000002f0: 7365 7220 2473 7973 7465 6d20 293b 0a6d ser $system );.m │ │ │ +00000300: 7920 2820 246e 756d 6665 7463 682c 2024 y ( $numfetch, $ │ │ │ +00000310: 6f6c 6466 6574 6368 2029 203d 2028 2030 oldfetch ) = ( 0 │ │ │ +00000320: 2c20 2d31 2029 3b0a 6d79 2028 2024 636f , -1 );.my ( $co │ │ │ +00000330: 6c6f 725f 696e 646f 6d2c 2024 6e6f 775f lor_indom, $now_ │ │ │ +00000340: 696e 646f 6d20 2920 3d20 2820 302c 2031 indom ) = ( 0, 1 │ │ │ +00000350: 2029 3b0a 6d79 2028 2024 7265 642c 2024 );.my ( $red, $ │ │ │ +00000360: 6772 6565 6e2c 2024 626c 7565 2029 203d green, $blue ) = │ │ │ +00000370: 2028 2030 2c20 3130 302c 2032 3030 2029 ( 0, 100, 200 ) │ │ │ +00000380: 3b0a 0a23 2073 696d 706c 652e 6e6f 7720 ;..# simple.now │ │ │ +00000390: 696e 7374 616e 6365 2064 6f6d 6169 6e20 instance domain │ │ │ +000003a0: 7374 7566 662e 2e2e 0a6d 7920 2473 696d stuff....my $sim │ │ │ +000003b0: 706c 655f 636f 6e66 6967 203d 2070 6d64 ple_config = pmd │ │ │ +000003c0: 615f 636f 6e66 6967 2827 5043 505f 504d a_config('PCP_PM │ │ │ +000003d0: 4441 535f 4449 5227 2920 2e20 272f 7369 DAS_DIR') . '/si │ │ │ +000003e0: 6d70 6c65 2f73 696d 706c 652e 636f 6e66 mple/simple.conf │ │ │ +000003f0: 273b 0a6d 7920 2574 696d 6573 6c69 6365 ';.my %timeslice │ │ │ +00000400: 733b 0a6d 7920 2466 696c 655f 6572 726f s;.my $file_erro │ │ │ +00000410: 7220 3d20 303b 0a0a 7375 6220 7369 6d70 r = 0;..sub simp │ │ │ +00000420: 6c65 5f69 6e73 7461 6e63 6509 2320 6361 le_instance.# ca │ │ │ +00000430: 6c6c 6564 206f 6e63 6520 7065 7220 6060 lled once per `` │ │ │ +00000440: 696e 7374 616e 6365 2072 6571 7565 7374 instance request │ │ │ +00000450: 2727 2070 6475 0a7b 0a20 2020 2026 7369 '' pdu.{. &si │ │ │ +00000460: 6d70 6c65 5f74 696d 656e 6f77 5f63 6865 mple_timenow_che │ │ │ +00000470: 636b 3b0a 7d0a 0a73 7562 2073 696d 706c ck;.}..sub simpl │ │ │ +00000480: 655f 6665 7463 6809 2320 6361 6c6c 6564 e_fetch.# called │ │ │ +00000490: 206f 6e63 6520 7065 7220 6060 6665 7463 once per ``fetc │ │ │ +000004a0: 6827 2720 7064 752c 2062 6566 6f72 6520 h'' pdu, before │ │ │ +000004b0: 6361 6c6c 6261 636b 730a 7b0a 2020 2020 callbacks.{. │ │ │ +000004c0: 246e 756d 6665 7463 682b 2b3b 0a20 2020 $numfetch++;. │ │ │ +000004d0: 2026 7369 6d70 6c65 5f74 696d 656e 6f77 &simple_timenow │ │ │ +000004e0: 5f63 6865 636b 3b0a 7d0a 0a73 7562 2073 _check;.}..sub s │ │ │ +000004f0: 696d 706c 655f 6665 7463 685f 6361 6c6c imple_fetch_call │ │ │ +00000500: 6261 636b 0923 206d 7573 7420 7265 7475 back.# must retu │ │ │ +00000510: 726e 2061 7272 6179 206f 6620 7661 6c75 rn array of valu │ │ │ +00000520: 652c 7374 6174 7573 0a7b 0a20 2020 206d e,status.{. m │ │ │ +00000530: 7920 2824 636c 7573 7465 722c 2024 6974 y ($cluster, $it │ │ │ +00000540: 656d 2c20 2469 6e73 7429 203d 2040 5f3b em, $inst) = @_; │ │ │ +00000550: 0a0a 2020 2020 7265 7475 726e 2028 504d .. return (PM │ │ │ +00000560: 5f45 5252 5f49 4e53 542c 2030 2920 756e _ERR_INST, 0) un │ │ │ +00000570: 6c65 7373 2028 2024 696e 7374 203d 3d20 less ( $inst == │ │ │ +00000580: 504d 5f49 4e5f 4e55 4c4c 0a09 0909 0920 PM_IN_NULL..... │ │ │ +00000590: 2020 207c 7c20 2824 636c 7573 7465 7220 || ($cluster │ │ │ +000005a0: 3d3d 2030 2026 2620 2469 7465 6d20 3d3d == 0 && $item == │ │ │ +000005b0: 2031 290a 0909 0909 2020 2020 7c7c 2028 1)..... || ( │ │ │ +000005c0: 2463 6c75 7374 6572 203d 3d20 3220 2626 $cluster == 2 && │ │ │ +000005d0: 2024 6974 656d 203d 3d20 3429 2029 3b0a $item == 4) );. │ │ │ +000005e0: 2020 2020 6966 2028 2463 6c75 7374 6572 if ($cluster │ │ │ +000005f0: 203d 3d20 3029 207b 0a09 6966 2028 2469 == 0) {..if ($i │ │ │ +00000600: 7465 6d20 3d3d 2030 2909 7b20 7265 7475 tem == 0).{ retu │ │ │ +00000610: 726e 2028 246e 756d 6665 7463 682c 2031 rn ($numfetch, 1 │ │ │ +00000620: 293b 207d 0a09 656c 7369 6620 2824 6974 ); }..elsif ($it │ │ │ +00000630: 656d 203d 3d20 3129 207b 0a09 2020 2020 em == 1) {.. │ │ │ +00000640: 6966 2028 2469 6e73 7420 3d3d 2030 2909 if ($inst == 0). │ │ │ +00000650: 7b20 7265 7475 726e 2028 2472 6564 203d { return ($red = │ │ │ +00000660: 2028 2472 6564 2b31 2920 2520 3235 352c ($red+1) % 255, │ │ │ +00000670: 2031 293b 207d 0a09 2020 2020 656c 7369 1); }.. elsi │ │ │ +00000680: 6620 2824 696e 7374 203d 3d20 3129 097b f ($inst == 1).{ │ │ │ +00000690: 2072 6574 7572 6e20 2824 6772 6565 6e20 return ($green │ │ │ +000006a0: 3d20 2824 6772 6565 6e2b 3129 2025 2032 = ($green+1) % 2 │ │ │ +000006b0: 3535 2c20 3129 3b20 7d0a 0920 2020 2065 55, 1); }.. e │ │ │ +000006c0: 6c73 6966 2028 2469 6e73 7420 3d3d 2032 lsif ($inst == 2 │ │ │ +000006d0: 2909 7b20 7265 7475 726e 2028 2462 6c75 ).{ return ($blu │ │ │ +000006e0: 6520 3d20 2824 626c 7565 2b31 2920 2520 e = ($blue+1) % │ │ │ +000006f0: 3235 352c 2031 293b 207d 0a09 2020 2020 255, 1); }.. │ │ │ +00000700: 656c 7365 0909 7b20 7265 7475 726e 2028 else..{ return ( │ │ │ +00000710: 504d 5f45 5252 5f49 4e53 542c 2030 293b PM_ERR_INST, 0); │ │ │ +00000720: 207d 0a09 7d20 656c 7365 0909 7b20 7265 }..} else..{ re │ │ │ +00000730: 7475 726e 2028 504d 5f45 5252 5f50 4d49 turn (PM_ERR_PMI │ │ │ +00000740: 442c 2030 293b 207d 0a20 2020 207d 0a20 D, 0); }. }. │ │ │ +00000750: 2020 2065 6c73 6966 2028 2463 6c75 7374 elsif ($clust │ │ │ +00000760: 6572 203d 3d20 3129 207b 0a09 6966 2028 er == 1) {..if ( │ │ │ +00000770: 246f 6c64 6665 7463 6820 3c20 246e 756d $oldfetch < $num │ │ │ +00000780: 6665 7463 6829 207b 0923 2067 6574 2063 fetch) {.# get c │ │ │ +00000790: 7572 7265 6e74 2076 616c 7565 732c 2069 urrent values, i │ │ │ +000007a0: 6620 6e65 6564 6564 0a09 2020 2020 2824 f needed.. ($ │ │ │ +000007b0: 7573 6572 2c20 2473 7973 7465 6d2c 2075 user, $system, u │ │ │ +000007c0: 6e64 6566 2c20 756e 6465 6629 203d 2074 ndef, undef) = t │ │ │ +000007d0: 696d 6573 3b0a 0920 2020 2024 6f6c 6466 imes;.. $oldf │ │ │ +000007e0: 6574 6368 203d 2024 6e75 6d66 6574 6368 etch = $numfetch │ │ │ +000007f0: 3b0a 097d 0a09 6966 2028 2469 7465 6d20 ;..}..if ($item │ │ │ +00000800: 3d3d 2032 2909 097b 2072 6574 7572 6e20 == 2)..{ return │ │ │ +00000810: 2824 7573 6572 2c20 3129 3b20 7d0a 0965 ($user, 1); }..e │ │ │ +00000820: 6c73 6966 2028 2469 7465 6d20 3d3d 2033 lsif ($item == 3 │ │ │ +00000830: 2909 7b20 7265 7475 726e 2028 2473 7973 ).{ return ($sys │ │ │ +00000840: 7465 6d2c 2031 293b 207d 0a09 656c 7365 tem, 1); }..else │ │ │ +00000850: 0909 097b 2072 6574 7572 6e20 2850 4d5f ...{ return (PM_ │ │ │ +00000860: 4552 525f 504d 4944 2c20 3029 3b20 7d0a ERR_PMID, 0); }. │ │ │ +00000870: 2020 2020 7d0a 2020 2020 656c 7369 6620 }. elsif │ │ │ +00000880: 2824 636c 7573 7465 7220 3d3d 2032 2026 ($cluster == 2 & │ │ │ +00000890: 2620 2469 7465 6d20 3d3d 2034 2920 7b0a & $item == 4) {. │ │ │ +000008a0: 096d 7920 2476 616c 7565 203d 2070 6d64 .my $value = pmd │ │ │ +000008b0: 615f 696e 7374 5f6c 6f6f 6b75 7028 246e a_inst_lookup($n │ │ │ +000008c0: 6f77 5f69 6e64 6f6d 2c20 2469 6e73 7429 ow_indom, $inst) │ │ │ +000008d0: 3b0a 0972 6574 7572 6e20 2850 4d5f 4552 ;..return (PM_ER │ │ │ +000008e0: 525f 494e 5354 2c20 3029 2075 6e6c 6573 R_INST, 0) unles │ │ │ +000008f0: 7320 6465 6669 6e65 6428 2476 616c 7565 s defined($value │ │ │ +00000900: 293b 0a09 7265 7475 726e 2028 2476 616c );..return ($val │ │ │ +00000910: 7565 2c20 3129 3b0a 2020 2020 7d0a 2020 ue, 1);. }. │ │ │ +00000920: 2020 7265 7475 726e 2028 504d 5f45 5252 return (PM_ERR │ │ │ +00000930: 5f50 4d49 442c 2030 293b 0a7d 0a0a 7375 _PMID, 0);.}..su │ │ │ +00000940: 6220 7369 6d70 6c65 5f73 746f 7265 5f63 b simple_store_c │ │ │ +00000950: 616c 6c62 6163 6b09 2320 6d75 7374 2072 allback.# must r │ │ │ +00000960: 6574 7572 6e20 6120 7369 6e67 6c65 2076 eturn a single v │ │ │ +00000970: 616c 7565 2028 7363 616c 6172 2063 6f6e alue (scalar con │ │ │ +00000980: 7465 7874 290a 7b0a 2020 2020 6d79 2028 text).{. my ( │ │ │ +00000990: 2463 6c75 7374 6572 2c20 2469 7465 6d2c $cluster, $item, │ │ │ +000009a0: 2024 696e 7374 2c20 2476 616c 2920 3d20 $inst, $val) = │ │ │ +000009b0: 405f 3b0a 2020 2020 6d79 2024 7374 7320 @_;. my $sts │ │ │ +000009c0: 3d20 303b 0a0a 2020 2020 6966 2028 2463 = 0;.. if ($c │ │ │ +000009d0: 6c75 7374 6572 203d 3d20 3029 207b 0a09 luster == 0) {.. │ │ │ +000009e0: 6966 2028 2469 7465 6d20 3d3d 2030 2920 if ($item == 0) │ │ │ +000009f0: 7b0a 0920 2020 2069 6620 2824 7661 6c20 {.. if ($val │ │ │ +00000a00: 3c20 3029 097b 2024 7661 6c20 3d20 303b < 0).{ $val = 0; │ │ │ +00000a10: 2024 7374 7320 3d20 504d 5f45 5252 5f42 $sts = PM_ERR_B │ │ │ +00000a20: 4144 5354 4f52 453b 207d 0a09 2020 2020 ADSTORE; }.. │ │ │ +00000a30: 246e 756d 6665 7463 6820 3d20 2476 616c $numfetch = $val │ │ │ +00000a40: 3b0a 097d 0a09 656c 7369 6620 2824 6974 ;..}..elsif ($it │ │ │ +00000a50: 656d 203d 3d20 3129 207b 0a09 2020 2020 em == 1) {.. │ │ │ +00000a60: 6966 2028 2476 616c 203c 2030 2909 7b20 if ($val < 0).{ │ │ │ +00000a70: 2473 7473 203d 2050 4d5f 4552 525f 4241 $sts = PM_ERR_BA │ │ │ +00000a80: 4453 544f 5245 3b20 2476 616c 203d 2030 DSTORE; $val = 0 │ │ │ +00000a90: 3b20 7d0a 0920 2020 2065 6c73 6966 2028 ; }.. elsif ( │ │ │ +00000aa0: 2476 616c 203e 2032 3535 2909 7b20 2473 $val > 255).{ $s │ │ │ +00000ab0: 7473 203d 2050 4d5f 4552 525f 4241 4453 ts = PM_ERR_BADS │ │ │ +00000ac0: 544f 5245 3b20 2476 616c 203d 2032 3535 TORE; $val = 255 │ │ │ +00000ad0: 3b20 7d0a 0a09 2020 2020 6966 2028 2469 ; }... if ($i │ │ │ +00000ae0: 6e73 7420 3d3d 2030 2909 7b20 2472 6564 nst == 0).{ $red │ │ │ +00000af0: 203d 2024 7661 6c3b 207d 0a09 2020 2020 = $val; }.. │ │ │ +00000b00: 656c 7369 6620 2824 696e 7374 203d 3d20 elsif ($inst == │ │ │ +00000b10: 3129 097b 2024 6772 6565 6e20 3d20 2476 1).{ $green = $v │ │ │ +00000b20: 616c 3b20 7d0a 0920 2020 2065 6c73 6966 al; }.. elsif │ │ │ +00000b30: 2028 2469 6e73 7420 3d3d 2032 2909 7b20 ($inst == 2).{ │ │ │ +00000b40: 2462 6c75 6520 3d20 2476 616c 3b20 7d0a $blue = $val; }. │ │ │ +00000b50: 0920 2020 2065 6c73 6509 097b 2024 7374 . else..{ $st │ │ │ +00000b60: 7320 3d20 504d 5f45 5252 5f49 4e53 543b s = PM_ERR_INST; │ │ │ +00000b70: 207d 0a09 7d0a 0965 6c73 6509 7b20 2473 }..}..else.{ $s │ │ │ +00000b80: 7473 203d 2050 4d5f 4552 525f 504d 4944 ts = PM_ERR_PMID │ │ │ +00000b90: 3b20 7d0a 0972 6574 7572 6e20 2473 7473 ; }..return $sts │ │ │ +00000ba0: 3b0a 2020 2020 7d0a 2020 2020 656c 7369 ;. }. elsi │ │ │ +00000bb0: 6620 2820 2824 636c 7573 7465 7220 3d3d f ( ($cluster == │ │ │ +00000bc0: 2031 2026 2620 2824 6974 656d 203d 3d20 1 && ($item == │ │ │ +00000bd0: 3220 7c7c 2024 6974 656d 203d 3d20 3329 2 || $item == 3) │ │ │ +00000be0: 290a 097c 7c20 2824 636c 7573 7465 7220 )..|| ($cluster │ │ │ +00000bf0: 3d3d 2032 2026 2620 2469 7465 6d20 3d3d == 2 && $item == │ │ │ +00000c00: 2034 2920 2920 7b0a 0972 6574 7572 6e20 4) ) {..return │ │ │ +00000c10: 504d 5f45 5252 5f50 4552 4d49 5353 494f PM_ERR_PERMISSIO │ │ │ +00000c20: 4e3b 0a20 2020 207d 0a20 2020 2072 6574 N;. }. ret │ │ │ +00000c30: 7572 6e20 504d 5f45 5252 5f50 4d49 443b urn PM_ERR_PMID; │ │ │ +00000c40: 0a7d 0a0a 7375 6220 7369 6d70 6c65 5f74 .}..sub simple_t │ │ │ +00000c50: 696d 656e 6f77 5f63 6865 636b 0a7b 0a20 imenow_check.{. │ │ │ +00000c60: 2020 2025 7469 6d65 736c 6963 6573 203d %timeslices = │ │ │ +00000c70: 2028 293b 0a0a 2020 2020 6966 2028 6f70 ();.. if (op │ │ │ +00000c80: 656e 2843 4f4e 4649 472c 2024 7369 6d70 en(CONFIG, $simp │ │ │ +00000c90: 6c65 5f63 6f6e 6669 6729 2920 7b0a 096d le_config)) {..m │ │ │ +00000ca0: 7920 2576 616c 7565 733b 0a0a 0928 2476 y %values;...($v │ │ │ +00000cb0: 616c 7565 737b 2773 6563 277d 2c20 2476 alues{'sec'}, $v │ │ │ +00000cc0: 616c 7565 737b 276d 696e 277d 2c20 2476 alues{'min'}, $v │ │ │ +00000cd0: 616c 7565 737b 2768 6f75 7227 7d2c 0a09 alues{'hour'},.. │ │ │ +00000ce0: 2020 2020 756e 6465 662c 756e 6465 662c undef,undef, │ │ │ +00000cf0: 756e 6465 662c 756e 6465 662c 756e 6465 undef,undef,unde │ │ │ +00000d00: 6629 203d 206c 6f63 616c 7469 6d65 3b0a f) = localtime;. │ │ │ +00000d10: 0924 5f20 3d20 3c43 4f4e 4649 473e 3b0a .$_ = ;. │ │ │ +00000d20: 0963 686f 6d70 3b09 0923 2061 766f 6964 .chomp;..# avoid │ │ │ +00000d30: 2070 6f73 7369 626c 6520 5c6e 206f 6e20 possible \n on │ │ │ +00000d40: 6c61 7374 2066 6965 6c64 0a09 666f 7265 last field..fore │ │ │ +00000d50: 6163 6820 6d79 2024 7370 6563 2028 7370 ach my $spec (sp │ │ │ +00000d60: 6c69 7428 2f2c 2f29 2920 7b0a 0920 2020 lit(/,/)) {.. │ │ │ +00000d70: 2024 7469 6d65 736c 6963 6573 7b24 7370 $timeslices{$sp │ │ │ +00000d80: 6563 7d20 3d20 2476 616c 7565 737b 2473 ec} = $values{$s │ │ │ +00000d90: 7065 637d 3b0a 097d 0a09 636c 6f73 6520 pec};..}..close │ │ │ +00000da0: 434f 4e46 4947 3b0a 0924 6669 6c65 5f65 CONFIG;..$file_e │ │ │ +00000db0: 7272 6f72 203d 2030 3b0a 2020 2020 7d0a rror = 0;. }. │ │ │ +00000dc0: 2020 2020 656c 7365 207b 0a09 756e 6c65 else {..unle │ │ │ +00000dd0: 7373 2028 2466 696c 655f 6572 726f 7220 ss ($file_error │ │ │ +00000de0: 3d3d 2024 2129 207b 0a09 2020 2020 2470 == $!) {.. $p │ │ │ +00000df0: 6d64 612d 3e6c 6f67 2822 7265 6164 2066 mda->log("read f │ │ │ +00000e00: 6169 6c65 6420 6f6e 2024 7369 6d70 6c65 ailed on $simple │ │ │ +00000e10: 5f63 6f6e 6669 673a 2024 2122 293b 0a09 _config: $!");.. │ │ │ +00000e20: 2020 2020 2466 696c 655f 6572 726f 7220 $file_error │ │ │ +00000e30: 3d20 2421 3b0a 097d 0a20 2020 207d 0a20 = $!;..}. }. │ │ │ +00000e40: 2020 2024 706d 6461 2d3e 7265 706c 6163 $pmda->replac │ │ │ +00000e50: 655f 696e 646f 6d28 2024 6e6f 775f 696e e_indom( $now_in │ │ │ +00000e60: 646f 6d2c 205c 2574 696d 6573 6c69 6365 dom, \%timeslice │ │ │ +00000e70: 7329 3b0a 7d0a 0a24 706d 6461 203d 2050 s);.}..$pmda = P │ │ │ +00000e80: 4350 3a3a 504d 4441 2d3e 6e65 7728 2773 CP::PMDA->new('s │ │ │ +00000e90: 696d 706c 6527 2c20 3235 3329 3b0a 2470 imple', 253);.$p │ │ │ +00000ea0: 6d64 612d 3e63 6f6e 6e65 6374 5f70 6d63 mda->connect_pmc │ │ │ +00000eb0: 643b 0a0a 2470 6d64 612d 3e61 6464 5f6d d;..$pmda->add_m │ │ │ +00000ec0: 6574 7269 6328 706d 6461 5f70 6d69 6428 etric(pmda_pmid( │ │ │ +00000ed0: 302c 3029 2c20 504d 5f54 5950 455f 5533 0,0), PM_TYPE_U3 │ │ │ +00000ee0: 322c 2050 4d5f 494e 444f 4d5f 4e55 4c4c 2, PM_INDOM_NULL │ │ │ +00000ef0: 2c0a 0909 2020 504d 5f53 454d 5f49 4e53 ,... PM_SEM_INS │ │ │ +00000f00: 5441 4e54 2c20 706d 6461 5f75 6e69 7473 TANT, pmda_units │ │ │ +00000f10: 2830 2c30 2c30 2c30 2c30 2c30 292c 0a09 (0,0,0,0,0,0),.. │ │ │ +00000f20: 0920 2027 7369 6d70 6c65 2e6e 756d 6665 . 'simple.numfe │ │ │ +00000f30: 7463 6827 2c20 2727 2c20 2727 293b 0a24 tch', '', '');.$ │ │ │ +00000f40: 706d 6461 2d3e 6164 645f 6d65 7472 6963 pmda->add_metric │ │ │ +00000f50: 2870 6d64 615f 706d 6964 2830 2c31 292c (pmda_pmid(0,1), │ │ │ +00000f60: 2050 4d5f 5459 5045 5f33 322c 2024 636f PM_TYPE_32, $co │ │ │ +00000f70: 6c6f 725f 696e 646f 6d2c 0a09 0920 2050 lor_indom,... P │ │ │ +00000f80: 4d5f 5345 4d5f 494e 5354 414e 542c 2070 M_SEM_INSTANT, p │ │ │ +00000f90: 6d64 615f 756e 6974 7328 302c 302c 302c mda_units(0,0,0, │ │ │ +00000fa0: 302c 302c 3029 2c0a 0909 2020 2773 696d 0,0,0),... 'sim │ │ │ +00000fb0: 706c 652e 636f 6c6f 7227 2c20 2727 2c20 ple.color', '', │ │ │ +00000fc0: 2727 293b 0a24 706d 6461 2d3e 6164 645f '');.$pmda->add_ │ │ │ +00000fd0: 6d65 7472 6963 2870 6d64 615f 706d 6964 metric(pmda_pmid │ │ │ +00000fe0: 2831 2c32 292c 2050 4d5f 5459 5045 5f44 (1,2), PM_TYPE_D │ │ │ +00000ff0: 4f55 424c 452c 2050 4d5f 494e 444f 4d5f OUBLE, PM_INDOM_ │ │ │ +00001000: 4e55 4c4c 2c0a 0909 2020 504d 5f53 454d NULL,... PM_SEM │ │ │ +00001010: 5f43 4f55 4e54 4552 2c20 706d 6461 5f75 _COUNTER, pmda_u │ │ │ +00001020: 6e69 7473 2830 2c31 2c30 2c30 2c50 4d5f nits(0,1,0,0,PM_ │ │ │ +00001030: 5449 4d45 5f53 4543 2c30 292c 0a09 0920 TIME_SEC,0),... │ │ │ +00001040: 2027 7369 6d70 6c65 2e74 696d 652e 7573 'simple.time.us │ │ │ +00001050: 6572 272c 2027 272c 2027 2729 3b0a 2470 er', '', '');.$p │ │ │ +00001060: 6d64 612d 3e61 6464 5f6d 6574 7269 6328 mda->add_metric( │ │ │ +00001070: 706d 6461 5f70 6d69 6428 312c 3329 2c20 pmda_pmid(1,3), │ │ │ +00001080: 504d 5f54 5950 455f 444f 5542 4c45 2c20 PM_TYPE_DOUBLE, │ │ │ +00001090: 504d 5f49 4e44 4f4d 5f4e 554c 4c2c 0a09 PM_INDOM_NULL,.. │ │ │ +000010a0: 0920 2050 4d5f 5345 4d5f 434f 554e 5445 . PM_SEM_COUNTE │ │ │ +000010b0: 522c 2070 6d64 615f 756e 6974 7328 302c R, pmda_units(0, │ │ │ +000010c0: 312c 302c 302c 504d 5f54 494d 455f 5345 1,0,0,PM_TIME_SE │ │ │ +000010d0: 432c 3029 2c0a 0909 2020 2773 696d 706c C,0),... 'simpl │ │ │ +000010e0: 652e 7469 6d65 2e73 7973 272c 2027 272c e.time.sys', '', │ │ │ +000010f0: 2027 2729 3b0a 2470 6d64 612d 3e61 6464 '');.$pmda->add │ │ │ +00001100: 5f6d 6574 7269 6328 706d 6461 5f70 6d69 _metric(pmda_pmi │ │ │ +00001110: 6428 322c 3429 2c20 504d 5f54 5950 455f d(2,4), PM_TYPE_ │ │ │ +00001120: 5533 322c 2024 6e6f 775f 696e 646f 6d2c U32, $now_indom, │ │ │ +00001130: 0a09 0920 2050 4d5f 5345 4d5f 494e 5354 ... PM_SEM_INST │ │ │ +00001140: 414e 542c 2070 6d64 615f 756e 6974 7328 ANT, pmda_units( │ │ │ +00001150: 302c 302c 302c 302c 302c 3029 2c0a 0909 0,0,0,0,0,0),... │ │ │ +00001160: 2020 2773 696d 706c 652e 6e6f 7727 2c20 'simple.now', │ │ │ +00001170: 2727 2c20 2727 293b 0a0a 2470 6d64 612d '', '');..$pmda- │ │ │ +00001180: 3e61 6464 5f69 6e64 6f6d 2824 636f 6c6f >add_indom($colo │ │ │ +00001190: 725f 696e 646f 6d2c 205b 3020 3d3e 2027 r_indom, [0 => ' │ │ │ +000011a0: 7265 6427 2c20 3120 3d3e 2027 6772 6565 red', 1 => 'gree │ │ │ +000011b0: 6e27 2c20 3220 3d3e 2027 626c 7565 275d n', 2 => 'blue'] │ │ │ +000011c0: 2c20 2727 2c20 2727 293b 0a24 6e6f 775f , '', '');.$now_ │ │ │ +000011d0: 696e 646f 6d20 3d20 2470 6d64 612d 3e61 indom = $pmda->a │ │ │ +000011e0: 6464 5f69 6e64 6f6d 2824 6e6f 775f 696e dd_indom($now_in │ │ │ +000011f0: 646f 6d2c 207b 7d2c 2027 272c 2027 2729 dom, {}, '', '') │ │ │ +00001200: 3b20 2320 696e 6974 6961 6c69 7a65 6420 ; # initialized │ │ │ +00001210: 6f6e 2d74 6865 2d66 6c79 0a24 706d 6461 on-the-fly.$pmda │ │ │ +00001220: 2d3e 7365 745f 6665 7463 6828 205c 2673 ->set_fetch( \&s │ │ │ +00001230: 696d 706c 655f 6665 7463 6820 293b 0a24 imple_fetch );.$ │ │ │ +00001240: 706d 6461 2d3e 7365 745f 696e 7374 616e pmda->set_instan │ │ │ +00001250: 6365 2820 5c26 7369 6d70 6c65 5f69 6e73 ce( \&simple_ins │ │ │ +00001260: 7461 6e63 6520 293b 0a24 706d 6461 2d3e tance );.$pmda-> │ │ │ +00001270: 7365 745f 6665 7463 685f 6361 6c6c 6261 set_fetch_callba │ │ │ +00001280: 636b 2820 5c26 7369 6d70 6c65 5f66 6574 ck( \&simple_fet │ │ │ +00001290: 6368 5f63 616c 6c62 6163 6b20 293b 0a24 ch_callback );.$ │ │ │ +000012a0: 706d 6461 2d3e 7365 745f 7374 6f72 655f pmda->set_store_ │ │ │ +000012b0: 6361 6c6c 6261 636b 2820 5c26 7369 6d70 callback( \&simp │ │ │ +000012c0: 6c65 5f73 746f 7265 5f63 616c 6c62 6163 le_store_callbac │ │ │ +000012d0: 6b20 293b 0a0a 2470 6d64 612d 3e73 6574 k );..$pmda->set │ │ │ +000012e0: 5f75 7365 7228 2770 6370 2729 3b0a 2673 _user('pcp');.&s │ │ │ +000012f0: 696d 706c 655f 7469 6d65 6e6f 775f 6368 imple_timenow_ch │ │ │ +00001300: 6563 6b3b 0a24 706d 6461 2d3e 7275 6e3b eck;.$pmda->run; │ │ │ +00001310: 0a .