Source
static int proc_get_process_info(const char *pid, unsigned int flags, zbx_sysinfo_proc_t *proc, psinfo_t *psinfo)
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
extern int CONFIG_TIMEOUT;
typedef struct
{
pid_t pid;
uid_t uid;
char *name;
/* process name extracted from the first argument (usually executable path) */
char *name_arg0;
/* process command line in format <arg0> <arg1> ... <argN>\0 */
char *cmdline;
zoneid_t zoneid;
}
zbx_sysinfo_proc_t;
/* helper functions for case if agent is compiled on Solaris 9 or earlier where zones are not supported */
/* but is running on a newer Solaris where zones are supported */
/******************************************************************************
* *
* Purpose: get Solaris version at runtime *
* *
* Parameters: *
* major_version - [OUT] major version (e.g. 5) *
* minor_version - [OUT] minor version (e.g. 9 for Solaris 9, 10 for *
* Solaris 10, 11 for Solaris 11) *