Statusmail von der Diskstation

Status
Für weitere Antworten geschlossen.

maze128

Benutzer
Mitglied seit
03. Jan 2010
Beiträge
227
Punkte für Reaktionen
0
Punkte
16
Ja,

wie gesagt das ist nicht alles unbedingt sinnvoll, aber wie du gesagt hast: Man kann es ja weg lassen.
Thermalstatus schau ich mir vielleicht mal an wenn ich mal wieder etwas Zeit habe.
 

QTip

Super-Moderator
Teammitglied
Mitglied seit
04. Sep 2008
Beiträge
2.341
Punkte für Reaktionen
13
Punkte
84
Die Systemtemperatur kann man mit folgendem kleinen Skript auslesen:
Rich (BBCode):
#!/bin/sh
#
# get systemp
#
DSIP=""                # IP der Diskstation
USER=""                # Username für Login
PASS=""                # Passwort für Login
RESULT="/tmp/sysinfo"  # temporäre Datei für Ergebnis
SYSTEMP=""             # Variable die im Anschluss die Systemtemperatur enthält
#------------------------------------------------------------------------------

/usr/syno/bin/wget --no-check-certificate --cookies=on --keep-session-cookies --save-cookies=cookie -q -O $RESULT "https://${DSIP}:5001/webman/modules/login.cgi?username=${USER}&passwd=${PASS}"
/usr/syno/bin/wget --no-check-certificate --cookies=on --keep-session-cookies --load-cookies=cookie -q -O $RESULT "https://${DSIP}:5001/webman/modules/SystemInfoApp/SystemInfo.cgi?query=overview"
SYSTEMP=`/bin/cat $RESULT | /bin/grep \""systemp\"" | /usr/bin/cut -d "," -f1 | /usr/bin/cut -d ":" -f2 | /bin/sed 's/^ *//g`
echo $SYSTEMP
rm -f $RESULT
exit 0
 

raymond

Benutzer
Mitglied seit
10. Sep 2009
Beiträge
4.704
Punkte für Reaktionen
21
Punkte
118
Das Script ja ist gut und schön, aber da den Benutzernamen und Passwort in Klartext reinzuschreiben ist nicht wirklich elegant.
Das DSM muss es doch auch irgendwie auslesen. Leider hat Synology noch nicht darauf geantwortet, habe das schonmal nachgefragt.
 

QTip

Super-Moderator
Teammitglied
Mitglied seit
04. Sep 2008
Beiträge
2.341
Punkte für Reaktionen
13
Punkte
84
Das Script ja ist gut und schön, aber da den Benutzernamen und Passwort in Klartext reinzuschreiben ist nicht wirklich elegant.
Das DSM muss es doch auch irgendwie auslesen. Leider hat Synology noch nicht darauf geantwortet, habe das schonmal nachgefragt.
Der DSM liest es genau mit diesem Kommando SystemInfo.cgi?query=overview aus. Er schickt eine Anfrage und erhält die Werte im JSON-Format zurück. Der eigentliche Ausleseteil ist in SystemInfo.cgi enthalten, aber nicht im Klartext lesebar, da kompiliert. Da du es von der Shell aus aufrufst, muss man dem CGI noch die Anmeldeinformationen mitgeben, sonst ist man nicht berechtigt. Ob und mit welchem Commandline-Tool es Synology innerhalb der SystemInfo.cgi ausliest oder es auf direktem Weg durchführt, wäre noch interessant. Womöglich wird Synology dir das nicht verraten, aber hoffen kann man ja ;)
 

raymond

Benutzer
Mitglied seit
10. Sep 2009
Beiträge
4.704
Punkte für Reaktionen
21
Punkte
118
Systemtemperatur auslesen (offizielle Antwort von Synology!)

Sehr geehrter Herr xxxx,

es hat leider ein wenig gedauert, bis wir Ihnen eine Lösung anbieten können. Ich bitte dies zu entschuldigen und freue mich, Ihnen einen Weg vorzustellen:

Unser mantool ist in der Lage, die Systemtemperatur aufzunehmen (SYNOIO_GET_TEMPERATURE)

Auf einer DS, wo noch kein DSM installiert ist, reicht der folgende Befehl, um die Systemtemperatur zu erhalten:

mantool -temperature

Um die Systemtemperatur für ein DSM-System zu erhalten, erklärt die folgende Anleitung, wie man die mantool.glibc ausliest:

mount 192.168.1.181:/synosrc/ds.6281/ /mnt ; cp /mnt/source/juniorinstaller/scemd.glibc /mantool ; umount /mnt;

Die angehängte Datei ist die mantool.glibc binary. Sie enthält:

mantool.6180
mantool.6281
mantool.824x
mantool.853x
mantool.854x
mantool.bromolow
mantool.ppc
mantool.x64

Der Befehl ist für die unterschiedlichen Plattformen unterschiedlich und sie müssen den Entsprechenden für die Plattform Ihrer eigenen DiskStation auswählen, z.B.:

mantool.6281 -temperature

Damit sollte es nun klappen.

mit freundlichen Grüßen, Dennis Schellhase
Synology GmbH

Downloadlink: http://depositfiles.com/files/vv9y0rtcr
 

sinus65

Benutzer
Mitglied seit
19. Jul 2012
Beiträge
207
Punkte für Reaktionen
0
Punkte
0
Hallo,
ich habe versucht die Statusmail auszuführen, was aber nicht geklappt hat, Es ist alles installiert, nail, ipkg, cron. Das Skript habe ich eins zu eins vom wiki in nano kopiert und wurde ins root Verzeichnis gelegt.

Ich habe nur meine Emil ins Script eingefügt.

Nach dem ausführen des Scriptes kommt folgende Meldung

Rich (BBCode):
DiskStation> /root/DSMStatusmail.sh
BusyBox v1.16.1 (2012-07-06 16:11:52 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

Options:
        -H      Add 'filename:' prefix
        -h      Do not add 'filename:' prefix
        -n      Add 'line_no:' prefix
        -l      Show only names of files that match
        -L      Show only names of files that don't match
        -c      Show only count of matching lines
        -o      Show only the matching part of line
        -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
        -v      Select non-matching lines
        -s      Suppress open and read errors
        -r      Recurse
        -i      Ignore case
        -F      PATTERN is a literal (not regexp)
        -E      PATTERN is an extended regexp
        -m N    Match up to N times per file
        -A N    Print N lines of trailing context
        -B N    Print N lines of leading context
        -C N    Same as '-A N -B N'
        -e PTRN Pattern to match
        -f FILE Read pattern from file

/root/DSMStatusmail.sh: line 22: Temperature_Celsius: not found
BusyBox v1.16.1 (2012-07-06 16:11:52 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

Options:
        -H      Add 'filename:' prefix
        -h      Do not add 'filename:' prefix
        -n      Add 'line_no:' prefix
        -l      Show only names of files that match
        -L      Show only names of files that don't match
        -c      Show only count of matching lines
        -o      Show only the matching part of line
        -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
        -v      Select non-matching lines
        -s      Suppress open and read errors
        -r      Recurse
        -i      Ignore case
        -F      PATTERN is a literal (not regexp)
        -E      PATTERN is an extended regexp
        -m N    Match up to N times per file
        -A N    Print N lines of trailing context
        -B N    Print N lines of leading context
        -C N    Same as '-A N -B N'
        -e PTRN Pattern to match
        -f FILE Read pattern from file

/root/DSMStatusmail.sh: line 24: Temperature_Celsius: not found
BusyBox v1.16.1 (2012-07-06 16:11:52 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

Options:
        -H      Add 'filename:' prefix
        -h      Do not add 'filename:' prefix
        -n      Add 'line_no:' prefix
        -l      Show only names of files that match
        -L      Show only names of files that don't match
        -c      Show only count of matching lines
        -o      Show only the matching part of line
        -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
        -v      Select non-matching lines
        -s      Suppress open and read errors
        -r      Recurse
        -i      Ignore case
        -F      PATTERN is a literal (not regexp)
        -E      PATTERN is an extended regexp
        -m N    Match up to N times per file
        -A N    Print N lines of trailing context
        -B N    Print N lines of leading context
        -C N    Same as '-A N -B N'
        -e PTRN Pattern to match
        -f FILE Read pattern from file

/root/DSMStatusmail.sh: line 26: Temperature_Celsius: not found
BusyBox v1.16.1 (2012-07-06 16:11:52 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

Options:
        -H      Add 'filename:' prefix
        -h      Do not add 'filename:' prefix
        -n      Add 'line_no:' prefix
        -l      Show only names of files that match
        -L      Show only names of files that don't match
        -c      Show only count of matching lines
        -o      Show only the matching part of line
        -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
        -v      Select non-matching lines
        -s      Suppress open and read errors
        -r      Recurse
        -i      Ignore case
        -F      PATTERN is a literal (not regexp)
        -E      PATTERN is an extended regexp
        -m N    Match up to N times per file
        -A N    Print N lines of trailing context
        -B N    Print N lines of leading context
        -C N    Same as '-A N -B N'
        -e PTRN Pattern to match
        -f FILE Read pattern from file

/root/DSMStatusmail.sh: line 28: Temperature_Celsius: not found
sed: unmatched '/'
/root/DSMStatusmail.sh: line 42: /tmp/externalIP.result: Permission denied
awk: cmd. line:1: Division by zero
cat: can't open '/var/spool/syno_indexing_queue*': No such file or directory
sh: missing ]
/root/DSMStatusmail.sh: line 47: 100: not found
cat: can't open '/var/spool/thumb_create.queue*': No such file or directory
sh: missing ]
/root/DSMStatusmail.sh: line 49: 100: not found
cat: can't open '/var/spool/flv_create_queue*': No such file or directory
sh: missing ]
/root/DSMStatusmail.sh: line 51: ]: not found
--2012-08-24 18:03:47--  http://www.google.com/ig/api?weather=MEINE_STADT
Resolving www.google.com... 173.194.35.148, 173.194.35.145, 173.194.35.147, ...
Connecting to www.google.com|173.194.35.148|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/xml]
Saving to: `STDOUT'

    [ <=>                                   ] 15          --.-K/s   in 0s

2012-08-24 18:03:48 (671 KB/s) - written to stdout [15]

sed: unmatched '/'
sed: unmatched '/'
/root/DSMStatusmail.sh: line 66: C,: not found
/root/DSMStatusmail.sh: line 66: C,: not found
Cannot convert from ANSI_X3.4-1968 to iso-8859-1
Invalid or incomplete multibyte or wide character
"/root/dead.letter" 1/24
. . . message not sent.

Nun habe ich absolut keine Ahnung von Scriptrn und deren Umsetzung, aber ich lerne :eek:
Laut WIKI: Das Script muss je nach Version der Diskstation noch angepasst werden, besonders die Werte $hours und $temperatur. Daher diese Werte am besten vorher mal im Terminal ausprobieren und schauen ob bei dem verwendeten Befehl etwas sinnvolles raus kommt.

Wenn ich in die Konsole $temperatur eingebe tut sich nichts, genau so wie bei $hours.

Ich habe eine DS212+ DS4.1 Beta, hat jemand von euch vielleicht ein fertiges Skript für die DS212+ oder kann mir jemand sagen wie ich die Fehler in dem o.g Code beseitigen kann?

Gruß und danke
Thomas
 

sinus65

Benutzer
Mitglied seit
19. Jul 2012
Beiträge
207
Punkte für Reaktionen
0
Punkte
0
Hallo,
ich habe versucht die Statusmail auszuführen, was aber nicht geklappt hat, Es ist alles installiert, nail, ipkg, cron. Das Skript habe ich eins zu eins vom wiki in nano kopiert und wurde ins root Verzeichnis gelegt.

Ich habe nur meine Emil ins Script eingefügt.

Nach dem ausführen des Scriptes kommt folgende Meldung

Rich (BBCode):
DiskStation> /root/DSMStatusmail.sh
BusyBox v1.16.1 (2012-07-06 16:11:52 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

Options:
        -H      Add 'filename:' prefix
        -h      Do not add 'filename:' prefix
        -n      Add 'line_no:' prefix
        -l      Show only names of files that match
        -L      Show only names of files that don't match
        -c      Show only count of matching lines
        -o      Show only the matching part of line
        -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
        -v      Select non-matching lines
        -s      Suppress open and read errors
        -r      Recurse
        -i      Ignore case
        -F      PATTERN is a literal (not regexp)
        -E      PATTERN is an extended regexp
        -m N    Match up to N times per file
        -A N    Print N lines of trailing context
        -B N    Print N lines of leading context
        -C N    Same as '-A N -B N'
        -e PTRN Pattern to match
        -f FILE Read pattern from file

/root/DSMStatusmail.sh: line 22: Temperature_Celsius: not found
BusyBox v1.16.1 (2012-07-06 16:11:52 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

Options:
        -H      Add 'filename:' prefix
        -h      Do not add 'filename:' prefix
        -n      Add 'line_no:' prefix
        -l      Show only names of files that match
        -L      Show only names of files that don't match
        -c      Show only count of matching lines
        -o      Show only the matching part of line
        -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
        -v      Select non-matching lines
        -s      Suppress open and read errors
        -r      Recurse
        -i      Ignore case
        -F      PATTERN is a literal (not regexp)
        -E      PATTERN is an extended regexp
        -m N    Match up to N times per file
        -A N    Print N lines of trailing context
        -B N    Print N lines of leading context
        -C N    Same as '-A N -B N'
        -e PTRN Pattern to match
        -f FILE Read pattern from file

/root/DSMStatusmail.sh: line 24: Temperature_Celsius: not found
BusyBox v1.16.1 (2012-07-06 16:11:52 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

Options:
        -H      Add 'filename:' prefix
        -h      Do not add 'filename:' prefix
        -n      Add 'line_no:' prefix
        -l      Show only names of files that match
        -L      Show only names of files that don't match
        -c      Show only count of matching lines
        -o      Show only the matching part of line
        -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
        -v      Select non-matching lines
        -s      Suppress open and read errors
        -r      Recurse
        -i      Ignore case
        -F      PATTERN is a literal (not regexp)
        -E      PATTERN is an extended regexp
        -m N    Match up to N times per file
        -A N    Print N lines of trailing context
        -B N    Print N lines of leading context
        -C N    Same as '-A N -B N'
        -e PTRN Pattern to match
        -f FILE Read pattern from file

/root/DSMStatusmail.sh: line 26: Temperature_Celsius: not found
BusyBox v1.16.1 (2012-07-06 16:11:52 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

Options:
        -H      Add 'filename:' prefix
        -h      Do not add 'filename:' prefix
        -n      Add 'line_no:' prefix
        -l      Show only names of files that match
        -L      Show only names of files that don't match
        -c      Show only count of matching lines
        -o      Show only the matching part of line
        -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
        -v      Select non-matching lines
        -s      Suppress open and read errors
        -r      Recurse
        -i      Ignore case
        -F      PATTERN is a literal (not regexp)
        -E      PATTERN is an extended regexp
        -m N    Match up to N times per file
        -A N    Print N lines of trailing context
        -B N    Print N lines of leading context
        -C N    Same as '-A N -B N'
        -e PTRN Pattern to match
        -f FILE Read pattern from file

/root/DSMStatusmail.sh: line 28: Temperature_Celsius: not found
sed: unmatched '/'
/root/DSMStatusmail.sh: line 42: /tmp/externalIP.result: Permission denied
awk: cmd. line:1: Division by zero
cat: can't open '/var/spool/syno_indexing_queue*': No such file or directory
sh: missing ]
/root/DSMStatusmail.sh: line 47: 100: not found
cat: can't open '/var/spool/thumb_create.queue*': No such file or directory
sh: missing ]
/root/DSMStatusmail.sh: line 49: 100: not found
cat: can't open '/var/spool/flv_create_queue*': No such file or directory
sh: missing ]
/root/DSMStatusmail.sh: line 51: ]: not found
--2012-08-24 18:03:47--  http://www.google.com/ig/api?weather=MEINE_STADT
Resolving www.google.com... 173.194.35.148, 173.194.35.145, 173.194.35.147, ...
Connecting to www.google.com|173.194.35.148|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/xml]
Saving to: `STDOUT'

    [ <=>                                   ] 15          --.-K/s   in 0s

2012-08-24 18:03:48 (671 KB/s) - written to stdout [15]

sed: unmatched '/'
sed: unmatched '/'
/root/DSMStatusmail.sh: line 66: C,: not found
/root/DSMStatusmail.sh: line 66: C,: not found
Cannot convert from ANSI_X3.4-1968 to iso-8859-1
Invalid or incomplete multibyte or wide character
"/root/dead.letter" 1/24
. . . message not sent.

Nun habe ich absolut keine Ahnung von Scriptrn und deren Umsetzung, aber ich lerne :eek:
Laut WIKI: Das Script muss je nach Version der Diskstation noch angepasst werden, besonders die Werte $hours und $temperatur. Daher diese Werte am besten vorher mal im Terminal ausprobieren und schauen ob bei dem verwendeten Befehl etwas sinnvolles raus kommt.

Wenn ich in die Konsole $temperatur eingebe tut sich nichts, genau so wie bei $hours.

Ich habe eine DS212+ DS4.1 Beta, hat jemand von euch vielleicht ein fertiges Skript für die DS212+ oder kann mir jemand sagen wie ich die Fehler in dem o.g Code beseitigen kann?

Gruß und danke
Thomas

Es funktioniert alles, habe mich ein wenig in dem Trehad umgeschaut,
 

sinus65

Benutzer
Mitglied seit
19. Jul 2012
Beiträge
207
Punkte für Reaktionen
0
Punkte
0
Es gibt doch ein kleines Problem, habe zwei USB Platten an der DS212+, die Daten werden auch angezeigt, allerdings nicht die Zuordnung der Laufwerke, bzw die Bezeichnung der LW.
Dann werden die % nicht richtig in der Statuszeile angezeigt.

Rich (BBCode):
Status der Diskstation (DiskStation (DS-212+)) vom 26.08.12 (22:00):
--------------------------------------------

[Speicherplatz in TB]
Groesse Datentraeger: 912.5G
232.8G (hier fehlt "Groesse Datentraeger:" )
298.0G (hier fehlt "Groesse Datentraeger:" )
Freier Speicher: 799.3G
106.1G
96.5G
Belegter Speicher: 113.0G
126.7G Belegter Speicher fehlt 
201.6G (12%  Belegter Speicher fehlt 
54%) falsch zugeordnet
68%falsch zugeordnet

Und ist es möglich die Bezeichnung z.B. "USB3" oder "eSATA" vor der Plattengröße zu setzten?

Ich hoffe das jemand von euch dieses Thema noch abonniert hat und mir helfen kann

Danke
Gruß Thomas
 

maze128

Benutzer
Mitglied seit
03. Jan 2010
Beiträge
227
Punkte für Reaktionen
0
Punkte
16
Die Google Wetter API ist übrigens tot.
Mal schauen ob ich da was neues mache, sehe da besonders im Hinblick auf meine wenige Freizeit aktuell wenig Bedarf :p
Falls jemand Lust und Zeit hast, hier ist eine ganz gute Beschreibung für die API von yahoo.
 

sinus65

Benutzer
Mitglied seit
19. Jul 2012
Beiträge
207
Punkte für Reaktionen
0
Punkte
0
Es gibt doch ein kleines Problem, habe zwei USB Platten an der DS212+, die Daten werden auch angezeigt, allerdings nicht die Zuordnung der Laufwerke, bzw die Bezeichnung der LW.
Dann werden die % nicht richtig in der Statuszeile angezeigt.

Rich (BBCode):
Status der Diskstation (DiskStation (DS-212+)) vom 26.08.12 (22:00):
--------------------------------------------

[Speicherplatz in TB]
Groesse Datentraeger: 912.5G
232.8G (hier fehlt "Groesse Datentraeger:" )
298.0G (hier fehlt "Groesse Datentraeger:" )
Freier Speicher: 799.3G
106.1G
96.5G
Belegter Speicher: 113.0G
126.7G Belegter Speicher fehlt 

201.6G (12%  Belegter Speicher fehlt 
54%) falsch zugeordnet
68%falsch zugeordnet

Und ist es möglich die Bezeichnung z.B. "USB3" oder "eSATA" vor der Plattengröße zu setzten?

Ich hoffe das jemand von euch dieses Thema noch abonniert hat und mir helfen kann

Danke
Gruß Thomas

Hat denn keiner eine Lösung von euch ??
 

sinus65

Benutzer
Mitglied seit
19. Jul 2012
Beiträge
207
Punkte für Reaktionen
0
Punkte
0
Die Systemtemperatur kann man mit folgendem kleinen Skript auslesen:
Rich (BBCode):
#!/bin/sh
#
# get systemp
#
DSIP=""                # IP der Diskstation
USER=""                # Username für Login
PASS=""                # Passwort für Login
RESULT="/tmp/sysinfo"  # temporäre Datei für Ergebnis
SYSTEMP=""             # Variable die im Anschluss die Systemtemperatur enthält
#------------------------------------------------------------------------------

/usr/syno/bin/wget --no-check-certificate --cookies=on --keep-session-cookies --save-cookies=cookie -q -O $RESULT "https://${DSIP}:5001/webman/modules/login.cgi?username=${USER}&passwd=${PASS}"
/usr/syno/bin/wget --no-check-certificate --cookies=on --keep-session-cookies --load-cookies=cookie -q -O $RESULT "https://${DSIP}:5001/webman/modules/SystemInfoApp/SystemInfo.cgi?query=overview"
SYSTEMP=`/bin/cat $RESULT | /bin/grep \""systemp\"" | /usr/bin/cut -d "," -f1 | /usr/bin/cut -d ":" -f2 | /bin/sed 's/^ *//g`
echo $SYSTEMP
rm -f $RESULT
exit 0

Kann ich mir die Daten dann per cronjobs zu schicken lassen?

Habe folgende Änderungen vorgenommen
Rich (BBCode):
#!/bin/sh
#
# get systemp
#
DSIP="IP der DS"
USER="mein User"
PASS="mein Passwort"
RESULT="/tmp/sysinfo"
SYSTEMP="# Variable die im Anschluss die Systemtemperatur enthält ?????????????"             
#------------------------------------------------------------------------------

/usr/syno/bin/wget --no-check-certificate --cookies=on --keep-session-cookies --save-cookies=cookie -q -O $RESULT "https://${DSIP}:5001/webman/modules/login.cgi?username=${USER}&passwd=${PASS}"
/usr/syno/bin/wget --no-check-certificate --cookies=on --keep-session-cookies --load-cookies=cookie -q -O $RESULT "https://${DSIP}:5001/webman/modules/SystemInfoApp/SystemInfo.cgi?query=overview"
SYSTEMP=`/bin/cat $RESULT | /bin/grep \""systemp\"" | /usr/bin/cut -d "," -f1 | /usr/bin/cut -d ":" -f2 | /bin/sed 's/^ *//g`
echo $SYSTEMP
rm -f $RESULT
# exit 0

echo "$nachricht" | /opt/bin/nail -s "Systemtemperatur" meine Mailadresse
echo 2 >/dev/ttyS1
 
Zuletzt bearbeitet:

sinus65

Benutzer
Mitglied seit
19. Jul 2012
Beiträge
207
Punkte für Reaktionen
0
Punkte
0
#!/bin/sh
#
# get systemp
#
DSIP="I192.168.178.5"
USER="admin"
PASS="xxxxxxxxxxxxxx"
RESULT="/tmp/sysinfo"
SYSTEMP=" hier habe ich nichts stehen weil ich die Variable nicht kenne
#------------------------------------------------------------------------------

/usr/syno/bin/wget --no-check-certificate --cookies=on --keep-session-cookies --save-cookies=cookie -q -O $RESULT "https://${DSIP}:5001/webman/modules/login.cgi?username=${USER}&passwd=${PASS}"
/usr/syno/bin/wget --no-check-certificate --cookies=on --keep-session-cookies --load-cookies=cookie -q -O $RESULT "https://${DSIP}:5001/webman/modules/SystemInfoApp/SystemInfo.cgi?query=overview"
SYSTEMP=`/bin/cat $RESULT | /bin/grep \""systemp\"" | /usr/bin/cut -d "," -f1 | /usr/bin/cut -d ":" -f2 | /bin/sed 's/^ *//g`
echo $SYSTEMP
rm -f $RESULT
# exit 0

echo "$nachricht" | /opt/bin/nail -s "Systemtemperatur" meine Mailadresse@.de
echo 2 >/dev/ttyS1



eine Mail wird versendet wenn ich bei Telnet /root/Systemtemperatur.sh eingebe, nur ist sie leer, klar wenn ich die Variable nicht kenne

Nachricht
 

maze128

Benutzer
Mitglied seit
03. Jan 2010
Beiträge
227
Punkte für Reaktionen
0
Punkte
16
Bei $SYSTEMP musst du auch nichts stehen haben, die wird ja später beschrieben.
Ein Grund wieso deine Nachricht leer sein könnte ist schon mal der, dass du unten die Nachricht verschickst mit
echo "$nachricht", die $Nachricht hast du allerdings nirgendwo mit irgendwas beschrieben.

Folglich ist die Nachricht auch leer, schau dir doch mal mein Script aus dem Anfang des Threads an, da siehst du wie du die
Variable Nachricht füllen/beschreiben kannst.

Grüße
 

sinus65

Benutzer
Mitglied seit
19. Jul 2012
Beiträge
207
Punkte für Reaktionen
0
Punkte
0
Muss alles wieder neu machen, habe die DS4.1 heute installiert es ist alles außer cronjobs weg :-(
 

Tommes

Benutzer
Sehr erfahren
Maintainer
Mitglied seit
26. Okt 2009
Beiträge
9.155
Punkte für Reaktionen
1.116
Punkte
314
Hi!

Da du ja sowieso nochmal von vorne anfangen mußt...

Gib mal auf der Konsole folgendes ein...

Code:
df -h

... und poste mal das Ergebnis hier! Ich hab da nämlich auch mal ein wenig rumgespielt und auch schon ein Ergebnis. Ich weiß jedoch nicht, ob das, was ich geändert habe, allgemeingültig ist.

Tommes!
 

sinus65

Benutzer
Mitglied seit
19. Jul 2012
Beiträge
207
Punkte für Reaktionen
0
Punkte
0
DiskStation> df -h
Filesystem Size Used Available Use% Mounted on
/dev/md0 2.3G 522.0M 1.7G 23% /
/tmp 249.7M 680.0K 249.0M 0% /tmp
/dev/vg1/volume_1 912.5G 124.1G 788.3G 14% /volume1
/dev/sds1 298.0G 201.6G 96.5G 68% /volumeUSB1/usbshare
DiskStation>



Kann nichts damit anfangen :)
 

Tommes

Benutzer
Sehr erfahren
Maintainer
Mitglied seit
26. Okt 2009
Beiträge
9.155
Punkte für Reaktionen
1.116
Punkte
314
Eigentlich ist es ganz einfach (wenn man das Prinzip erstmal verstanden hat)!

df -h gibt den freien Speicherplatz deiner Laufwerke aus! Und wenn du dir die Ausgabe deiner Anfrage mal anschaust, erkennst du, das die Zeile "/dev/vg1/volume_1 912.5G 124.1G 788.3G 14% /volume1" dein zu Verfügung stehender Speicherplatz deiner TB-Festplatte ist (also Volume1), die du eingebaut hast, richtig? Eine zweite HDD hast du in deiner DS-212(+) nicht eingebaut, richtig!

Wenn du dir jetzt die Zeile(n) aus dem Script anschaust, die für die Ausgabe des Speicherplatzes zuständig sind...

Rich (BBCode):
filesystem1=`df -h | grep /opt | awk '{print $6}'`
size1=`df -h | grep /opt | awk '{print $2}'`
used1=`df -h | grep /opt | awk '{print $3}'`
available1=`df -h | grep /opt | awk '{print $4}'`
percent1=`df -h | grep /opt | awk '{print $5}'`

... und du dir dann den Tipp von Götz aus Beitrag #25 anschaust...

Zitat von Goetz: ...Versuch doch mal /opt durch /volu zu ersetzen, /volume1 sollte ja immer gemounted sein...

... dann könntest du ja mal vergleichen, welche Deklarierung dein Laufwerk, bei bei deiner Ausgabe von "df -h" hat! Im Zuge dessen, könntest du auch mal im Internet nach den Befehlen df - grep und awk suchen, dann verstehst du bestimmt auch, wie das ganze zusammen hängt.

Ob das jetzt der Richtig Weg ist, weiß ich nicht (kenn mich mit Linux auch nicht wirklich aus) aber bei mir hat es dazu geführt, das ich meine beiden HDD's ganz nett, getrennt von einander auswerten kann und das ist die Hauptsache! Da du aber andere Laufwerksbezeichnungen hast, als ich, gibt es hier wohl keine allgemeingültige Aussage bzw. Vorgehensweise. Man muß halt den Pfad zum Laufwerk immer seinen Bedürfnissen anpassen.

Alle Klarheiten beseitigt?

Tommes!
 

sinus65

Benutzer
Mitglied seit
19. Jul 2012
Beiträge
207
Punkte für Reaktionen
0
Punkte
0
ich habe zwei identische Festplatten in einem RAID 0 am laufen, wenn RAID 0 die direkte Sicherung von Daten ist. Also ich schreibe auf die Master Platte und die Sichert die Daten direkt auf die zweite Platte, ist glaube ich RAID 0, ich glaube deswegen wird die zweite nicht angezeigt, im Festplattenmanager sehe ich die beiden auf jeden Fall.
 

Tommes

Benutzer
Sehr erfahren
Maintainer
Mitglied seit
26. Okt 2009
Beiträge
9.155
Punkte für Reaktionen
1.116
Punkte
314
Unabhängig von dem Script, was du ans laufen bekommen möchtest, solltest du schon wissen, was für ein RAID du verwendest!

Tommes!
 
Status
Für weitere Antworten geschlossen.
 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat