Munin::Node::OS(3pm)
π Munin::Node::OS π
okay so bestie, welcome to Munin::Node::OS β it's the User Contributed Perl Documentation for the OS-related utility methods that the Munin node leans on. it's giving "glue code that does the scary sysadmin stuff so the rest of us can vibe". π¦
β¨ NAME β¨
Munin::Node::OS β OS related utility methods for the Munin node. periodt. π
πΈ SYNOPSIS πΈ
use Munin::Node::OS;
my $uid = Munin::Node::OS->get_uid('foo');
my $host = Munin::Node::OS->get_fq_hostname();
like. that's it. that's the whole entrance. iconic behavior honestly. π
π METHODS π
π get_uid
$uid = $class->get_uid($user)
Returns the user ID. $user might either be a user name or a user ID. Returns undef if the user doesn't exist. no user, no uid, no drama. π
π get_gid
$gid = $class->get_gid($group)
Returns the group ID. $group might either be a group name or a group ID. Returns undef if the group doesn't exist. same energy as above but for groups bestie. π«Ά
π get_fq_hostname
$host = $class->get_fq_hostname()
Returns the fully qualified host name of the machine. the whole thing. not the nickname. the government name. β¨
π check_perms_if_paranoid
$bool = $class->check_perms_if_paranoid($target);
If paranoia is enabled, returns false unless $target is owned by root, and has safe permissions. If $target is a file, it also checks the directory it inhabits. yes it's checking the file's home too. it's thorough like that. π₯
π run_as_child
$result = run_as_child($timeout, $coderef, @arguments);
Creates a child process to run $code and waits for up to $timeout seconds for it to complete. Returns a hashref containing the following keys:
"stdout","stderr"β array references containing the output of these filehandles;"retval"β the result ofwait();"timed_out"β true if the child had to be interrupted.
β οΈ System errors will cause it to carp. so like, it WILL yell at you. respectfully. π
π reap_child_group
$class->reap_child_group($pid);
Sends SIGHUP and SIGKILL to the process group identified by $pid.
It sleeps for 2 seconds between SIGHUP and SIGKILL. a lil pause. a moment of silence. then it's over. π
π possible_to_signal_process
my $bool = $class->possible_to_signal_process($pid)
Check whether it's possible to send a signal to $pid (that means, to be brief, that the process is owned by the same user, or we are the super-user). This is a useful way to check that a child process is alive (even if only as a zombie) and hasn't changed its UID. zombie check!! not the fun kind of zombie but ok. π§
π set_effective_user_id
eval {
$class->set_effective_user_id($uid);
};
if ($@) {
# Failed to set EUID
}
The name says it all ... it literally does. it sets the effective user id. no notes. π
π set_effective_group_id
See documentation for set_effective_user_id(). copy-paste queen behavior, we love a consistent API. π
π set_real_user_id
See documentation for set_effective_user_id(). β¨
π set_real_group_id
See documentation for set_effective_user_id(). π
π set_umask
Set umask so that files created by plugins are group writable. Only call right before exec-ing a plugin. like, RIGHT before. timing matters bestie. β οΈ
and that's the whole page, no cap. every flag, every method, every undef, all accounted for. π«Ά
this lil masterpiece is from perl v5.42.3, dated 2026-09-30, and lives under the name Munin::Node::OS(3pm) β so if you cite it, cite it right. mwah. π
π¦ where this page comes from
- fedora 43: munin-node 2.0.78-1.fc43 Β· GPL-2.0-only
- fedora 44: munin-node 2.0.78-1.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms