0001-snmp-update-SNMP-ucd-to-work-with-univnautes-2.1.patch
etc/inc/services.inc | ||
---|---|---|
1969 | 1969 |
extNames.1 = "uptime" |
1970 | 1970 |
extCommand.1 = "/usr/bin/uptime" |
1971 | 1971 |
extNames.2 = "cp_sessions" |
1972 |
extCommand.2 = "/usr/local/bin/univnautes-value.sh cp_sessions"
|
|
1972 |
extCommand.2 = "/usr/local/univnautes/sp/snmp.sh cp_sessions"
|
|
1973 | 1973 |
extNames.3 = "ip_whitelist" |
1974 |
extCommand.3 = "/usr/local/bin/univnautes-value.sh ip_whitelist"
|
|
1974 |
extCommand.3 = "/usr/local/univnautes/sp/snmp.sh ip_whitelist"
|
|
1975 | 1975 |
extNames.4 = "idp_federation" |
1976 |
extCommand.4 = "/usr/local/bin/univnautes-value.sh idp_federation"
|
|
1976 |
extCommand.4 = "/usr/local/univnautes/sp/snmp.sh idp_federation"
|
|
1977 | 1977 |
extNames.5 = "idp_local" |
1978 |
extCommand.5 = "/usr/local/bin/univnautes-value.sh idp_local"
|
|
1978 |
extCommand.5 = "/usr/local/univnautes/sp/snmp.sh idp_local"
|
|
1979 | 1979 |
extNames.6 = "mdurl" |
1980 |
extCommand.6 = "/usr/local/bin/univnautes-value.sh mdurl"
|
|
1980 |
extCommand.6 = "/usr/local/univnautes/sp/snmp.sh mdurl"
|
|
1981 | 1981 |
extNames.7 = "wlurl" |
1982 |
extCommand.7 = "/usr/local/bin/univnautes-value.sh wlurl"
|
|
1982 |
extCommand.7 = "/usr/local/univnautes/sp/snmp.sh wlurl"
|
|
1983 | 1983 |
extNames.8 = "defaultidp" |
1984 |
extCommand.8 = "/usr/local/bin/univnautes-value.sh defaultidp"
|
|
1984 |
extCommand.8 = "/usr/local/univnautes/sp/snmp.sh defaultidp"
|
|
1985 | 1985 | |
1986 | 1986 |
EOD; |
1987 | 1987 |
} |
usr/local/univnautes/sp/snmp.sh | ||
---|---|---|
1 |
#!/bin/sh |
|
2 | ||
3 |
# This script aims to be called by bsnmpd via "extCommand" lines |
|
4 | ||
5 |
mdurl() { |
|
6 |
echo "Deprecated" |
|
7 |
} |
|
8 | ||
9 |
wlurl() { |
|
10 |
echo "Deprecated" |
|
11 |
} |
|
12 | ||
13 |
defaultidp() { |
|
14 |
echo "Deprecated" |
|
15 |
} |
|
16 | ||
17 |
__sql() { |
|
18 |
sqlite3 /var/db/univnautes-sp.sqlite3 "$@" |
|
19 |
} |
|
20 | ||
21 |
idp_federation() { |
|
22 |
__sql "select count(entity_id) from saml_libertyprovider where federation_source!='__local'" |
|
23 |
} |
|
24 | ||
25 |
idp_local() { |
|
26 |
__sql "select count(entity_id) from saml_libertyprovider where federation_source='__local'" |
|
27 |
} |
|
28 | ||
29 |
ip_whitelist() { |
|
30 |
cd /usr/local/univnautes/sp |
|
31 |
ctx=$(./manage.py configxml get cpnames | cut -f1 -d" ") |
|
32 |
ipfw -x $ctx table 42 list | wc -l | tr -dc 0-9 |
|
33 |
echo "" |
|
34 |
} |
|
35 | ||
36 |
cp_sessions() { |
|
37 |
/usr/local/univnautes/sp/cp_get_sessions | wc -l | tr -dc 0-9 |
|
38 |
echo "" |
|
39 |
} |
|
40 | ||
41 |
$* |
|
0 |
- |