[DzVents] Supervision d'un nas Synology avec SNMP

Vous avez créé un script LUA dont vous êtes fier, un .sh génial, un programme Python hors du commun, un Tuto, c'est ici que vous pouvez les partager.
manuloup
Messages : 781
Inscription : 18 févr. 2015, 13:05

Re: [DzVents] Supervision d'un nas Synology avec SNMP

Message par manuloup »

Bonjour à tous,

Je viens de récupérer le script version 1.41 et j'essaie de l'adapter mais je galère sur le raid status.

J'arrive à récupérer la valeur (1 , qui vaut "normal"), mais je ne sais pas comment la transformer pour la sauver ensuite dans le device NAS_RAID_STATUS qui correspond.

J'ai essayé ceci mais je n'ai pas encore réussi à obtenir ce que je souhaite :

Code : Tout sélectionner

        if results[1]  then
           Raid_Status = (results[1] )
            if Raid_Status==1 then Raid_Status='Normal'
		     elseif Raid_Status==2 then uservariables['Raid_Status_Text'] ='Repairing'
		     elseif Raid_Status==3 then uservariables['Raid_Status_Text'] ='Migrating'
		     elseif Raid_Status==4 then uservariables['Raid_Status_Text'] ='Expanding'
		     elseif Raid_Status==5 then uservariables['Raid_Status_Text'] ='Deleting'
		     elseif Raid_Status==6 then uservariables['Raid_Status_Text'] ='Creating'
		     elseif Raid_Status==7 then uservariables['Raid_Status_Text'] ='RaidSyncing'
		     elseif Raid_Status==8 then uservariables['Raid_Status_Text'] ='RaidParityChecking'
		     elseif Raid_Status==9 then uservariables['Raid_Status_Text'] ='RaidAssembling'
		     elseif Raid_Status==10 then uservariables['Raid_Status_Text'] ='Canceling'
		         
		    end
           dz.log("Raid_Status : "..Raid_Status,dz.LOG_DEBUG)
           if NAS_RAID_STATUS ~= nil then dz.devices(NAS_RAID_STATUS).update(0,Raid_Status_Text) 
           end
        end
Je précise que le device est un dummy text, et que mon NAS est un DS920+ avec DSM7.

Dommage, je ne suis plus très loin.
2022-08-18 230741.jpg
2022-08-18 230741.jpg (254.81 Kio) Consulté 1797 fois
Synology DS920+ avec VM Debian 12, Aeon Labs Z-Stick Gen5, Aeon Zwave et devices zwaves , Teleinfo USB, devices Zigbee, batterie Marstek Venus E, Shelly Pro 3EM...
denis_brasseur
Messages : 898
Inscription : 24 déc. 2018, 17:05
Localisation : (26)

Re: [DzVents] Supervision d'un nas Synology avec SNMP

Message par denis_brasseur »

Bizarre ton code
Tu commence par

Code : Tout sélectionner

if Raid_Status==1 then Raid_Status='Normal'
Puis tu enchaine avec

Code : Tout sélectionner

elseif Raid_Status==2 then uservariables['Raid_Status_Text'] ='Repairing'
Et enfin tu fais la mise à jour du device avec

Code : Tout sélectionner

dz.devices(NAS_RAID_STATUS).update(0,Raid_Status_Text) 
Pi3 + DD PiDrive - RFXtrx433 - AEON Labs ZW090
manuloup
Messages : 781
Inscription : 18 févr. 2015, 13:05

Re: [DzVents] Supervision d'un nas Synology avec SNMP

Message par manuloup »

L'idée est mettre le text correspondant à la valeur : Normale pour 1 , etc..

J'utilise la variable Raid_Status_Text pour récupérer le texte correspondant, et je mets à jour le device Raid_Status pour mettre ce texte dans le device domoticz correspondant (NAS_RAID_STATUS)

Mais hélas ça ne marche pas.
Synology DS920+ avec VM Debian 12, Aeon Labs Z-Stick Gen5, Aeon Zwave et devices zwaves , Teleinfo USB, devices Zigbee, batterie Marstek Venus E, Shelly Pro 3EM...
denis_brasseur
Messages : 898
Inscription : 24 déc. 2018, 17:05
Localisation : (26)

Re: [DzVents] Supervision d'un nas Synology avec SNMP

Message par denis_brasseur »

La syntaxe de

Code : Tout sélectionner

elseif Raid_Status==2 then uservariables['Raid_Status_Text'] ='Repairing'
ne devrait pas plutot etre

Code : Tout sélectionner

elseif Raid_Status==2 then dz.variables('Raid_Status_Text').set('Repairing')
Et la syntaxe de

Code : Tout sélectionner

if NAS_RAID_STATUS ~= nil then dz.devices(NAS_RAID_STATUS).update(0,Raid_Status_Text) 
ne devrait pas plutot etre

Code : Tout sélectionner

if NAS_RAID_STATUS ~= nil then dz.devices(NAS_RAID_STATUS).update(0,dz.variables('Raid_Status_Text').value) 
?
Pi3 + DD PiDrive - RFXtrx433 - AEON Labs ZW090
manuloup
Messages : 781
Inscription : 18 févr. 2015, 13:05

Re: [DzVents] Supervision d'un nas Synology avec SNMP

Message par manuloup »

Merci Denis pour ton aide, c'est justement ce que je cherchais.
Je suis en congés une semaine, je teste à mon retour.
Synology DS920+ avec VM Debian 12, Aeon Labs Z-Stick Gen5, Aeon Zwave et devices zwaves , Teleinfo USB, devices Zigbee, batterie Marstek Venus E, Shelly Pro 3EM...
ouf746
Messages : 4
Inscription : 30 nov. 2022, 16:39

Re: [DzVents] Supervision d'un nas Synology avec SNMP

Message par ouf746 »

Bonjour, Pouvez vous me partager votre script le mien fonctionne pas, la ram l'espace disque ne fonctionne pas ..
Keros
Messages : 6638
Inscription : 23 juil. 2019, 20:57

Re: [DzVents] Supervision d'un nas Synology avec SNMP

Message par Keros »

Bonjour ouf746 et bienvenu sur le forum :)

Il faut essayer de comprendre pourquoi il ne fonctionne pas ? J'ai écrit des petits guides dans ma présentation dont un concernant le déboguage (lien dans ma signature).

Pour t'aider, nous avons besoin de voir a minima le script que tu essayes d'utiliser et les logs correspondants.
Comment bien utiliser le forum : Poser une question, Mettre un script, un fichier, une image ou des logs
Mes petits guides : Débuter en programmation, Le débogage, Le choix de matériel, Les sauvegardes
Ma présentation - Mes Tutos
ouf746
Messages : 4
Inscription : 30 nov. 2022, 16:39

Re: [DzVents] Supervision d'un nas Synology avec SNMP

Message par ouf746 »

Bonjour merci voici le log :

Code : Tout sélectionner

2022-12-02 13:37:00.364 Status: dzVents: Info: Synology Monitor v1.41 : ------ Start internal script: Synology:, trigger: "every minute"
2022-12-02 13:37:00.366 Status: dzVents: Debug: Synology Monitor v1.41 : last ifHCOutOctets : 4196024264 at 360 seconds ago
2022-12-02 13:37:00.366 Status: dzVents: Debug: Synology Monitor v1.41 : last ifHCInOctets : 366356497 at 360 seconds ago
2022-12-02 13:37:00.673 Status: dzVents: Debug: Synology Monitor v1.41 : NASTemp : 41
2022-12-02 13:37:00.692 Status: dzVents: Debug: Synology Monitor v1.41 : Processing device-adapter for Home-station Temp Système: Temperature device adapter
2022-12-02 13:37:00.693 Status: dzVents: Debug: Synology Monitor v1.41 : HDUnit : 1024
2022-12-02 13:37:00.693 Status: dzVents: Debug: Synology Monitor v1.41 : HDTotal : 7989392
2022-12-02 13:37:00.693 Status: dzVents: Debug: Synology Monitor v1.41 : HDUsed : 7767732
2022-12-02 13:37:00.693 Status: dzVents: Debug: Synology Monitor v1.41 : CpuUser : 25
2022-12-02 13:37:00.693 Status: dzVents: Debug: Synology Monitor v1.41 : CpuSystem : 0
2022-12-02 13:37:00.693 Status: dzVents: Debug: Synology Monitor v1.41 : HDTotalGo : 0.01
2022-12-02 13:37:00.693 Status: dzVents: Debug: Synology Monitor v1.41 : HDFreeGo : 0.0
2022-12-02 13:37:00.695 Status: dzVents: Debug: Synology Monitor v1.41 : Processing device-adapter for Home-station Espace disque libre: Custom sensor device adapter
2022-12-02 13:37:00.695 Status: dzVents: Debug: Synology Monitor v1.41 : HDFreePercent : 97
2022-12-02 13:37:00.696 Status: dzVents: Debug: Synology Monitor v1.41 : Processing device-adapter for Home-station Espace disque: Percentage device adapter
2022-12-02 13:37:00.697 Status: dzVents: Debug: Synology Monitor v1.41 : CpuUsed : 25.0
2022-12-02 13:37:00.697 Status: dzVents: Debug: Synology Monitor v1.41 : Processing device-adapter for Home-station CPU: Percentage device adapter
2022-12-02 13:37:00.698 Status: dzVents: Debug: Synology Monitor v1.41 : memTotalSwap: 6893484
2022-12-02 13:37:00.698 Status: dzVents: Debug: Synology Monitor v1.41 : memTotalReal: 7989392
2022-12-02 13:37:00.698 Status: dzVents: Debug: Synology Monitor v1.41 : memTotalFree: 5688332
2022-12-02 13:37:00.698 Status: dzVents: Debug: Synology Monitor v1.41 : MemUsedPercent : 62
2022-12-02 13:37:00.699 Status: dzVents: Debug: Synology Monitor v1.41 : Processing device-adapter for Home-station RAM: Percentage device adapter
2022-12-02 13:37:00.699 Status: dzVents: Debug: Synology Monitor v1.41 : HDTemp1 : 33
2022-12-02 13:37:00.699 Status: dzVents: Debug: Synology Monitor v1.41 : Processing device-adapter for Home-station Temp HD1: Temperature device adapter
2022-12-02 13:37:00.700 Status: dzVents: Debug: Synology Monitor v1.41 : HDTemp2 : 21
2022-12-02 13:37:00.700 Status: dzVents: Debug: Synology Monitor v1.41 : Processing device-adapter for Home-station Temp SSD1: Temperature device adapter
2022-12-02 13:37:00.700 Status: dzVents: Debug: Synology Monitor v1.41 : HDTemp3 : 22
2022-12-02 13:37:00.702 Status: dzVents: Debug: Synology Monitor v1.41 : Processing device-adapter for Home-station Temp SSD2: Temperature device adapter
2022-12-02 13:37:00.702 Status: dzVents: Debug: Synology Monitor v1.41 : HDTemp4 : No Such Instance currently exists at this OID
2022-12-02 13:37:00.702 Status: dzVents: Debug: Synology Monitor v1.41 : ifHCOutOctets : 4196244503
2022-12-02 13:37:00.702 Status: dzVents: Debug: Synology Monitor v1.41 : ifHCInOctets : 366511571
2022-12-02 13:37:00.702 Status: dzVents: Debug: Synology Monitor v1.41 : Upload : 1ko/s, Download : 0ko/s
2022-12-02 13:37:00.702 Status: dzVents: Debug: Synology Monitor v1.41 : Requete SNMP correcte
2022-12-02 13:37:00.703 Status: dzVents: Debug: Synology Monitor v1.41 : Processing device-adapter for Home-station: Switch device adapter
2022-12-02 13:37:00.703 Status: dzVents: Debug: Synology Monitor v1.41 : Constructed timed-command: On
2022-12-02 13:37:00.704 Status: dzVents: Info: Synology Monitor v1.41 : ------ Finished Synology
les températures des disques sont bon par contre la ram + cpu + espace disque sont pas bons.
Voici le script que j'utilise :

Code : Tout sélectionner

 local NAS_TEMP = "Home-station Temp Système"
    local NAS_CPU = "Home-station CPU"              -- NAS CPU 
    local NAS_MEM = "Home-station RAM"              -- NAS MEM 
    local NAS_HD_SPACE_PERC = "Home-station Espace disque"  -- NAS HD Space  in %
    local NAS_HD_SPACE = "Home-station Espace disque libre"       -- NAS HD Space  in Go (custom sensor)
    local NAS_HDD1_TEMP = "Home-station Temp HD1"              -- NAS HD1 Temp, nil if unused 
    local NAS_HDD2_TEMP = "Home-station Temp SSD1"                              -- NAS HD2 Temp, nil if unused
    local NAS_HDD3_TEMP = "Home-station Temp SSD2"                               -- NAS HD3 Temp, nil if unused
    local NAS_HDD4_TEMP = nil                               -- NAS HD4 Temp, nil if unused
	local NAS_UPLOAD    = nil                               -- NAS upload in ko/s, nil if unused
	local NAS_DOWNLOAD   = nil                               -- NAS download in ko/s, nil if unused
    local OID_NAS_TEMP = '1.3.6.1.4.1.6574.1.2.0'
    local OID_HDUnit = '1.3.6.1.2.1.25.2.3.1.4.1'          -- OID HD Unit Change OID to .38 on DSM 5.1 or .41 on DSM 6.0+ or .51 on my DS218
    local OID_HDTotal = '1.3.6.1.2.1.25.2.3.1.5.1'         -- OID Total space volume in Go Change OID to .38 on DSM 5.1 or .41 on DSM 6.0+ or .51 on my DS218
    local OID_HDUsed = '1.3.6.1.2.1.25.2.3.1.6.1'          -- OID Space used volume in Go Change OID to .38 on DSM 5.1 or .41 on DSM 6.0+ or .51 on my DS218
    
    
    
    
    
    
    
    local OID_CpuUser = '1.3.6.1.4.1.2021.11.9.0'           -- OID CPU user
    local OID_CpuSystem = '1.3.6.1.4.1.2021.11.10.0'        -- OID CPU System
    local OID_MemAvailable = '1.3.6.1.4.1.2021.4.13.0'      -- OID Free Memory Available
    local OID_MemTotalSwap = '1.3.6.1.4.1.2021.4.3.0'       -- OID MemTotalSwap
    local OID_MemTotalReal = '1.3.6.1.4.1.2021.4.5.0'       -- OID MemTotalReal
    local OID_MemTotalFree = '1.3.6.1.4.1.2021.4.11.0'      -- OID MemTotalFree
    local OID_HDtemp1 = '1.3.6.1.4.1.6574.2.1.1.6.0'        -- OID Temperature HDD1   
    local OID_HDtemp2 = '1.3.6.1.4.1.6574.2.1.1.6.1'        -- OID Temperature HDD2 
    local OID_HDtemp3 = '1.3.6.1.4.1.6574.2.1.1.6.2'        -- OID Temperature HDD3
    local OID_HDtemp4 = '1.3.6.1.4.1.6574.2.1.1.6.3'        -- OID Temperature HDD4
	local OID_ifHCOutOctets = '1.3.6.1.2.1.2.2.1.16.3'		-- OID ifHCOutOctets if not work try 1.3.6.1.2.1.2.2.1.16.1 or 1.3.6.1.2.1.2.2.1.16.2
	local OID_ifHCInOctets = '1.3.6.1.2.1.2.2.1.10.3'		-- OID ifHCInOctets if not work try 1.3.6.1.2.1.2.2.1.10.1 or 1.3.6.1.2.1.2.2.1.10.2
    --local OID_Raid_Status = '1.3.6.1.4.1.6574.3.1.1.3.0'        -- OID Raid Status
    --local OID_Physical_Memory_Units = '1.3.6.1.2.1.25.2.3.1.4.1'
    --local OID_Physical_Memory_Size = '1.3.6.1.2.1.25.2.3.1.5.1'
    --local OID_Physical_Memory_Used = '1.3.6.1.2.1.25.2.3.1.6.1'
    --local OID_system_memory_total = '1.3.6.1.4.1.2021.4.5.0'
    --local OID_system_memory_free = '1.3.6.1.4.1.2021.4.6.0'
    --local OID_system_vsmemory_shared = '1.3.6.1.4.1.2021.4.13.0'
    --local OID_system_vsmemory_buffer = '1.3.6.1.4.1.2021.4.14.0'

   
return {
    active = true,
    on = {
    timer = {'every minute'}
    },    
   -- on = { devices = { "your trigger device" }},
        
  logging =   {    level    =    domoticz.LOG_DEBUG,                                             -- Seulement un niveau peut être actif; commenter les autres
                -- level    =   domoticz.LOG_INFO,                                            -- Only one level can be active; comment others
                -- level    =   domoticz.LOG_ERROR,
                -- level    =   domoticz.LOG_MODULE_EXEC_INFO,
                   marker    =   "Synology Monitor v1.41 "      },
 	data = {
 		ifHCInOctets =  { history = true, maxItems = 2 },
		ifHCOutOctets = { history = true, maxItems = 2 },
	},
    execute = function(dz)
		local i, lastIfHCInOctets, lastIfHCOutOctets, ifHCInSecondsAgo, IfHCOutSecondsAgo, upload, download, round, results = 0, 0, 0, 0, 0, 0, 0, dz.utils.round, {}
		dz.data.ifHCOutOctets.add('0')
		dz.data.ifHCInOctets.add('0')
	
		if dz.data.ifHCOutOctets.getOldest() ~= nil then 
			lastIfHCOutOctets = dz.data.ifHCOutOctets.getOldest().data 
			ifHCOutSecondsAgo = dz.data.ifHCOutOctets.getOldest().time.secondsAgo
		end
		if dz.data.ifHCInOctets.getOldest() ~= nil then 
			lastIfHCInOctets = dz.data.ifHCInOctets.getOldest().data
			ifHCInSecondsAgo = dz.data.ifHCInOctets.getOldest().time.secondsAgo 
		end	
		dz.log("last ifHCOutOctets : "..tostring(lastIfHCOutOctets).." at "..tostring(ifHCOutSecondsAgo).." seconds ago",dz.LOG_DEBUG) 	
		dz.log("last ifHCInOctets : "..tostring(lastIfHCInOctets).." at "..tostring(ifHCInSecondsAgo).." seconds ago",dz.LOG_DEBUG) 
		
		
		
       local command = 'snmpget -v 2c -c '..CommunityPassword..' -O qv '..NasIp..' '..OID_NAS_TEMP..' '..OID_HDUnit..' '..OID_HDTotal..' '..OID_HDUsed..' '..OID_CpuUser..' '..OID_CpuSystem..' '
			..OID_MemAvailable ..' '.. OID_MemTotalSwap ..' '..OID_MemTotalReal..' '..OID_MemTotalFree..' '..OID_HDtemp1..' '..OID_HDtemp2..' '..OID_HDtemp3..' '..OID_HDtemp4..' '..OID_ifHCOutOctets..' '
			..OID_ifHCInOctets --..' '..OID_Physical_Memory_Units ..' '..OID_Physical_Memory_Used..' '..OID_Physical_Memory_Size ..' '..OID_system_memory_total ..' '..OID_system_memory_free ..' '.. OID_system_vsmemory_shared ..' '.. OID_system_vsmemory_buffer 
        local handle = assert(io.popen(command))
        for line in handle:lines() do
            results[i] =  format(line)
            i = i + 1
        end
        handle:close()
        if results[0] then
            dz.log("NASTemp : "..results[0],dz.LOG_DEBUG)
            if NAS_TEMP then dz.devices(NAS_TEMP).update(0,results[0]) end
            end
        if results[1] then dz.log("HDUnit : "..results[1],dz.LOG_DEBUG) end
        if results[2] then dz.log("HDTotal : "..results[2],dz.LOG_DEBUG) end
        if results[3] then dz.log("HDUsed : "..results[3],dz.LOG_DEBUG) end
        if results[4] then dz.log("CpuUser : "..results[4],dz.LOG_DEBUG) end
        if results[5] then dz.log("CpuSystem : "..results[5],dz.LOG_DEBUG) end
        
        if results[1] and results[2] then

           HDTotalGo = dz.utils.round((results[2] *  results[1] / 1024 / 1024 / 1024/1024),2)
           dz.log("HDTotalGo : "..HDTotalGo,dz.LOG_DEBUG)
        end
         if results[1] and results[3] then
           HDUsedGo = dz.utils.round(((results[3]) *  results[1] / 1024 / 1024 / 1024/1024), 2)
        end       

        if results[1] and results[2] and results[3] then
            HDFreeGo = dz.utils.round(((results[2] - results[3]) *  results[1] / 1024 / 1024 / 1024/1024),2)
        end
        if HDFreeGo then 
            dz.log("HDFreeGo : "..HDFreeGo,dz.LOG_DEBUG) 
            dz.devices(NAS_HD_SPACE).update(0,HDFreeGo)
            end 
        if results[2] and results[3] then         
            HDFreePerc = dz.utils.round(((results[3] * 100) / results[2]), 0)
        end
        if HDFreePerc then 
            dz.log("HDFreePercent : "..HDFreePerc,dz.LOG_DEBUG)
            dz.devices(NAS_HD_SPACE_PERC).update(0,HDFreePerc)
            end
        if results[4] and results[5] then
            CpuUsed = (results[4] + results[5])
        end
        if CpuUsed then 
            dz.log("CpuUsed : "..CpuUsed,dz.LOG_DEBUG)
            dz.devices(NAS_CPU).update(0,CpuUsed)
            end

        if results[7] then
            dz.log("memTotalSwap: "..tostring(results[7]),dz.LOG_DEBUG)
        end
        if results[8] then
            dz.log("memTotalReal: "..tostring(results[8]),dz.LOG_DEBUG)
        end
        if results[9] then
            dz.log("memTotalFree: "..tostring(results[9]),dz.LOG_DEBUG)
        end

        if results[7] and results[8] and results[9] then
            MemUsedPerc = dz.utils.round(100-results[9]*100/(results[7]+results[8]), 0)
        end
        if MemUsedPerc then 
            dz.log("MemUsedPercent : "..MemUsedPerc,dz.LOG_DEBUG)
            dz.devices(NAS_MEM).update(0,MemUsedPerc)
        end

        if results[10] then 
            dz.log("HDTemp1 : "..tostring(results[10]),dz.LOG_DEBUG) 
            if NAS_HDD1_TEMP ~= nil then dz.devices(NAS_HDD1_TEMP).update(0,results[10]) end
        end
        if results[11] then 
            dz.log("HDTemp2 : "..tostring(results[11]),dz.LOG_DEBUG) 
            if NAS_HDD2_TEMP ~= nil then dz.devices(NAS_HDD2_TEMP).update(0,results[11]) end
        end
        if results[12] then 
            dz.log("HDTemp3 : "..tostring(results[12]),dz.LOG_DEBUG) 
            if NAS_HDD3_TEMP ~= nil then dz.devices(NAS_HDD3_TEMP).update(0,results[12]) end
        end
        if results[13] then 
            dz.log("HDTemp4 : "..tostring(results[13]),dz.LOG_DEBUG) 
            if NAS_HDD4_TEMP ~= nil then dz.devices(NAS_HDD4_TEMP).update(0,results[13]) end
        end

        if results[14] then 
            dz.log("ifHCOutOctets : "..tostring(results[14]),dz.LOG_DEBUG) 
			dz.data.ifHCOutOctets.add(tostring(results[14]))
			if tonumber(lastIfHCOutOctets) > 0 and tonumber(results[14]) > tonumber(lastIfHCOutOctets) then upload = round(((tonumber(results[14]) - tonumber(lastIfHCOutOctets)) / tonumber(ifHCOutSecondsAgo) / 1024)) end
			if NAS_UPLOAD ~= nil then dz.devices(NAS_UPLOAD).update(0,tostring(upload)) end
		end
        if results[15] then 
            dz.log("ifHCInOctets : "..tostring(results[15]),dz.LOG_DEBUG) 
			dz.data.ifHCInOctets.add(tostring(results[15]))	
			if tonumber(lastIfHCInOctets) > 0 and tonumber(results[15]) > tonumber(lastIfHCInOctets) then download = round(((tonumber(results[15]) - tonumber(lastIfHCInOctets)) / tonumber(ifHCInSecondsAgo) / 1024)) end
			if NAS_DOWNLOAD ~= nil then dz.devices(NAS_DOWNLOAD).update(0,tostring(download)) end		
		end

		dz.log("Upload : "..tostring(upload).."ko/s, Download : "..tostring(download).."ko/s",dz.LOG_DEBUG) 


        if results[0] and results[5] and results[6] then
                dz.log("Requete SNMP correcte ",dz.LOG_DEBUG)
                dz.devices(NAS).switchOn().checkFirst()
            else
                dz.log("Requete SNMP incorrecte ",dz.LOG_DEBUG)
                dz.devices(NAS).switchOff().checkFirst()
            end

        --RAID Status :
        --OK(1), Repairing(2), Migrating(3), Expanding(4), Deleting(5), Creating(6), RaidSyncing(7), RaidParityChecking(8), RaidAssembling(9), Canceling(10), Degraded(11), Creashed(12)
    end
}
Pièces jointes
Capture d’écran 2022-12-02 à 13.43.30.png
Capture d’écran 2022-12-02 à 13.43.30.png (79.02 Kio) Consulté 1366 fois
Capture d’écran 2022-12-02 à 13.43.18.png
Capture d’écran 2022-12-02 à 13.43.18.png (98.08 Kio) Consulté 1366 fois
Capture d’écran 2022-12-02 à 13.40.50.png
Capture d’écran 2022-12-02 à 13.40.50.png (42.94 Kio) Consulté 1366 fois
Keros
Messages : 6638
Inscription : 23 juil. 2019, 20:57

