Code

ps support for Darwin / MacOSX
authorTon Voon <tonvoon@users.sourceforge.net>
Tue, 28 Jan 2003 00:32:23 +0000 (00:32 +0000)
committerTon Voon <tonvoon@users.sourceforge.net>
Tue, 28 Jan 2003 00:32:23 +0000 (00:32 +0000)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@255 f882894a-f735-0410-b71e-b25c423dba1c

configure.in

index fdc61965d38db6862b194ee6cf8c7c5b100b12ad..919461c7a51e5ade8950bdca57d9e4e958f9c36b 100644 (file)
@@ -633,6 +633,23 @@ then
        AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS glaxen",[])
        AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %d",[])
        echo "      ps syntax... $PATH_TO_PS glaxen"
+dnl MacOSX / Darwin
+dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
+dnl STAT      VSZ    RSS   UID USER     PPID UCOMM            COMMAND
+dnl Ss       1308    272     0 root        0 init             /sbin/init
+elif [ps waxo 'state vsz rss uid user ppid ucomm command' 2>/dev/null | egrep -i "^STAT +VSZ +RSS +UID +USER +PPID +UCOMM +COMMAND" >/dev/null]
+then
+       AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable list for sscanf])
+       AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[])
+       AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS waxo 'state uid ppid command'",[])
+       EXTRAS="$EXTRAS check_nagios"
+       AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS waxo 'state uid ppid ucomm command'",[])
+       AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n",[Format string for scanning ps output in check_procs])
+       AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS waxco 'vsz command'",[])
+       AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s",[])
+       AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS waxco 'rss command'",[])
+       AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[])
+       echo "      ps syntax... $PATH_TO_PS waxo 'state vsz rss command'"
 else
        echo "** Unable to find usable ps syntax"
 fi