diff --git a/api/tacticalrmm/api/views.py b/api/tacticalrmm/api/views.py index ee222961..eb48dbd2 100644 --- a/api/tacticalrmm/api/views.py +++ b/api/tacticalrmm/api/views.py @@ -393,8 +393,15 @@ class CheckRunner(APIView): permission_classes = [IsAuthenticated] def get(self, request, pk): + agent = get_object_or_404(Agent, pk=pk) checks = Check.objects.filter(agent__pk=pk) - return Response(CheckRunnerGetSerializer(checks, many=True).data) + + ret = { + "agent": agent.pk, + "check_interval": agent.check_interval, + "checks": CheckRunnerGetSerializer(checks, many=True).data, + } + return Response(ret) def patch(self, request, pk): check = get_object_or_404(Check, pk=pk) @@ -420,8 +427,8 @@ class TaskRunner(APIView): For windows agent """ - # authentication_classes = [TokenAuthentication] - # permission_classes = [IsAuthenticated] + authentication_classes = [TokenAuthentication] + permission_classes = [IsAuthenticated] def get(self, request, pk): diff --git a/api/tacticalrmm/checks/serializers.py b/api/tacticalrmm/checks/serializers.py index 0ef60baf..e82e056b 100644 --- a/api/tacticalrmm/checks/serializers.py +++ b/api/tacticalrmm/checks/serializers.py @@ -63,7 +63,7 @@ class CheckSerializer(serializers.ModelSerializer): class AssignedTaskCheckRunnerField(serializers.ModelSerializer): class Meta: model = AutomatedTask - fields = ["id", "win_task_name", "enabled"] + fields = ["id", "enabled"] class CheckRunnerGetSerializer(serializers.ModelSerializer): @@ -81,7 +81,6 @@ class CheckRunnerGetSerializer(serializers.ModelSerializer): class Meta: model = Check exclude = [ - "agent", "policy", "name", "more_info",