Re: [DzVents] Supervision d'un nas Synology avec SNMP

Message par Keros »

Merci pour les précisions : on comprend mieux les soucis que tu rencontres.

N'ayant pas de Synology, je ne pourrais pas t'aider plus. Désolé
Comment bien utiliser le forum : Poser une question, Mettre un script, un fichier, une image ou des logs
Mes petits guides : Débuter en programmation, Le débogage, Le choix de matériel, Les sauvegardes
Ma présentation - Mes Tutos
denis_brasseur
Messages : 898
Inscription : 24 déc. 2018, 17:05
Localisation : (26)

Re: [DzVents] Supervision d'un nas Synology avec SNMP

Message par denis_brasseur »

ouf746 a écrit : 30 nov. 2022, 16:45 Bonjour, Pouvez vous me partager votre script le mien fonctionne pas, la ram l'espace disque ne fonctionne pas ..
Pour l'espace disque, s'agissant d'une valeur calculée, vu la valeur brute affichée, tu peux modifier le calcul comme ci dessous

Code : Tout sélectionner

if results[1] and results[2] then

   HDTotalGo = dz.utils.round((results[2] *  results[1] / 1024 / 1024 / 1024),2)
   dz.log("HDTotalGo : "..HDTotalGo,dz.LOG_DEBUG)
end
 if results[1] and results[3] then
   HDUsedGo = dz.utils.round(((results[3]) *  results[1] / 1024 / 1024 / 1024), 2)
end       

if results[1] and results[2] and results[3] then
	HDFreeGo = dz.utils.round(((results[2] - results[3]) *  results[1] / 1024 / 1024 / 1024),2)
end

Pi3 + DD PiDrive - RFXtrx433 - AEON Labs ZW090
Répondre