Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
monitoring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cylab
monitoring
Commits
a943e207
Commit
a943e207
authored
6 years ago
by
Tibo
Browse files
Options
Downloads
Patches
Plain Diff
Add date sensor
parent
0e88e511
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
php-client/bin/monitor.phar
+0
-0
0 additions, 0 deletions
php-client/bin/monitor.phar
php-client/src/Date.php
+21
-0
21 additions, 0 deletions
php-client/src/Date.php
php-client/src/PingCommand.php
+2
-2
2 additions, 2 deletions
php-client/src/PingCommand.php
with
23 additions
and
2 deletions
php-client/bin/monitor.phar
+
0
−
0
View file @
a943e207
No preview for this file type
This diff is collapsed.
Click to expand it.
php-client/src/Date.php
0 → 100644
+
21
−
0
View file @
a943e207
<?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
();
}
}
This diff is collapsed.
Click to expand it.
php-client/src/PingCommand.php
+
2
−
2
View file @
a943e207
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment