Source
static int proc_get_process_info(const char *pid, unsigned int flags, zbx_sysinfo_proc_t *proc, psinfo_t *psinfo)
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
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: gets 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) *
* Return value: *
* SUCCEED - no errors, FAIL - error occurred *