Skip to content
Snippets Groups Projects
Commit a943e207 authored by Tibo's avatar Tibo
Browse files

Add date sensor

parent 0e88e511
No related branches found
No related tags found
No related merge requests found
No preview for this file type
<?php
namespace Monitor;
use Symfony\Component\Process\Process;
/**
* Unix timestamp (can be used to check that time is correctly configured on
* this server). date +%s
*
* @author tibo
*/
class Date implements SensorInterface {
public function run() {
$process = new Process('date +%s');
$process->run();
return $process->getOutput();
}
}
...@@ -4,7 +4,6 @@ namespace Monitor; ...@@ -4,7 +4,6 @@ namespace Monitor;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
...@@ -62,7 +61,8 @@ class PingCommand extends Command { ...@@ -62,7 +61,8 @@ class PingCommand extends Command {
"inodes" => Inodes::class, "inodes" => Inodes::class,
"cpu" => CPUInfo::class, "cpu" => CPUInfo::class,
"lsb" => LSB::class, "lsb" => LSB::class,
"memory" => MemInfo::class "memory" => MemInfo::class,
"date" => Date::class
]; ];
foreach ($sensors as $key => $sensor_class) { foreach ($sensors as $key => $sensor_class) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment