a simple service for checking online times and ssl certificates
- status code
- content hash
- ssl certificate expire
Add new entry in supervisord.conf
(default: /etc/supervisor/supervisord.conf
)
[program:uply_job_loop]
command=php /var/www/uply.dev/bin/console job:loop
# install
apt-get install supervisor
# check deamon status
service supervisor status
# check program status
supervisorctl status
# stop it
supervisorctl stop uply_job_loop
# start it
supervisorctl start uply_job_loop
Add new Doctrine Entity in src/Entity/Unit/
with AbstractUnit
and UnitTrait
.
/**
* FooBar
*
* @ORM\Table(name="unit_foo_bar")
* @ORM\Entity(repositoryClass="App\Repository\Unit\FooBarRepository")
* @ORM\HasLifecycleCallbacks()
*/
class FooBar extends AbstractUnit
{
use UnitTrait;
// your own properties with getter/settter here...
/**
* @return string
*/
public function getIdent(): string
{
return 'foo_bar';
}
}
Add new Doctrine Repository in src/Repository/Unit/
with MonitorRepositoryInterface
.
/**
* FooBarRepository
*/
class FooBarRepository extends AbstractMonitorRepository
{
}
Add new Uply Unit Scrutinizer in src/Scrutinizer/Services/
with AbstractScrutinizer
.
/**
* Scrutinizer
*/
class FooBarScrutinizer implements AbstractScrutinizer
{
/**
* @param FooBarRepository $repository
*/
public function __construct(FooBarRepository $repository)
{
parent::__construct($repository);
}
/**
* @param FooBar $unit
*
* @throws \Exception
*/
public function scrutinize(UnitInterface $unit): NotificationData
{
// Check something and return a NotificationData Object
// return $this->notificationDataFactory->createDangerNotificationData(
// 'foo_bar.danger',
// ['%fooBar%' => $fooBar]
// );
}
}
Add new translations in translations/notification.[a-z].php
.