Mirmon(3)
π Mirmon(3) π
okay bestie, welcome to Mirmon β it's the OO interface for mirmon objects, and honestly? she's iconic. this is the Perl-side API, manual section 3, and it's giving "I run the whole mirror-monitoring operation and I do it with style" π
β¨ SYNOPSIS β¨
like, here's the vibe in code form:
use Mirmon ;
$m = Mirmon -> new ( [ $path-to-config ] )
$conf = $m -> conf ; # a Mirmon::Conf object
$state = $m -> state ; # the mirmon state
for my $url ( keys %$state )
{ $mirror = $state -> { $url } ; # a Mirmon::Mirror object
$mail = $mirror -> mail ; # contact address
$mirror -> age ( time ) ; # set mirror age
}
and here's the part that makes everything else make sense β so many class and object methods are just there to get or set attributes:
$object -> attribute # get an atttibute
$object -> attribute ( $attr ) # set an atttibute
that's the whole pattern. getter, setter, one shape. periodt. π
π Mirmon class methods
new ( [$path] )
makes you a fresh Mirmon object, built from a config file it finds in $path β or, if you didn't pass one, from the default list of possible config files. the related objects (config, state) get created and initialised too. it's a whole little family π«Ά
verbosity
okay so Mirmon always reports errors, no exceptions. normally she only reports the changes (inserts/deletes) she finds in the mirror_list. in quiet mode? nope, she doesn't. in verbose mode she reports progress: the startup and the finishing of probes. so chatty of her π¬
Mirmon::verbose ( [ $bool ] ) # get/set verbose
Mirmon::quiet ( [ $bool ] ) # get/set quiet
Mirmon::debug ( [ $bool ] ) # get/set debug
π¦ Mirmon object methods
confβ returns Mirmon's Mirmon::Conf object.stateβ returns a hashref"{ url => mirror, ... }", where url is exactly as specified in the mirror list and mirror is a Mirmon::Mirror object.regionsβ returns a hashref"{ country_code => country_name, ... }".config_listβ returns the list of default locations for config files.get_dates ( $get [, $URL] )β probes all the mirrors if$getis"all"; or a subset if$getis"update"; or only$URLif$getis"url".
πΈ Mirmon::Conf object methods
a Mirmon::Conf object represents a mirmon configuration. it's normaly created by Mirmon::new(). a specified (or default) config file gets read and interpreted. she reads, she interprets, she serves π
attribute methods
for every single config file entry, there is an attribute method β every one, no skips:
web_page, state, countries, mirror_list, probe, project_name, project_url, icons, project_logo, timeout, max_probes, min_poll, max_poll, min_sync, max_sync, list_style, put_histo, randomize, add_slash.
root
returns the file name of (the root of) the configuration file(s).
site_url
returns a hashref "{ site => url, ... }", as specified in the mirmon config file.
π§ Mirmon::Mirror object methods
a Mirmon::Mirror object represents the last known state of a mirror. it's normaly created by Mirmon::new() from the state file, as specified in the mirmon config file. and yes β Mirmon::Mirror objects can be used to probe mirrors. main character energy fr fr π
attribute methods
urlβ the url as given in the mirror list.ageβ the mirror's timestamp found by the last successful probe, or'undef'if no probe was ever successful. πlast_statusβ the status of the last probe, or'undef'if the mirror was never probed.last_ok_probeβ the timestamp of the last successful probe or'undef'if the mirror was never successfully probed.probe_historyβ the probe history is a list of's'(for success) and'f'(for failure) characters indicating the result of the probe. new results are appended whenever the mirror is probed.state_historyβ the state history consists of a timestamp, a'-'char, and a list of chars indicating a past status:'s'(fresh),'b'(oldish),'f'(old),'z'(bad) or'x'(skip). the timestamp indicates when the state history was last updated. the current status of the mirror is determined by the mirror's age and a few configuration parameters (min_sync,max_sync,max_poll). the state history is updated when the mirror is probed. if the last update of the history was less than 24 hours ago, the last status is replaced by the current status. if the last update of the history was more than 24 hours ago, the current status is appended to the history. one or more'skip's are inserted, if the timestamp is two or more days old (when mirmon hasn't run for more than two days).last_probeβ the timestamp of the last probe, or'undef'if the mirror was never probed.
object methods
mirmonβ returns the parent Mirmon object.state_history_timeβ returns the time part of thestate_historyattribute.state_history_histβ returns the history part of thestate_historyattribute.type,site,homeβ for an url likeftp://www.some.org/path/to/home, the type isftp, the site iswww.some.org, and home isftp://www.some.org/.age_in_daysβ returns the mirror's age (in fractional days), based on the mirror's timestamp as found by the last successful probe ; or based on the length of the state history if no probe was ever successful. returns'undef'if the mirror was never probed.mailβ returns the mirror's contact address as specified in the mirror list.regionβ returns the mirror's country code as specified in the mirror list.start_probeβ start a probe for the mirror in non-blocking mode ; returns the associated (IO::Handle) file handle. the caller must maintain an association between the handles and the mirror objects. no pressure bestie π«Άfinish_probe ( $handle )β sets the (IO::Handle)$handleto blocking IO ; reads a result from the handle, and updates the state of the mirror.
π SEE ALSO π
π AUTHOR π
(c) 2003-2016 Henk P. Penning
Faculty of Science, Utrecht University
http://www.staff.science.uu.nl/~penni101/ -- penning@uu.nl
mirmon-2.11 - Sat Jul 23 09:12:31 2016 ; henkp
okay that's the whole page π and for the sign-off: this gorgeous thing is Mirmon(3) from perl v5.8.8, dated 2016-07-23. she ate and left no crumbs. bye bestie, go probe something πβ¨π¦
π¦ where this page comes from
- epel 10: mirmon 2.11-19.el10_0 Β· MIT
- epel 9: mirmon 2.11-15.el9 Β· MIT
- fedora 43: mirmon 2.11-21.fc43 Β· MIT
- fedora 44: mirmon 2.11-22.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms