FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cacti/scripts/ss_sql.php at develop · Cacti/cacti · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
Cacti
/
cacti
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
444
Star
1.9k
Code
Issues
320
Pull requests
26
Discussions
Actions
Projects
Wiki
Security and quality
67
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
cacti
/
scripts
/
ss_sql.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (47 loc) · 2.47 KB
Breadcrumbs
cacti
/
scripts
/
ss_sql.php
Copy path
File metadata and controls
57 lines (47 loc) · 2.47 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env php
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDtool-based Graphing Solution |
+-------------------------------------------------------------------------+
| This code is designed, written, and maintained by the Cacti Group. See |
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/
error_reporting
(
0
);
if
(!
isset
(
$
called_by_script_server
)) {
include_once
(
__DIR__
.
'
/../include/cli_check.php
'
);
print
call_user_func
(
'
ss_sql
'
);
}
function
ss_sql
() :
string
{
global
$
database_username
;
global
$
database_password
;
global
$
database_hostname
;
$
cmd
=
'
mysqladmin --host=
'
.
cacti_escapeshellarg
(
$
database_hostname
) .
'
--user=
'
.
cacti_escapeshellarg
(
$
database_username
);
if
(
$
database_password
!=
''
) {
$
cmd
.=
'
--password=
'
.
cacti_escapeshellarg
(
$
database_password
);
}
$
cmd
.=
'
status
'
;
$
result
=
shell_exec
(
$
cmd
) ??
''
;
$
result
=
preg_replace
(
'
/: /
'
,
'
:
'
,
$
result
);
$
result
=
preg_replace
(
'
/ /
'
,
'
'
,
$
result
);
$
result
=
preg_replace
(
'
/Slow queries/
'
,
'
SlowQueries
'
,
$
result
);
$
result
=
preg_replace
(
'
/Open tables/
'
,
'
OpenTables
'
,
$
result
);
$
result
=
preg_replace
(
'
/Queries per second avg/
'
,
'
QPS
'
,
$
result
);
$
result
=
preg_replace
(
'
/Flush tables/
'
,
'
FlushTables
'
,
$
result
);
return
trim
(
$
result
) ?:
'
U
'
;
}
Back
|
FazBrowse Home
|
New Git URL