PMNOTIFYERR(3)

πŸ“¦
version 7.2.2 Β· 3 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– 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:

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: priority should be one of the level LOG_ macros defined for syslog(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