Beiträge: 287
Geburtstag: 18.09.
Geschlecht: Männlich
Beruf: Administrator
Anzahl Nagios-Server: 1
Nagios-Version(en): 3.2.3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 338
Anzahl Services: 5070
Betriebssystem(e): Debian
Plugin-Version(en): 1.4.xx
Sonstige Addon's: OMD 0.46
1
18.08.2011, 12:41
Beiträge: 55
Anzahl Nagios-Server: 10
Nagios-Version(en): 3
Verteiltes Monitoring: Ja
Redundantes Monitoring: Nein
Anzahl-Hosts: 500
Anzahl Services: 1000
Betriebssystem(e): Windows, Linux
Plugin-Version(en): n.a.
NDO-Version: 10
2
19.08.2011, 09:43
Beiträge: 287
Geburtstag: 18.09.
Geschlecht: Männlich
Beruf: Administrator
Anzahl Nagios-Server: 1
Nagios-Version(en): 3.2.3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 338
Anzahl Services: 5070
Betriebssystem(e): Debian
Plugin-Version(en): 1.4.xx
Sonstige Addon's: OMD 0.46
3
19.08.2011, 13:48
Quellcode |
|
1 2 3 4 5 6 7 8 |
[global]
only_from = 127.0.0.1 10.204.65.2
[winperf]
counters = 10332:msx_queues
[plugins]
windows_updates.vbs = 3600 # 1 mal pro Stunde
|
ayk
Anfänger
Beiträge: 19
Geschlecht: Männlich
Anzahl Nagios-Server: 1
Nagios-Version(en): OMD 0.48 Nagios 3.2.3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 2
Anzahl Services: 50
Betriebssystem(e): CentOS 5.5 x86_64
Plugin-Version(en): 1.4.15
NagVis-Version: 1.5.9
NDO-Version: 1
4
19.08.2011, 14:14
Beiträge: 287
Geburtstag: 18.09.
Geschlecht: Männlich
Beruf: Administrator
Anzahl Nagios-Server: 1
Nagios-Version(en): 3.2.3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 338
Anzahl Services: 5070
Betriebssystem(e): Debian
Plugin-Version(en): 1.4.xx
Sonstige Addon's: OMD 0.46
ayk
Anfänger
Beiträge: 19
Geschlecht: Männlich
Anzahl Nagios-Server: 1
Nagios-Version(en): OMD 0.48 Nagios 3.2.3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 2
Anzahl Services: 50
Betriebssystem(e): CentOS 5.5 x86_64
Plugin-Version(en): 1.4.15
NagVis-Version: 1.5.9
NDO-Version: 1
6
19.08.2011, 15:04
Beiträge: 446
Geschlecht: Männlich
Wohnort: München
Anzahl Nagios-Server: 8
Hobbys: Jiu Jitsu, Klettern, MTB, Reisen
Nagios-Version(en): OMD 0.48
Verteiltes Monitoring: Ja
Redundantes Monitoring: Ja
Anzahl-Hosts: >4.000
Anzahl Services: >80.000
Betriebssystem(e): Linux, AIX, Windows
Plugin-Version(en): OMD 0.48
7
19.08.2011, 21:42
Zitat von »ayk«
Etwa:
if uhrzeit == 13:15 then "starte im Hintergrund VB Skript"
Beiträge: 55
Anzahl Nagios-Server: 10
Nagios-Version(en): 3
Verteiltes Monitoring: Ja
Redundantes Monitoring: Nein
Anzahl-Hosts: 500
Anzahl Services: 1000
Betriebssystem(e): Windows, Linux
Plugin-Version(en): n.a.
NDO-Version: 10
8
22.08.2011, 11:21
Quellcode |
|
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 58 59 60 61 62 63 64 65 66 67 68 69 70 |
' --------------------------------------------------------------------------------------------------------------
' windows_updates2log.vbs - check_mk agent plugin to monitor pending windows updates and put output into logfile
'
' To use this just place it in the plugins/ directory below the path of the
' check_mk_agent. After that an inventory run on the Nagios host should lead
' to a new inventorized service.
'
' Author: Lars Michelsen <>, 2011-03-21
' Edito: Patrick Schlüter <>, 2011-08-21
' --------------------------------------------------------------------------------------------------------------
Option Explicit
Dim result, reboot, numImp, numOpt, important, opti
Dim updtSearcher, colDownloads, objEntry
Dim objFSO, objFile
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("windows_updates-log.txt")
objFile.WriteLine("<<
|
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
OFF REM -------------------------------------------------------------------------------------------------- REM windows_updates_from_log.bat - check_mk agent plugin to monitor pending windows updates inderectly REM REM To use this just place it in the plugins/ directory below the path of the REM check_mk_agent. After that an inventory run on the Nagios host should lead REM to a new inventorized service. REM REM Author: Patrick Schlüter <>, 2011-08-21 REM -------------------------------------------------------------------------------------------------- TYPE "..\tasks\windows_updates-log.txt" |
Beiträge: 287
Geburtstag: 18.09.
Geschlecht: Männlich
Beruf: Administrator
Anzahl Nagios-Server: 1
Nagios-Version(en): 3.2.3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 338
Anzahl Services: 5070
Betriebssystem(e): Debian
Plugin-Version(en): 1.4.xx
Sonstige Addon's: OMD 0.46
9
22.08.2011, 13:18
Zitat
Was wäre, wenn man folgendes machen würde:
Dein windows_updates2log.vbs Script wieder in check_mk/plugins platzieren (die BAT entfällt). Ganz am Anfang des Scripts eine if-Abfrage einbauen, die Prüft, ob es eine windows_updates-log.txt gibt, die nicht älter als X Stunden ist.
Ist sie älter, wird ein letztes mal der Inhalt der Logdatei an check_mk übergeben und sofort danach eine neue Datei (im Hintergrund um, den Agent nicht zu bremsen) generiert.
Ist sie jünger, wird der Inhalt der TXT-Datei an den Agent übergeben und der Rest des Scripts übersprunken.
Beiträge: 55
Anzahl Nagios-Server: 10
Nagios-Version(en): 3
Verteiltes Monitoring: Ja
Redundantes Monitoring: Nein
Anzahl-Hosts: 500
Anzahl Services: 1000
Betriebssystem(e): Windows, Linux
Plugin-Version(en): n.a.
NDO-Version: 10
10
23.08.2011, 13:43
Quellcode |
|
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 |
' -----------------------------------------------------------------------------------------
' windows_updates.vbs - check_mk agent plugin to monitor pending windows updates indirectly
'
' To use this just place it in the plugins/ directory below the path of the
' check_mk_agent. After that an inventory run on the Nagios host should lead
' to a new inventorized service.
'
' Author: Lars Michelsen <>, 2011-03-21
' Editor: Patrick Schlüter <>, 2011-08-21
' -----------------------------------------------------------------------------------------
Option Explicit
Dim result, reboot, numImp, numOpt, important, opti
Dim updtSearcher, colDownloads, objEntry
Dim objFSO, objFile
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Dim lastModificationDate
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
Dim ts, TextLine
If objFSO.FileExists(WSHShell.CurrentDirectory & "\windows-update\windows_updates-log.txt") Then
'MSGBox("Datei windows_updates-log.txt existiert!")
lastModificationDate = objFSO.GetFile(WSHShell.CurrentDirectory & "\windows-update\windows_updates-log.txt").DateLastModified
if DateDiff("n", lastModificationDate, now) > (60*24) Then '60 Minuten mal 24 Stunden
Set ts = objFSO.GetFile(WSHShell.CurrentDirectory & "\windows-update\windows_updates-log.txt").OpenAsTextStream(1, -2)
Do While ts.AtEndOfStream <> True
WScript.Echo ts.ReadLine
Loop
ts.Close
WSHShell.Run("wscript " & WSHShell.CurrentDirectory & "\windows-update\windows_updates2log.vbs")
Else
Set ts = objFSO.GetFile(WSHShell.CurrentDirectory & "\windows-update\windows_updates-log.txt").OpenAsTextStream(1, -2)
Do While ts.AtEndOfStream <> True
WScript.Echo ts.ReadLine
Loop
ts.Close
end If
Else
WSHShell.Run("wscript " & WSHShell.CurrentDirectory & "\windows-update\windows_updates2log.vbs")
End If
WScript.Quit()
|
Quellcode |
|
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 58 59 60 61 62 63 64 65 66 67 68 69 |
' -----------------------------------------------------------------------------------------
' windows_updates.vbs - check_mk agent plugin to monitor pending windows updates indirectly
'
' To use this just place it in the plugins/ directory below the path of the
' check_mk_agent. After that an inventory run on the Nagios host should lead
' to a new inventorized service.
'
' Author: Lars Michelsen <>, 2011-03-21
' Editor: Patrick Schlüter <>, 2011-08-21
' -----------------------------------------------------------------------------------------
Option Explicit
Dim result, reboot, numImp, numOpt, important, opti
Dim updtSearcher, colDownloads, objEntry
Dim objFSO, objFile
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
Set objFile = objFSO.CreateTextFile(WSHShell.CurrentDirectory & "/windows-update/windows_updates-log.txt")
objFile.WriteLine("<<
|
Beiträge: 287
Geburtstag: 18.09.
Geschlecht: Männlich
Beruf: Administrator
Anzahl Nagios-Server: 1
Nagios-Version(en): 3.2.3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 338
Anzahl Services: 5070
Betriebssystem(e): Debian
Plugin-Version(en): 1.4.xx
Sonstige Addon's: OMD 0.46
11
23.08.2011, 15:01
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 |
.
|-- check_mk.ini
|-- check_mk_agent.exe
|-- crash.exe
|-- local
| `-- foldercount.bat
`-- plugins
|-- windows-update
| `-- windows_updates2log.vbs
`-- windows_updatesViaLogCheck.vbs
|
Zitat
Die Skriptdatei c:\programme\check_mk\windows-update\windows_updates2log.vbs wurde nicht gefunden
Beiträge: 55
Anzahl Nagios-Server: 10
Nagios-Version(en): 3
Verteiltes Monitoring: Ja
Redundantes Monitoring: Nein
Anzahl-Hosts: 500
Anzahl Services: 1000
Betriebssystem(e): Windows, Linux
Plugin-Version(en): n.a.
NDO-Version: 10
12
23.08.2011, 15:15
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
. |-- check_mk.ini |-- check_mk_agent.exe |-- crash.exe |-- local | `-- foldercount.bat |-- plugins | `-- windows_updatesViaLogCheck.vbs |-- windows-update | `-- windows_updates2log.vbs |
Beiträge: 55
Anzahl Nagios-Server: 10
Nagios-Version(en): 3
Verteiltes Monitoring: Ja
Redundantes Monitoring: Nein
Anzahl-Hosts: 500
Anzahl Services: 1000
Betriebssystem(e): Windows, Linux
Plugin-Version(en): n.a.
NDO-Version: 10
13
24.08.2011, 12:57
Beiträge: 287
Geburtstag: 18.09.
Geschlecht: Männlich
Beruf: Administrator
Anzahl Nagios-Server: 1
Nagios-Version(en): 3.2.3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 338
Anzahl Services: 5070
Betriebssystem(e): Debian
Plugin-Version(en): 1.4.xx
Sonstige Addon's: OMD 0.46
14
24.08.2011, 13:42
Zitat von »Patrick_Schlueter«
Kann mir jemand sagen, wie ich die Skripte vom Agent aus starten kann, ohne den totalen Pfad zum Skript anzugeben, der kann ja schliesslich variieren?
Quellcode |
|
1 |
WSHShell.Run("wscript " & WSHShell.CurrentDirectory & "\windows-update\windows_updates2log.vbs")
|
Quellcode |
|
1 |
WSHShell.Run("wscript " & WSHShell.CurrentDirectory & "..\windows-update\windows_updates2log.vbs")
|
Beiträge: 55
Anzahl Nagios-Server: 10
Nagios-Version(en): 3
Verteiltes Monitoring: Ja
Redundantes Monitoring: Nein
Anzahl-Hosts: 500
Anzahl Services: 1000
Betriebssystem(e): Windows, Linux
Plugin-Version(en): n.a.
NDO-Version: 10
15
24.08.2011, 13:52
Beiträge: 287
Geburtstag: 18.09.
Geschlecht: Männlich
Beruf: Administrator
Anzahl Nagios-Server: 1
Nagios-Version(en): 3.2.3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 338
Anzahl Services: 5070
Betriebssystem(e): Debian
Plugin-Version(en): 1.4.xx
Sonstige Addon's: OMD 0.46
16
24.08.2011, 16:36
Zitat von »Patrick_Schlueter«
Also wenn ich den Agent vom NAgiosserver aus Abfrage, klappt das mit dem relativen Pfad irgendwie nicht.
Quellcode |
|
1 2 3 4 5 6 |
set fs = CreateObject("Scripting.FilesystemObject")
scriptname = Wscript.ScriptFullName
scriptpath = fs.getparentfoldername(scriptname)
msgbox scriptpath
|
ayk
Anfänger
Beiträge: 19
Geschlecht: Männlich
Anzahl Nagios-Server: 1
Nagios-Version(en): OMD 0.48 Nagios 3.2.3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 2
Anzahl Services: 50
Betriebssystem(e): CentOS 5.5 x86_64
Plugin-Version(en): 1.4.15
NagVis-Version: 1.5.9
NDO-Version: 1
Beiträge: 287
Geburtstag: 18.09.
Geschlecht: Männlich
Beruf: Administrator
Anzahl Nagios-Server: 1
Nagios-Version(en): 3.2.3
Verteiltes Monitoring: Nein
Redundantes Monitoring: Nein
Anzahl-Hosts: 338
Anzahl Services: 5070
Betriebssystem(e): Debian
Plugin-Version(en): 1.4.xx
Sonstige Addon's: OMD 0.46
Beiträge: 55
Anzahl Nagios-Server: 10
Nagios-Version(en): 3
Verteiltes Monitoring: Ja
Redundantes Monitoring: Nein
Anzahl-Hosts: 500
Anzahl Services: 1000
Betriebssystem(e): Windows, Linux
Plugin-Version(en): n.a.
NDO-Version: 10
19
25.08.2011, 12:08
Beiträge: 55
Anzahl Nagios-Server: 10
Nagios-Version(en): 3
Verteiltes Monitoring: Ja
Redundantes Monitoring: Nein
Anzahl-Hosts: 500
Anzahl Services: 1000
Betriebssystem(e): Windows, Linux
Plugin-Version(en): n.a.
NDO-Version: 10
Quellcode |
|
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 |
' -----------------------------------------------------------------------------------------
' windows_updates.vbs - check_mk agent plugin to monitor pending windows updates indirectly
'
' To use this just place it in the plugins/ directory below the path of the
' check_mk_agent. After that an inventory run on the Nagios host should lead
' to a new inventorized service.
'
' Author: Lars Michelsen <>, 2011-03-21
' Editor: Patrick Schlüter <>, 2011-08-21
' -----------------------------------------------------------------------------------------
Option Explicit
Dim result, reboot, numImp, numOpt, important, opti
Dim updtSearcher, colDownloads, objEntry
Dim objFSO, objFile
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Dim lastModificationDate
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
Dim scriptname, scriptpath
scriptname = Wscript.ScriptFullName
scriptpath = objFSO.getparentfoldername(scriptname)
Dim ts, TextLine
If objFSO.FileExists(scriptpath &"\windows-update\windows_updates-log.txt") Then
lastModificationDate = objFSO.GetFile(scriptpath &"\windows-update\windows_updates-log.txt").DateLastModified
if DateDiff("n", lastModificationDate, now) > (60*24) Then '60 Minuten mal 24 Stunden
Set ts = objFSO.GetFile(scriptpath &"\windows-update\windows_updates-log.txt").OpenAsTextStream(1, -2)
Do While ts.AtEndOfStream <> True
WScript.Echo ts.ReadLine
Loop
ts.Close
WSHShell.Run(scriptpath &"\windows-update\windows_updates2log.vbs")
Else
Set ts = objFSO.GetFile(scriptpath &"\windows-update\windows_updates-log.txt").OpenAsTextStream(1, -2)
Do While ts.AtEndOfStream <> True
WScript.Echo ts.ReadLine
Loop
ts.Close
end If
Else
WSHShell.Run(scriptpath &"\windows-update\windows_updates2log.vbs")
End If
WScript.Quit()
|
Quellcode |
|
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 58 59 60 61 62 63 64 65 66 67 68 |
' -----------------------------------------------------------------------------
' windows_updates.vbs - check_mk agent plugin to monitor pending windows updates
'
' To use this just place it in the plugins/ directory below the path of the
' check_mk_agent. After that an inventory run on the Nagios host should lead
' to a new inventorized service.
'
' Author: Lars Michelsen <>, 2011-03-21
' Editor: Patrick Schlüter <>, 2011-08-24
' -----------------------------------------------------------------------------
Option Explicit
Dim result, reboot, numImp, numOpt, important, opti
Dim updtSearcher, colDownloads, objEntry
Dim objFSO, objFile
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Dim scriptname, scriptpath
scriptname = Wscript.ScriptFullName
scriptpath = objFSO.getparentfoldername(scriptname)
Set objFile = objFSO.CreateTextFile(scriptpath &"\windows_updates-log.txt")
If CreateObject("Microsoft.Update.AutoUpdate").DetectNow <> 0 Then
objFile.WriteLine("<<
|