Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Poduptime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
Poduptime
Commits
37928e06
Commit
37928e06
authored
Aug 13, 2018
by
dmorley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let podmin pick score to send alert
parent
b58b667f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
16 deletions
+17
-16
db/migrations/1.0.0-2.0.0.sql
db/migrations/1.0.0-2.0.0.sql
+1
-1
db/migrations/2.3.0-2.4.0.sql
db/migrations/2.3.0-2.4.0.sql
+1
-1
db/pull.php
db/pull.php
+14
-13
db/tables.sql
db/tables.sql
+1
-1
No files found.
db/migrations/1.0.0-2.0.0.sql
View file @
37928e06
...
...
@@ -5,7 +5,7 @@ ALTER TABLE pods RENAME COLUMN pingdomurl TO stats_apikey;
ALTER
TABLE
pods
RENAME
COLUMN
xmpp
TO
service_xmpp
;
ALTER
TABLE
pods
RENAME
COLUMN
uptimelast7
TO
uptime_alltime
;
ALTER
TABLE
pods
RENAME
COLUMN
responsetimelast7
TO
latency
;
=
ALTER
TABLE
pods
RENAME
COLUMN
dateUpdated
TO
date_updated
;
ALTER
TABLE
pods
RENAME
COLUMN
dateLaststats
TO
date_laststats
;
ALTER
TABLE
pods
RENAME
COLUMN
dateCreated
TO
date_created
;
...
...
db/migrations/2.3.0-2.4.0.sql
View file @
37928e06
ALTER
TABLE
pods
ADD
podmin_notify_level
int
;
ALTER
TABLE
pods
ADD
podmin_notify_level
int
DEFAULT
50
;
db/pull.php
View file @
37928e06
...
...
@@ -40,7 +40,7 @@ try {
$reader
=
new
Reader
(
c
(
'geoip2db'
));
$sql
=
'
SELECT domain, score, date_created, weight, podmin_notify, email, masterversion, shortversion, status, detectedlanguage
SELECT domain, score, date_created, weight, podmin_notify,
podmin_notify_level,
email, masterversion, shortversion, status, detectedlanguage
FROM pods
'
;
...
...
@@ -63,17 +63,18 @@ try {
}
foreach
(
$pods
as
$pod
)
{
$domain
=
$pod
[
'domain'
];
$score
=
(
int
)
$pod
[
'score'
];
$dbscore
=
$score
;
$dateadded
=
$pod
[
'date_created'
];
$weight
=
$pod
[
'weight'
];
$email
=
$pod
[
'email'
];
$notify
=
$pod
[
'podmin_notify'
];
$masterv
=
$pod
[
'masterversion'
];
$shortv
=
$pod
[
'shortversion'
];
$dbstatus
=
$pod
[
'status'
];
$language
=
$pod
[
'detectedlanguage'
];
$domain
=
$pod
[
'domain'
];
$score
=
(
int
)
$pod
[
'score'
];
$dbscore
=
$score
;
$dateadded
=
$pod
[
'date_created'
];
$weight
=
$pod
[
'weight'
];
$email
=
$pod
[
'email'
];
$notify
=
$pod
[
'podmin_notify'
];
$notify_level
=
$pod
[
'podmin_notify_level'
];
$masterv
=
$pod
[
'masterversion'
];
$shortv
=
$pod
[
'shortversion'
];
$dbstatus
=
$pod
[
'status'
];
$language
=
$pod
[
'detectedlanguage'
];
try
{
$ratings
=
R
::
getAll
(
'
...
...
@@ -340,7 +341,7 @@ foreach ($pods as $pod) {
_debug
(
'Uptime'
,
$uptime
);
if
(
$score
==
49
&&
$notify
&&
!
$develop
&&
$dbscore
==
50
)
{
if
(
$score
==
(
$notify_level
-
1
)
&&
$notify
&&
!
$develop
&&
$dbscore
==
$notify_level
)
{
$to
=
$email
;
$headers
=
[
'From: '
.
c
(
'adminemail'
),
'Bcc: '
.
c
(
'adminemail'
)];
$subject
=
'Monitoring notice from poduptime'
;
...
...
db/tables.sql
View file @
37928e06
...
...
@@ -40,7 +40,7 @@ CREATE TABLE pods (
tokenexpire
timestamp
,
podmin_statement
text
,
podmin_notify
boolean
,
podmin_notify_level
int
,
podmin_notify_level
int
DEFAULT
50
,
sslexpire
timestamp
,
dnssec
boolean
,
comment_counts
int
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment