*** /dev/null Sat Nov 23 05:22:01 2024
--- - Sat Nov 23 05:22:05 2024
***************
*** 0 ****
--- 1,56 ----
+ ##
+ ## snmpdx -- SNMP Daemon Extension
+ ## Copyright (c) 2003 The OSSP Project <http://www.ossp.org/>
+ ## Copyright (c) 2003 Ralf S. Engelschall <rse@engelschall.com>
+ ## Copyright (c) 2003 Cable & Wireless <http://www.cw.com/>
+ ##
+ ## Permission to use, copy, modify, and distribute this software for
+ ## any purpose with or without fee is hereby granted, provided that
+ ## the above copyright notice and this permission notice appear in all
+ ## copies.
+ ##
+ ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+ ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ ## SUCH DAMAGE.
+ ##
+ ## sysVM: System Vritual Memory
+ ##
+
+ package My::Probe::sysVM;
+ our @ISA = qw(My::Probe);
+
+ sub oids ($) {
+ my ($self) = @_;
+ return $self->{-ctx}->{-mib}->oids("*.snmpdx.host.system.sysVM.*");
+ }
+
+ sub probe ($$) {
+ my ($self, $obj) = @_;
+
+ # FreeBSD Linux Solaris
+ #Mem Total sysctl -n hw.physmem /proc/meminfo:MemTotal /usr/platform/`uname -i`/sbin/prtdiag:Memory size
+ #Mem Used vmstat: avm /proc/meminfo:MemTotal-Buffers-Cached-MemFree "total" - "free"
+ #Mem Free "total"-"used" "total"-"used" sar -r 1 1: freemem * `pagesize`
+ #Mem Status N.A. N.A. /usr/platform/`uname -i`/sbin/prtdiag:Status col.
+ #
+ #Swap Total swapinfo -k | tail -1 /proc/meminfo:SwapTotal swap -l: blocks * 512 (accumulate)
+ #Swap Used swapinfo -k | tail -1 "total" - "free" "total"-"free"
+ #Swap Free "total"-"used" /proc/meminfo:SwapFree swap -l: free * 512 (accumulate)
+ #
+ #Mem/Swap vmstat: pi+po vmstat: si+so vmstat: sr
+ #Page Activity
+
+ return;
+ }
+
+ 1;
+
|