-
Notifications
You must be signed in to change notification settings - Fork 4
/
sqlog.conf.example
49 lines (40 loc) · 1.42 KB
/
sqlog.conf.example
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
###############################################################################
# $Id$
###############################################################################
#
# sqlog(1) database configuration
#
# Override defaults for
# SQLHOST Hostname for SQL db (default = sqlhbost)
# SQLUSER Read-only username for db (default = slurm_read)
# SQLPASS Read-only password (default = no password)
# SQLDB Database name for slurm data (default = slurm)
# TRACKNODES Set to 0 to disable per-job node tracking (default = 1)
#
# This "config file" is read by perl's do() routine, so arbitrary
# perl can be used. (For example, to automatically determine the
# SQLHOST, etc.)
#
# Must begin with package "conf".
#
package conf;
use Genders;
# Only need to override SQLHOST for now. Other defaults are ok.
$SQLHOST = get_sqlhost ();
# Example of adding new format list
%FORMATS = ( "sys1" => "jid,user,name,start,end" );
1;
#
# Get cluster's "sqlhost" (altmgmt node for now)
# (Returns the ethernet hostname for the node, if available)
#
sub get_sqlhost
{
my $genders = Genders->new();
my $host = "";
($host) = $genders->getnodes("mysqld") or
&main::log_fatal ("Failed to get SQL host from mysqld genders attr.\n");
my $server = $genders->getattrval("altname", $host) or
&main::log_error ("Failed to get altname for $host.\n");
return $server || $host;
}