Package: procmon
procmonis a small utility for checking whether certain processes are found in theps -efprocess list. The utility is not a daemon, meaning it will run once and then die. So to monitor that a certain process is running, you would for example haveprocmonin cron.If the looked for process is running,promonwill exit with return code0. If the process isn't found or if not enough processes are found (see-eflag), thenprocmonexits with1.UsageCheck if a process is running:procmon "firefox -param"Make the filter case-insensitive (-i/--insensitive):procmon -i "FiReFox -param"Mandate the minimum number of matched processes expected (default is 1):procmon -e 5 "firefox -param"Setting the log level:procmon --log-level debug "firefox -param"Sending an email notification on error. This requires you to have aprocmon.cfgconfigured with the SMTP server settings:procmon --send-email "firefox -param"ConfigurationThe configuration ofprocmonhappens at two levels;In the CLI (command line interface)In a configuration file (this is where SMTP settings etc are)CLIThe below is a copy of theprocmon --helpoutput. It shows available configuration parameters and their meaning.usage: procmon [-h] [-c CONFIG] [-e EXPECTED_MATCHES] [-i] [--send-email] [--log-level LOG_LEVEL] [--version] [filter]

positional arguments:
  filter                Filter string to match processes for

options:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        Path for configuration file (default: /etc/procmon.cfg, ./procmon.cfg)
  -e EXPECTED_MATCHES, --expected-matches EXPECTED_MATCHES
                        Number of matches required for a successful result
  -i, --insensitive     Case insensitive process matching
  --send-email          Send email notification
  --log-level LOG_LEVEL
                        Log level; debug, info, warning, error
  --version             Print the procmon version numberConfiguration fileUsing a configuration file isentirely optionalfor users that are not using the--send-emailoption. The configuration file is only used for configuring SMTP settings and similar.Pathsprocmonis looking for configuration files in the following paths:/etc/procmon.cfg./procmon.cfgExample configuration fileA full example of a configuration file can be found underhttps://github.com/sebdah/procmon/blob/main/examples/procmon.cfgExampleThe below command would be looking for a process calledpython bpytop(case insensitive). It would expect to findat least2 matches. And it would be logging on the debug level.procmon -i --log-level debug -m 2 python bpytopDevelopmentReleasingUpdate the version number inpyproject.tomlandprocmonCommit the version number updatesCreate a new git taggit tag <version>Push version updates and tagsgit push && git push --tagsEditorConfigThe project usesEditorConfigfor configuration of IDEs for development. Please make sure you have EditorConfig enabled in your IDE when developing, that will make your code abide to the coding guidelines automatically.Running testsTheMakefileis configured for running tests unless you want to run it in your editor. Simply execute:make testThis assumes that Python andpytestare available on your host.LicenseAPACHE LICENSE 2.0 Copyright 2022 Sebastian DahlgrenLicensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.