PMNOTIFYERR(3)
π PMNOTIFYERR(3) π
okay bestie, welcome to pmnotifyerr β it's a 3rd-section library function, and it's literally the group chat of PCP error handling. no cap.
β¨ NAME β¨
pmNotifyErr, pmSyslog β standard handling of error messages π«Ά like, the β¨officialβ¨ way to yell about problems
πΈ C SYNOPSIS πΈ
#include <pcp/pmapi.h>
void pmNotifyErr(int priority, const char *message, ...);
void pmSyslog(int onoff);
cc ... -lpcp
π¦ DESCRIPTION π¦
so these routines give you the standard handling for error messages from inside the internals of Performance Co-Pilot (PCP) daemons and Performance Metric Domain Agents (PMDAs). like, it's giving "we have a house style for complaining" and honestly? iconic π
pmNotifyErr is a printf(3) style function. that means it will format message (and any subsequent arguments) with a prefix β and the prefix is a whole little ensemble cast:
- the current date and time from
ctime(3) - the name of the application from
pmGetProgname(3) - the process's id from
getpid(2) - and the priority
priority should be one of the level LOG_ macros defined for syslog(3). most typically this would be LOG_INFO, LOG_WARNING or LOG_ERR. (those three are the main characters fr fr β¨)
pmNotifyErr writes to standard error, which for daemons and PMDAs has most likely been redirected to a log file using pmOpenLog(3). and additionally, message (and any subsequent arguments) may be forwarded to syslog(3) β but only if pmSyslog has previously been called with onoff having a non-zero value.
Forwarding to syslog(3) can be disabled at any time by calling pmSyslog with onoff having a zero value. and heads up bestie β this is the starting state for each PCP application. so like, syslog forwarding is off until you say otherwise. default behavior, periodt.
and in the style of syslog(3), message need not include a terminating newline character β one will be added if required. so you can be chill about the \n, she handles it π
lowkey important:priorityshould be one of the levelLOG_macros defined forsyslog(3). don't be out here inventing your own values, bestie π
π SEE ALSO π
getpid(2), ctime(3), PMAPI(3), pmGetProgname(3), pmOpenLog(3), printf(3) and syslog(3) π
go read those too, iykyk π§
this page is part of Performance Co-Pilot (aka PCP) β the whole library, the whole vibe π β and it's the PMNOTIFYERR(3) page, dated and versioned right along with it. mwah, slay, that's the whole page π«Άπ
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2017 Ken McDonell. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms