Answer format error:'lines' is null

Hello,
I am creating a monitoring server on ubuntu with icinga2 and i downloaded nsclient++ on a windows client to monitor with check_nt.
But my problem is that when i use a command i got an error message:
UNKNOWN: Answer format error: ‘lines’ is Null.l
the command i got is:
image
and the issue is the same when i want to test the command in the plugins directory, i’m asking your help, this is blocking me for days and i don’t really know whet to do.
Thank you.

Hi,

please add the output of icinga2 --version as well as extract the executed command line.

Cheers,
Michael

Hi, this is what i get when i use --version:
image
thank for your answer.

check_nt is not nscp_api!

check_nscp_api requires NSclient v0.5 at least.
Here is some information about the integration with Icinga2: https://icinga.com/2016/09/16/nsclient-0-5-0-rest-api-and-icinga-2-integration/
Here you find the “history” of check_nscp_api: https://github.com/Icinga/icinga2/pull/5239

If you want to use check_nt you will have to use the nscp command in Icinga2 for it and then build your service templates and service around that.

2 Likes

i already downloaded nsclient 0.5 to try if it works and i got a message : useddiskspace unknown command so i searched and i didin’t find what is the command for checking disk space or memuse or all those querys.
If i wanted to kep my 0.4 version and use check_nt i don’t know exactly what do i got to write in my service.conf pls could you explain me or show me a template if you can.
thank you very much for your help.

or maybe i have to create some code in an other file, i’m a bit lost if you could help me it would be very nice from you.
thank you

Please add the executed command line I had asked before. This will help analyse the problem.

I have no experience with using the nscp/check_nt command.
Check the docs (Icinga ITL: https://icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/#nscp & Check script: https://www.monitoring-plugins.org/doc/man/check_nt.html) for the needed variables and build a service similar to what you posted in your initial post, just with the changed check command and variables.

can you explain me what is that command i dont really understand?

Please add the solution you’ve found to this topic. There’s no need to flag the initial post here.

Not really a solution but i passed this and i got an othe problem on the next step.
i downloaded version 0.4.4.23 of NsClient++and i decided to use check_nt have this code:
image
but in icinga2 i have
image
and when i use the command in my linux interface it works and shows me the dik space on the host i want.
i think it’s a coding error from me but i can’t find where i’m wrong if i need to put something more or remove something.
Thanks.

Can you please share the command from your Linux shell? Maybe the configuration does not align with what’s executed.

Cheers,
Michael


There is the command and what it returns.
Thank you

Difference is, that you specify the -w and -c parameters in your icinga check and don’t set them in your command line example.
The output will be the same, if you and them there as well.
So either remove the warning/critical thresolds from you icinga check or check if you have to enable arguments in the nsclient.ini to have -w and -c parameters working.

2 Likes

I don’t really get it, i removed warning and critiacl arguments in my services.conf and i got the same result.
and i don’t know how to remove warning/critical from check or enable aguments in my nsclient.ini .
i don’t know where this file is located and don’t know what to write in it.
thanks for your help.

or maybe i have to create a template in my templates.conf where i’ll set a command line example but i really don’t the way to write this code if this is the thing i have to do could you show me an example or something to help i’m not really good at coding.
thank tou

Did you reload icinga2 after the modification?
If you are not familiar with the nsclient at all, why use it?
The easiest way to monitor would be just installing the SNMP service on the windows host and then use the check_snmp_* plugins.
Slightly more effort, but more secure would be using the icinga 2 agent.

If you want/must use the nsclient, I’d suggest you go through the documentation.
https://docs.nsclient.org/tutorial/

Yes i reloaded icinga2 of course, the facts is not that i am not familiar with nsclient but with icinga2, i’m sutying IT and i have a 7 week trineeship in a company, in this period i have to install a monitoring solution for the servers, i choose icinga2 because i already worked with icinga in class, i tried to use icinga1 but i couldn’t find a way to dl it in my server… all depots online aren’t working and i don’t know how to do ,otherwise( maybe if you got a solution it would be great to,i’m more familiar with icinga nd it would be more simple for me)But i choose icinga2 and now i’m asking for help in this case cause this is the only thing i need and after that, i’ll be done with this .
Thank you

Hi,

Icinga 1.x was marked EOL and was discontinued by the end of 2018. There is no support for this old software.

One thing I’d recommend to make helping you a little bit more easy:

  • Avoid screenshots, copy the configuration into the reply field, with three backticks enclosed at the beginning and end. That allows users to edit and make suggestions more easily.
  • Follow advice closely, ensure to provide asked settings, configs, logs, etc. in all its details
  • Keep in mind that human beings are on the side who cannot see your screen, Repeat the steps from each iteration, to allow others to follow your actions.

That being said, please add the exact configuration bits from

Let’s try that with the output of icinga2 object list --type Service --name 'Espace-disque' instead of the config snippet.

That’s a new detail, can you share the content of this configuration file from the remote Windows host?

Cheers,
Michael

1 Like

Thank you for your answer, excuse me if i looked unpleasant in my previews messages, i’m nor really comfortable in english.
for your questions, the output of cinga2 object list --type Service --name ‘Espace-disque’ is :
root@srv-supervision:/etc/icinga2/conf.d# icinga2 object list --type Service --name ‘Espace-disque’
Object ‘PC_Françoise!Espace-disque’ of type ‘Service’:
% declared in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29

  • __name = “PC_Françoise!Espace-disque”
  • action_url = “”
  • check_command = “nscp”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 136:3-136:24
  • check_interval = 300
  • check_period = “”
  • check_timeout = null
  • command_endpoint = “”
  • display_name = “Espace-disque”
  • enable_active_checks = true
  • enable_event_handler = true
  • enable_flapping = false
  • enable_notifications = true
  • enable_passive_checks = true
  • enable_perfdata = true
  • event_command = “”
  • flapping_threshold = 0
  • flapping_threshold_high = 30
  • flapping_threshold_low = 25
  • groups = [ ]
  • host_name = “PC_Françoise”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • icon_image = “”
  • icon_image_alt = “”
  • max_check_attempts = 3
  • name = “Espace-disque”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • notes = “”
  • notes_url = “”
  • package = “_etc”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • retry_interval = 60
  • source_location
    • first_column = 1
    • first_line = 134
    • last_column = 29
    • last_line = 134
    • path = “/etc/icinga2/conf.d/services.conf”
  • templates = [ “Espace-disque” ]
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • type = “Service”
  • vars
    • nscp_address = “192.168.200.95”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 142:3-142:38
    • nscp_params = “C”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 141:3-141:24
    • nscp_password = “root”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 138:3-138:29
    • nscp_port = “12489”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 139:3-139:26
    • nscp_variable = “USEDDISKPACE”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 140:3-140:37
  • volatile = false
  • zone = “”

Object ‘PC_Laurent!Espace-disque’ of type ‘Service’:
% declared in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29

  • __name = “PC_Laurent!Espace-disque”
  • action_url = “”
  • check_command = “nscp”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 136:3-136:24
  • check_interval = 300
  • check_period = “”
  • check_timeout = null
  • command_endpoint = “”
  • display_name = “Espace-disque”
  • enable_active_checks = true
  • enable_event_handler = true
  • enable_flapping = false
  • enable_notifications = true
  • enable_passive_checks = true
  • enable_perfdata = true
  • event_command = “”
  • flapping_threshold = 0
  • flapping_threshold_high = 30
  • flapping_threshold_low = 25
  • groups = [ ]
  • host_name = “PC_Laurent”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • icon_image = “”
  • icon_image_alt = “”
  • max_check_attempts = 3
  • name = “Espace-disque”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • notes = “”
  • notes_url = “”
  • package = “_etc”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • retry_interval = 60
  • source_location
    • first_column = 1
    • first_line = 134
    • last_column = 29
    • last_line = 134
    • path = “/etc/icinga2/conf.d/services.conf”
  • templates = [ “Espace-disque” ]
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • type = “Service”
  • vars
    • nscp_address = “192.168.200.95”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 142:3-142:38
    • nscp_params = “C”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 141:3-141:24
    • nscp_password = “root”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 138:3-138:29
    • nscp_port = “12489”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 139:3-139:26
    • nscp_variable = “USEDDISKPACE”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 140:3-140:37
  • volatile = false
  • zone = “”

Object ‘PC_Thomas!Espace-disque’ of type ‘Service’:
% declared in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29

  • __name = “PC_Thomas!Espace-disque”
  • action_url = “”
  • check_command = “nscp”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 136:3-136:24
  • check_interval = 300
  • check_period = “”
  • check_timeout = null
  • command_endpoint = “”
  • display_name = “Espace-disque”
  • enable_active_checks = true
  • enable_event_handler = true
  • enable_flapping = false
  • enable_notifications = true
  • enable_passive_checks = true
  • enable_perfdata = true
  • event_command = “”
  • flapping_threshold = 0
  • flapping_threshold_high = 30
  • flapping_threshold_low = 25
  • groups = [ ]
  • host_name = “PC_Thomas”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • icon_image = “”
  • icon_image_alt = “”
  • max_check_attempts = 3
  • name = “Espace-disque”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • notes = “”
  • notes_url = “”
  • package = “_etc”
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • retry_interval = 60
  • source_location
    • first_column = 1
    • first_line = 134
    • last_column = 29
    • last_line = 134
    • path = “/etc/icinga2/conf.d/services.conf”
  • templates = [ “Espace-disque” ]
    % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 134:1-134:29
  • type = “Service”
  • vars
    • nscp_address = “192.168.200.95”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 142:3-142:38
    • nscp_params = “C”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 141:3-141:24
    • nscp_password = “root”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 138:3-138:29
    • nscp_port = “12489”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 139:3-139:26
    • nscp_variable = “USEDDISKPACE”
      % = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 140:3-140:37
  • volatile = false
  • zone = “”
    and for the content of nsclient.ini the problem is that i don’t know where the file is so i can’ show you the content i send you a screen of the content of the repository:
    image
    maybe the file is one of them but i have no idea
    thank you very much