How-to force perfmon counters description to be in english ?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How-to force perfmon counters description to be in english ?

    Hi,

    I try to set Zabbix Agent on an Windows Server French.
    All the perfcounters are not supported because they are in english on the Template_Windows and the OS is french !
    If a rewrite all the items by put the french equivalence it's OK ... but a bit long !

    Do you know if I can force my French OS to accept PerfCounters requests in English ???

    Thanks,

    #2
    There is an article in MS KB about these problems - see http://support.microsoft.com/kb/q287159/. It should be possible for the agent to convert the English counter names to their localized versions.

    Comment


      #3
      Hi,

      I've the same problem with perfCounter in French.

      write all the items by put the french equivalence it's OK ... but a bit long !
      It's not possible : Zabbix doesn't support special char (UTF-8) at this moment !

      [Fix:
      it seem that direct edit of mySQL database work
      UPDATE `zabbix`.`items` SET `key_` = 'perf_counter[\\Disque logique(C: )\\% Temps écriture du disque]'
      WHERE `items`.`itemid` =29201 ;]


      My idea is to force it to LangID=009 (English).
      Do you have any solution or any idea ??

      Set a regKey in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\ ?

      (see http://www.zabbix.com/forum/showthread.php?t=9405)

      Best regards,
      Pierre
      Last edited by pierre-hoffmann; 29-05-2008, 12:04.
      P.Hoffmann
      System & Network Admin.
      __________________________
      Zabbix version 1.8.1
      Hosts monitored 1300
      OS Novell SLES 10 SP2
      __________________________

      Comment


        #4
        You can change your Perflib counters description in Registry Database

        You can change your Perflib counters description in the Windows Registry Database.

        Copy the value of your key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009\Counter" ((009)english description)
        to your "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\00C\Counter" ((00C) french version)

        and then restart your Windows Zabbix Agent.

        Pros:
        • Your Zabbix Windows template is now OK with your French Windows server
        • You don't need special char for any perf_counter anymore


        Cons:
        • You need to edit Registry Database on all your Windows servers



        Enjoy !

        Comment


          #5
          Hello sebthebert !

          This sounds like a great workaround for us French users. Unfortunately, I can't seem to be able to edit those keys in perflib !

          I tried with the local administrator account and verified the hives permissions, I have total control on them but can't edit anything inside the 009 and 00C directory.

          Any advices ? ^^

          Runing Win2K8 Enterprise.

          Thanks !

          Comment


            #6
            Originally posted by sebthebert View Post
            You can change your Perflib counters description in the Windows Registry Database.

            Copy the value of your key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009\Counter" ((009)english description)
            to your "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\00C\Counter" ((00C) french version)

            and then restart your Windows Zabbix Agent.

            Pros:
            • Your Zabbix Windows template is now OK with your French Windows server
            • You don't need special char for any perf_counter anymore


            Cons:
            • You need to edit Registry Database on all your Windows servers



            Enjoy !
            Hi,

            i've try this and it seem it work fine !!
            Thank you !

            Regards,
            P.Hoffmann
            System & Network Admin.
            __________________________
            Zabbix version 1.8.1
            Hosts monitored 1300
            OS Novell SLES 10 SP2
            __________________________

            Comment


              #7
              Well if you know the id of the performance counter then you can setup you templates numeric like in these examples:

              CPU-Usage-Core1
              Code:
              perf_counter[\238(0)\6]
              CPU-Usage-Core2
              Code:
              perf_counter[\238(1)\6]
              Regards

              Wolfgang

              P.S. The zabbix manual has a chapter about this where also the commandline tool used to get the id's, is mentioned.
              http://www.intellitrend.de
              Specialised in monitoring large environments and Zabbix API programming.

              Comment


                #8
                Here we launche a vbs script to gather the datas:

                Sample user parameters in zabbix_agentd.conf on windows 2003:
                Code:
                UserParameter=reseau.bandepassante,cscript //Nologo c:\zabbix\interface.vbs "\Interface réseau(Intel[R] PRO_1000 MT Network Connection)\Bande passante actuelle"
                UserParameter=reseau.octets_recus,cscript //Nologo c:\zabbix\interface.vbs "\Interface réseau(Intel[R] PRO_1000 MT Network Connection)\Octets reçus/s"
                UserParameter=reseau.octets_envoyes,cscript //Nologo c:\zabbix\interface.vbs "\Interface réseau(Intel[R] PRO_1000 MT Network Connection)\Octets envoyés/s"
                UserParameter=reseau.total_octets,cscript //Nologo c:\zabbix\interface.vbs "\Interface réseau(Intel[R] PRO_1000 MT Network Connection)\Total des octets/s"
                Here's the interface.vbs script:
                Code:
                'Recuperation des compteurs de performance d'un OS francais dans Zabbix 
                'Dans zabbix_agentd.conf :
                '  UserParameter=Zab_Object_Name,cscript //Nologo interface.vbs "nom_du_compteur"
                
                
                
                Dim objShell
                Dim objObject
                Dim strTargetObject
                Dim strCmd
                Dim strReport, strAry
                
                Set objShell = CreateObject("WScript.Shell")
                Set objObject = WScript.Arguments
                strTargetObject = objObject(0)
                strCmd = "typeperf """ & strTargetObject & """ -sc 1"
                
                Set objScriptExec = objShell.Exec(strCmd)
                strReport = objScriptExec.StdOut.ReadAll
                strAry = Split(strReport, CHR(13))
                strReport = strAry(2)
                strAry = Split(strReport, ",")
                strReport = strAry(1)
                strReport = Mid(strReport, 2, Len(strReport)-2)
                wscript.echo strReport
                Hope this helps!

                Comment


                  #9
                  solution

                  I know it's an old thread. I'm writing this for those still struggling with this problem , .

                  I had the same problem as someone else editing the counter registry value. It did not let me do it.

                  Here's what I did to translate everything in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\00C to english.

                  Move the files (for backup) :
                  c:\windows\system32\perf*00C.dat to c:\windows\system32\perf*00C_bak.dat

                  Copy the files :
                  c:\windows\system32\perf*009.dat to c:\windows\system32\perf*00C.dat

                  Reboot not necessary

                  Using numbers to access the counters is not satisfactory because the numbers for each counters are not always the same from Windows to Windows. This fixed my problem.

                  ------------------------------

                  UPDATE : the previous methode didn't work very well. Sometimes, performance counter would be accessible, and sometimes not. So I decided to fix this problem differently. I created UserParameter on the zabbix agent for each counter that I wanted to monitor.

                  I created an autoit script that gets the number associated associated to the counter and create a UserParameter. Here's the script (sorry, the comments are in french):

                  -----------

                  Code:
                  ;Sert à créer des UserParameter pour l'accès aux compteurs de performance Windows. Il est possible d'aller chercher les
                  ;valeurs autrement en utilisant directement l'item perf_counter à partir du serveur Zabbix.  Le problème que ce script
                  ;veut solutionner est que les compteurs de performance Windows doivent être appellé par leur nom, sous la langue du OS.
                  ;Donc, le même compteur devra être appellé différemment si le Windows est français ou anglais.
                  ;Pour contourner cette difficulté, Windows permet de faire appel aux compteurs en utilisant des chiffres (qui sont associés aux noms).
                  ;Le problème est que les chiffres sont souvent différents d'un Windows à l'autre.
                  ;Ce script permet de faire appel aux compteurs de performance en utilisant des UserParameter, qui eux font appel à l'item perf_counter
                  ;en utilisant les chiffres utilisé par le Windows sur lequel nous exécutons ce script.
                  
                  ;Le script est assez intelligent pour ne pas ajouter de UserParameter pour les compteurs qu'il ne trouve pas sur le Windows.
                  
                  $chaine_racine = "msperfmon"
                  $emplacement_fichier_config = $dossier_installation_agent & "\zabbix_agentd.conf"
                  
                  ;Windows standard
                  $elements = $chaine_racine & '.nb_sessions_TS,perf_counter["\Terminal Services()\Active Sessions"]'  & @CR & _
                  			$chaine_racine & '.processor_pct,perf_counter["\Processor(_Total)\% Processor Time"]'  & @CR & _
                  			$chaine_racine & '.disk_queue_length,perf_counter["\PhysicalDisk(_Total)\Current Disk Queue Length"]' & @CR & _
                  			$chaine_racine & '.disk_pct_time,perf_counter["\PhysicalDisk(_Total)\% Disk Time"]' & @CR & _
                  			$chaine_racine & '.page_faults_sec,perf_counter["\Memory()\Page Faults/sec"]'
                  
                  ;Microsoft Exchange 2010
                  $elements = $elements & @CR & $chaine_racine & '.MSExch_process_store_private_bytes,perf_counter["\Process(store)\Private Bytes"]'  & @CR & _
                  			$chaine_racine & '.MSExch_LDAP_timed_out_minute,perf_counter["\MSExchange ADAccess Domain Controllers(*)\LDAP Searches Timed Out per Minute"]'  & @CR & _
                  			$chaine_racine & '.MSExch_LDAP_long_running_minute,perf_counter["\MSExchange ADAccess Domain Controllers(*)\Long Running LDAP Operations/min"]' & @CR & _
                  			$chaine_racine & '.MSExch_LDAP_read_time,perf_counter["\MSExchange ADAccess Domain Controllers(*)\LDAP Read Time"]' & @CR & _
                   			$chaine_racine & '.MSExch_database_page_fault_stalls_sec,perf_counter["\Database(*)\Database Page Fault Stalls/sec"]' & @CR & _ ;normalement, c'est (Information Store) qui devait être en parenthèses et non (*), mais (Information Store) ne fonctionnait pas
                  			$chaine_racine & '.MSExch_database_cache_size,perf_counter["\Database(*)\Database Cache Size"]' & @CR & _ ;normalement, c'est (Information Store) qui devait être en parenthèses et non (*), mais (Information Store) ne fonctionnait pas
                  			$chaine_racine & '.MSExch_messages_delivered_sec,perf_counter["\MSExchangeIS Mailbox(_Total)\Messages Delivered/sec"]' & @CR & _
                  			$chaine_racine & '.MSExch_messages_sent_sec,perf_counter["\MSExchangeIS Mailbox(_Total)\Messages Sent/sec"]' & @CR & _
                  			$chaine_racine & '.MSExch_messages_submitted_sec,perf_counter["\MSExchangeIS Mailbox(_Total)\Messages Submitted/sec"]' & @CR & _
                  			$chaine_racine & '.MSExch_active_client_logons,perf_counter["\MSExchangeIS Mailbox(_Total)\Active Client Logons"]' & @CR & _
                  			$chaine_racine & '.MSExch_local_deliveries,perf_counter["\MSExchangeIS Mailbox(_Total)\Local deliveries"]' & @CR & _
                  			$chaine_racine & '.MSExch_messages_sent_count,perf_counter["\MSExchangeIS Mailbox(_Total)\Messages Sent"]' & @CR & _
                  			$chaine_racine & '.MSExch_replication_receive_queue_size,perf_counter["\MSExchangeIS Public(_Total)\Replication Receive Queue Size"]' & @CR & _
                  			$chaine_racine & '.MSExch_user_count,perf_counter["\MSExchangeIS()\User Count"]' & @CR & _
                  			$chaine_racine & '.MSExch_user_count_active,perf_counter["\MSExchangeIS()\Active User Count"]' & @CR & _
                  			$chaine_racine & '.MSExch_client_rpc_failed_server_too_busy,perf_counter["\MSExchangeIS()\Client: RPCs Failed: Server Too Busy"]' & @CR & _
                  			$chaine_racine & '.MSExch_client_rpc_failed_server_too_busy_sec,perf_counter["\MSExchangeIS()\Client: RPCs Failed: Server Too Busy/sec"]' & @CR & _
                  			$chaine_racine & '.MSExch_rpc_client_backoff_sec,perf_counter["\MSExchangeIS()\RPC Client Backoff/sec"]' & @CR & _
                  			$chaine_racine & '.MSExch_rpc_average_latency,perf_counter["\MSExchangeIS Client(*)\RPC Average Latency"]' & @CR & _
                  			$chaine_racine & '.MSExch_rpc_operations_sec,perf_counter["\MSExchangeIS Client(*)\RPC Operations/sec"]' & @CR & _
                  			$chaine_racine & '.MSExch_jet_pages_read_sec,perf_counter["\MSExchangeIS Client(*)\JET Pages Read/sec"]' & @CR & _
                  			$chaine_racine & '.MSExch_jet_log_records_sec,perf_counter["\MSExchangeIS Client(*)\JET Log Records/sec"]' & @CR & _
                  			$chaine_racine & '.MSExch_LDAP_reads_sec,perf_counter["\MSExchangeIS Client(*)\Directory Access: LDAP Reads/sec"]' & @CR & _
                  			$chaine_racine & '.MSExch_LDAP_searches_sec,perf_counter["\MSExchangeIS Client(*)\Directory Access: LDAP Searches/sec"]' & @CR & _
                  			$chaine_racine & '.MSExch_LDAP_search_time,perf_counter["\MSExchange ADAccess Domain Controllers(*)\LDAP Search Time"]'  & @CR & _
                  			$chaine_racine & '.MSExch_active_connection_count,perf_counter["\MSExchangeIS()\Active Connection Count"]'
                  			;$chaine_racine & '.MSExch_,perf_counter["\"]'
                  
                  $elements = StringSplit($elements,@CR)
                  
                  Dim $sText = FileRead($emplacement_fichier_config)
                  
                  $counters = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009","Counter")
                  
                  for $i=1 to ubound($elements)-1 step 1
                  	;msgbox(1,'test',$elements[$i])
                  	$array_premier = StringRegExp($elements[$i],'\\(.*)\(',2)
                  	$result_premier = @error
                      $array_deuxieme = StringRegExp($elements[$i],'\)\\(.+)"',2)
                  	$result_deuxieme = @error
                  
                  	if $result_premier=0  and $result_deuxieme=0 Then
                  		$niveau1_chaine = $array_premier[1]
                  		$niveau2_chaine = $array_deuxieme[1]
                  
                  		$array_premier = StringRegExp($counters,'(\d+)\n' & $niveau1_chaine & '\n', 2)
                  		$result_premier = @error ;si à 0, trouvé, sinon pas trouvé
                  		$array_deuxieme = StringRegExp($counters,'(\d+)\n' & $niveau2_chaine & '\n', 2)
                  		$result_deuxieme = @error ;si à 0, trouvé, sinon pas trouvé
                  
                  		if $result_premier=0  and $result_deuxieme=0 Then
                  			$niveau1_chiffre = $array_premier[1]
                  			$niveau2_chiffre = $array_deuxieme[1]
                  
                  			$chaine_remplace = StringRegExpReplace($elements[$i],$niveau1_chaine,$niveau1_chiffre,1)
                  			$chaine_remplace = StringRegExpReplace($chaine_remplace,$niveau2_chaine,$niveau2_chiffre,1)
                  
                  			$array_split = StringSplit($chaine_remplace,',')
                  			$zabbix_key = $array_split[1]
                  			$zabbix_perfcounter = $array_split[2]
                  
                  			;vérification pour voir si le UserParameter existe déjà.  Si n'existe pas, alors on le crée
                  			if not StringRegExp($sText,'UserParameter=' & $zabbix_key) then
                  				;Creation du UserParameter
                  				$ligne_zabbixconf = "UserParameter=" & $zabbix_key & "," & $dossier_installation_agent & "\zabbix_get.exe -s 127.0.0.1 -k " & $zabbix_perfcounter & @CRLF
                  				$sText = $sText & $ligne_zabbixconf
                  			endif
                  		endif
                  	endif
                  
                  next
                  
                  if FileExists($emplacement_fichier_config) Then
                  	Dim $hFile = FileOpen($emplacement_fichier_config, 2)
                  	FileWrite($hFile, $sText)
                  	FileClose($hFile)
                  endif
                  
                  RunWait(@ComSpec & " /c " & 'net stop "Zabbix Agent"', "", @SW_HIDE)
                  sleep(500)
                  RunWait(@ComSpec & " /c " & 'net start "Zabbix Agent"', "", @SW_HIDE)
                  -----------

                  The reason I'm doing all this is because I have about half my Windows that are french, and the other half english, and I want to apply the same Zabbix templates on both. Without that method, I would have to configure templates for the french Windows, and other templates for the english Windows.
                  Last edited by mfecteau; 17-05-2012, 17:31. Reason: Better way to fix the problem

                  Comment


                    #10
                    Windows 2003 : attention au (*)

                    Pour info : ne pas utiliser le (*) dans les perf counters sous Windows 2003, cela retourner souvent 0. Mieux vaut utiliser l'unitaire ou le (_Total)

                    Comment

                    Announcement

                    Collapse
                    No announcement yet.
                    Working...
                    X